Annotation of /trunk/kernel-magellan/patches-3.6/0107-3.6.8-all-fixes.patch
Parent Directory | Revision Log
Revision 1977 -
(hide annotations)
(download)
Mon Dec 3 13:25:50 2012 UTC (11 years, 9 months ago) by niro
File size: 97270 byte(s)
Mon Dec 3 13:25:50 2012 UTC (11 years, 9 months ago) by niro
File size: 97270 byte(s)
-linux-3.6.8
1 | niro | 1977 | diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt |
2 | index 4372e6b..97aa4eb 100644 | ||
3 | --- a/Documentation/cgroups/memory.txt | ||
4 | +++ b/Documentation/cgroups/memory.txt | ||
5 | @@ -466,6 +466,10 @@ Note: | ||
6 | 5.3 swappiness | ||
7 | |||
8 | Similar to /proc/sys/vm/swappiness, but affecting a hierarchy of groups only. | ||
9 | +Please note that unlike the global swappiness, memcg knob set to 0 | ||
10 | +really prevents from any swapping even if there is a swap storage | ||
11 | +available. This might lead to memcg OOM killer if there are no file | ||
12 | +pages to reclaim. | ||
13 | |||
14 | Following cgroups' swappiness can't be changed. | ||
15 | - root cgroup (uses /proc/sys/vm/swappiness). | ||
16 | diff --git a/arch/arm/boot/dts/tegra30.dtsi b/arch/arm/boot/dts/tegra30.dtsi | ||
17 | index 3e4334d..3f96658 100644 | ||
18 | --- a/arch/arm/boot/dts/tegra30.dtsi | ||
19 | +++ b/arch/arm/boot/dts/tegra30.dtsi | ||
20 | @@ -73,8 +73,8 @@ | ||
21 | |||
22 | pinmux: pinmux { | ||
23 | compatible = "nvidia,tegra30-pinmux"; | ||
24 | - reg = <0x70000868 0xd0 /* Pad control registers */ | ||
25 | - 0x70003000 0x3e0>; /* Mux registers */ | ||
26 | + reg = <0x70000868 0xd4 /* Pad control registers */ | ||
27 | + 0x70003000 0x3e4>; /* Mux registers */ | ||
28 | }; | ||
29 | |||
30 | serial@70006000 { | ||
31 | diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c | ||
32 | index 1b47319..bdbbbbc 100644 | ||
33 | --- a/arch/arm/mach-at91/at91sam9g45_devices.c | ||
34 | +++ b/arch/arm/mach-at91/at91sam9g45_devices.c | ||
35 | @@ -1847,8 +1847,8 @@ static struct resource sha_resources[] = { | ||
36 | .flags = IORESOURCE_MEM, | ||
37 | }, | ||
38 | [1] = { | ||
39 | - .start = AT91SAM9G45_ID_AESTDESSHA, | ||
40 | - .end = AT91SAM9G45_ID_AESTDESSHA, | ||
41 | + .start = NR_IRQS_LEGACY + AT91SAM9G45_ID_AESTDESSHA, | ||
42 | + .end = NR_IRQS_LEGACY + AT91SAM9G45_ID_AESTDESSHA, | ||
43 | .flags = IORESOURCE_IRQ, | ||
44 | }, | ||
45 | }; | ||
46 | @@ -1880,8 +1880,8 @@ static struct resource tdes_resources[] = { | ||
47 | .flags = IORESOURCE_MEM, | ||
48 | }, | ||
49 | [1] = { | ||
50 | - .start = AT91SAM9G45_ID_AESTDESSHA, | ||
51 | - .end = AT91SAM9G45_ID_AESTDESSHA, | ||
52 | + .start = NR_IRQS_LEGACY + AT91SAM9G45_ID_AESTDESSHA, | ||
53 | + .end = NR_IRQS_LEGACY + AT91SAM9G45_ID_AESTDESSHA, | ||
54 | .flags = IORESOURCE_IRQ, | ||
55 | }, | ||
56 | }; | ||
57 | @@ -1916,8 +1916,8 @@ static struct resource aes_resources[] = { | ||
58 | .flags = IORESOURCE_MEM, | ||
59 | }, | ||
60 | [1] = { | ||
61 | - .start = AT91SAM9G45_ID_AESTDESSHA, | ||
62 | - .end = AT91SAM9G45_ID_AESTDESSHA, | ||
63 | + .start = NR_IRQS_LEGACY + AT91SAM9G45_ID_AESTDESSHA, | ||
64 | + .end = NR_IRQS_LEGACY + AT91SAM9G45_ID_AESTDESSHA, | ||
65 | .flags = IORESOURCE_IRQ, | ||
66 | }, | ||
67 | }; | ||
68 | diff --git a/arch/arm/mach-imx/ehci-imx25.c b/arch/arm/mach-imx/ehci-imx25.c | ||
69 | index 05bb41d..8d5b30a 100644 | ||
70 | --- a/arch/arm/mach-imx/ehci-imx25.c | ||
71 | +++ b/arch/arm/mach-imx/ehci-imx25.c | ||
72 | @@ -30,7 +30,7 @@ | ||
73 | #define MX25_H1_SIC_SHIFT 21 | ||
74 | #define MX25_H1_SIC_MASK (0x3 << MX25_H1_SIC_SHIFT) | ||
75 | #define MX25_H1_PP_BIT (1 << 18) | ||
76 | -#define MX25_H1_PM_BIT (1 << 8) | ||
77 | +#define MX25_H1_PM_BIT (1 << 16) | ||
78 | #define MX25_H1_IPPUE_UP_BIT (1 << 7) | ||
79 | #define MX25_H1_IPPUE_DOWN_BIT (1 << 6) | ||
80 | #define MX25_H1_TLL_BIT (1 << 5) | ||
81 | diff --git a/arch/arm/mach-imx/ehci-imx35.c b/arch/arm/mach-imx/ehci-imx35.c | ||
82 | index 73574c3..746ce5f 100644 | ||
83 | --- a/arch/arm/mach-imx/ehci-imx35.c | ||
84 | +++ b/arch/arm/mach-imx/ehci-imx35.c | ||
85 | @@ -30,7 +30,7 @@ | ||
86 | #define MX35_H1_SIC_SHIFT 21 | ||
87 | #define MX35_H1_SIC_MASK (0x3 << MX35_H1_SIC_SHIFT) | ||
88 | #define MX35_H1_PP_BIT (1 << 18) | ||
89 | -#define MX35_H1_PM_BIT (1 << 8) | ||
90 | +#define MX35_H1_PM_BIT (1 << 16) | ||
91 | #define MX35_H1_IPPUE_UP_BIT (1 << 7) | ||
92 | #define MX35_H1_IPPUE_DOWN_BIT (1 << 6) | ||
93 | #define MX35_H1_TLL_BIT (1 << 5) | ||
94 | diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h b/arch/arm/plat-omap/include/plat/omap-serial.h | ||
95 | index 3a57644..1a52725 100644 | ||
96 | --- a/arch/arm/plat-omap/include/plat/omap-serial.h | ||
97 | +++ b/arch/arm/plat-omap/include/plat/omap-serial.h | ||
98 | @@ -42,10 +42,10 @@ | ||
99 | #define OMAP_UART_WER_MOD_WKUP 0X7F | ||
100 | |||
101 | /* Enable XON/XOFF flow control on output */ | ||
102 | -#define OMAP_UART_SW_TX 0x8 | ||
103 | +#define OMAP_UART_SW_TX 0x04 | ||
104 | |||
105 | /* Enable XON/XOFF flow control on input */ | ||
106 | -#define OMAP_UART_SW_RX 0x2 | ||
107 | +#define OMAP_UART_SW_RX 0x04 | ||
108 | |||
109 | #define OMAP_UART_SYSC_RESET 0X07 | ||
110 | #define OMAP_UART_TCR_TRIG 0X0F | ||
111 | diff --git a/arch/m68k/include/asm/signal.h b/arch/m68k/include/asm/signal.h | ||
112 | index 60e8866..93fe83e 100644 | ||
113 | --- a/arch/m68k/include/asm/signal.h | ||
114 | +++ b/arch/m68k/include/asm/signal.h | ||
115 | @@ -156,7 +156,7 @@ typedef struct sigaltstack { | ||
116 | static inline void sigaddset(sigset_t *set, int _sig) | ||
117 | { | ||
118 | asm ("bfset %0{%1,#1}" | ||
119 | - : "+od" (*set) | ||
120 | + : "+o" (*set) | ||
121 | : "id" ((_sig - 1) ^ 31) | ||
122 | : "cc"); | ||
123 | } | ||
124 | @@ -164,7 +164,7 @@ static inline void sigaddset(sigset_t *set, int _sig) | ||
125 | static inline void sigdelset(sigset_t *set, int _sig) | ||
126 | { | ||
127 | asm ("bfclr %0{%1,#1}" | ||
128 | - : "+od" (*set) | ||
129 | + : "+o" (*set) | ||
130 | : "id" ((_sig - 1) ^ 31) | ||
131 | : "cc"); | ||
132 | } | ||
133 | @@ -180,7 +180,7 @@ static inline int __gen_sigismember(sigset_t *set, int _sig) | ||
134 | int ret; | ||
135 | asm ("bfextu %1{%2,#1},%0" | ||
136 | : "=d" (ret) | ||
137 | - : "od" (*set), "id" ((_sig-1) ^ 31) | ||
138 | + : "o" (*set), "id" ((_sig-1) ^ 31) | ||
139 | : "cc"); | ||
140 | return ret; | ||
141 | } | ||
142 | diff --git a/arch/s390/include/asm/compat.h b/arch/s390/include/asm/compat.h | ||
143 | index 234f1d8..2e0a15b 100644 | ||
144 | --- a/arch/s390/include/asm/compat.h | ||
145 | +++ b/arch/s390/include/asm/compat.h | ||
146 | @@ -20,7 +20,7 @@ | ||
147 | #define PSW32_MASK_CC 0x00003000UL | ||
148 | #define PSW32_MASK_PM 0x00000f00UL | ||
149 | |||
150 | -#define PSW32_MASK_USER 0x00003F00UL | ||
151 | +#define PSW32_MASK_USER 0x0000FF00UL | ||
152 | |||
153 | #define PSW32_ADDR_AMODE 0x80000000UL | ||
154 | #define PSW32_ADDR_INSN 0x7FFFFFFFUL | ||
155 | diff --git a/arch/s390/include/asm/ptrace.h b/arch/s390/include/asm/ptrace.h | ||
156 | index d5f08ea..f512565 100644 | ||
157 | --- a/arch/s390/include/asm/ptrace.h | ||
158 | +++ b/arch/s390/include/asm/ptrace.h | ||
159 | @@ -238,7 +238,7 @@ typedef struct | ||
160 | #define PSW_MASK_EA 0x00000000UL | ||
161 | #define PSW_MASK_BA 0x00000000UL | ||
162 | |||
163 | -#define PSW_MASK_USER 0x00003F00UL | ||
164 | +#define PSW_MASK_USER 0x0000FF00UL | ||
165 | |||
166 | #define PSW_ADDR_AMODE 0x80000000UL | ||
167 | #define PSW_ADDR_INSN 0x7FFFFFFFUL | ||
168 | @@ -267,7 +267,7 @@ typedef struct | ||
169 | #define PSW_MASK_EA 0x0000000100000000UL | ||
170 | #define PSW_MASK_BA 0x0000000080000000UL | ||
171 | |||
172 | -#define PSW_MASK_USER 0x00003F0180000000UL | ||
173 | +#define PSW_MASK_USER 0x0000FF0180000000UL | ||
174 | |||
175 | #define PSW_ADDR_AMODE 0x0000000000000000UL | ||
176 | #define PSW_ADDR_INSN 0xFFFFFFFFFFFFFFFFUL | ||
177 | diff --git a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c | ||
178 | index a1e8a86..593fcc9 100644 | ||
179 | --- a/arch/s390/kernel/compat_signal.c | ||
180 | +++ b/arch/s390/kernel/compat_signal.c | ||
181 | @@ -309,6 +309,10 @@ static int restore_sigregs32(struct pt_regs *regs,_sigregs32 __user *sregs) | ||
182 | regs->psw.mask = (regs->psw.mask & ~PSW_MASK_USER) | | ||
183 | (__u64)(regs32.psw.mask & PSW32_MASK_USER) << 32 | | ||
184 | (__u64)(regs32.psw.addr & PSW32_ADDR_AMODE); | ||
185 | + /* Check for invalid user address space control. */ | ||
186 | + if ((regs->psw.mask & PSW_MASK_ASC) >= (psw_kernel_bits & PSW_MASK_ASC)) | ||
187 | + regs->psw.mask = (psw_user_bits & PSW_MASK_ASC) | | ||
188 | + (regs->psw.mask & ~PSW_MASK_ASC); | ||
189 | regs->psw.addr = (__u64)(regs32.psw.addr & PSW32_ADDR_INSN); | ||
190 | for (i = 0; i < NUM_GPRS; i++) | ||
191 | regs->gprs[i] = (__u64) regs32.gprs[i]; | ||
192 | @@ -481,7 +485,10 @@ static int setup_frame32(int sig, struct k_sigaction *ka, | ||
193 | |||
194 | /* Set up registers for signal handler */ | ||
195 | regs->gprs[15] = (__force __u64) frame; | ||
196 | - regs->psw.mask |= PSW_MASK_BA; /* force amode 31 */ | ||
197 | + /* Force 31 bit amode and default user address space control. */ | ||
198 | + regs->psw.mask = PSW_MASK_BA | | ||
199 | + (psw_user_bits & PSW_MASK_ASC) | | ||
200 | + (regs->psw.mask & ~PSW_MASK_ASC); | ||
201 | regs->psw.addr = (__force __u64) ka->sa.sa_handler; | ||
202 | |||
203 | regs->gprs[2] = map_signal(sig); | ||
204 | @@ -549,7 +556,10 @@ static int setup_rt_frame32(int sig, struct k_sigaction *ka, siginfo_t *info, | ||
205 | |||
206 | /* Set up registers for signal handler */ | ||
207 | regs->gprs[15] = (__force __u64) frame; | ||
208 | - regs->psw.mask |= PSW_MASK_BA; /* force amode 31 */ | ||
209 | + /* Force 31 bit amode and default user address space control. */ | ||
210 | + regs->psw.mask = PSW_MASK_BA | | ||
211 | + (psw_user_bits & PSW_MASK_ASC) | | ||
212 | + (regs->psw.mask & ~PSW_MASK_ASC); | ||
213 | regs->psw.addr = (__u64) ka->sa.sa_handler; | ||
214 | |||
215 | regs->gprs[2] = map_signal(sig); | ||
216 | diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c | ||
217 | index c13a2a3..d1259d8 100644 | ||
218 | --- a/arch/s390/kernel/signal.c | ||
219 | +++ b/arch/s390/kernel/signal.c | ||
220 | @@ -136,6 +136,10 @@ static int restore_sigregs(struct pt_regs *regs, _sigregs __user *sregs) | ||
221 | /* Use regs->psw.mask instead of psw_user_bits to preserve PER bit. */ | ||
222 | regs->psw.mask = (regs->psw.mask & ~PSW_MASK_USER) | | ||
223 | (user_sregs.regs.psw.mask & PSW_MASK_USER); | ||
224 | + /* Check for invalid user address space control. */ | ||
225 | + if ((regs->psw.mask & PSW_MASK_ASC) >= (psw_kernel_bits & PSW_MASK_ASC)) | ||
226 | + regs->psw.mask = (psw_user_bits & PSW_MASK_ASC) | | ||
227 | + (regs->psw.mask & ~PSW_MASK_ASC); | ||
228 | /* Check for invalid amode */ | ||
229 | if (regs->psw.mask & PSW_MASK_EA) | ||
230 | regs->psw.mask |= PSW_MASK_BA; | ||
231 | @@ -273,7 +277,10 @@ static int setup_frame(int sig, struct k_sigaction *ka, | ||
232 | |||
233 | /* Set up registers for signal handler */ | ||
234 | regs->gprs[15] = (unsigned long) frame; | ||
235 | - regs->psw.mask |= PSW_MASK_EA | PSW_MASK_BA; /* 64 bit amode */ | ||
236 | + /* Force default amode and default user address space control. */ | ||
237 | + regs->psw.mask = PSW_MASK_EA | PSW_MASK_BA | | ||
238 | + (psw_user_bits & PSW_MASK_ASC) | | ||
239 | + (regs->psw.mask & ~PSW_MASK_ASC); | ||
240 | regs->psw.addr = (unsigned long) ka->sa.sa_handler | PSW_ADDR_AMODE; | ||
241 | |||
242 | regs->gprs[2] = map_signal(sig); | ||
243 | @@ -346,7 +353,10 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | ||
244 | |||
245 | /* Set up registers for signal handler */ | ||
246 | regs->gprs[15] = (unsigned long) frame; | ||
247 | - regs->psw.mask |= PSW_MASK_EA | PSW_MASK_BA; /* 64 bit amode */ | ||
248 | + /* Force default amode and default user address space control. */ | ||
249 | + regs->psw.mask = PSW_MASK_EA | PSW_MASK_BA | | ||
250 | + (psw_user_bits & PSW_MASK_ASC) | | ||
251 | + (regs->psw.mask & ~PSW_MASK_ASC); | ||
252 | regs->psw.addr = (unsigned long) ka->sa.sa_handler | PSW_ADDR_AMODE; | ||
253 | |||
254 | regs->gprs[2] = map_signal(sig); | ||
255 | diff --git a/arch/s390/mm/gup.c b/arch/s390/mm/gup.c | ||
256 | index 65cb06e..4ccf9f5 100644 | ||
257 | --- a/arch/s390/mm/gup.c | ||
258 | +++ b/arch/s390/mm/gup.c | ||
259 | @@ -183,7 +183,7 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write, | ||
260 | addr = start; | ||
261 | len = (unsigned long) nr_pages << PAGE_SHIFT; | ||
262 | end = start + len; | ||
263 | - if (end < start) | ||
264 | + if ((end < start) || (end > TASK_SIZE)) | ||
265 | goto slow_irqon; | ||
266 | |||
267 | /* | ||
268 | diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c | ||
269 | index b1eb202..ff66a3b 100644 | ||
270 | --- a/arch/x86/kvm/vmx.c | ||
271 | +++ b/arch/x86/kvm/vmx.c | ||
272 | @@ -6584,19 +6584,22 @@ static void vmx_cpuid_update(struct kvm_vcpu *vcpu) | ||
273 | } | ||
274 | } | ||
275 | |||
276 | - exec_control = vmcs_read32(SECONDARY_VM_EXEC_CONTROL); | ||
277 | /* Exposing INVPCID only when PCID is exposed */ | ||
278 | best = kvm_find_cpuid_entry(vcpu, 0x7, 0); | ||
279 | if (vmx_invpcid_supported() && | ||
280 | best && (best->ebx & bit(X86_FEATURE_INVPCID)) && | ||
281 | guest_cpuid_has_pcid(vcpu)) { | ||
282 | + exec_control = vmcs_read32(SECONDARY_VM_EXEC_CONTROL); | ||
283 | exec_control |= SECONDARY_EXEC_ENABLE_INVPCID; | ||
284 | vmcs_write32(SECONDARY_VM_EXEC_CONTROL, | ||
285 | exec_control); | ||
286 | } else { | ||
287 | - exec_control &= ~SECONDARY_EXEC_ENABLE_INVPCID; | ||
288 | - vmcs_write32(SECONDARY_VM_EXEC_CONTROL, | ||
289 | - exec_control); | ||
290 | + if (cpu_has_secondary_exec_ctrls()) { | ||
291 | + exec_control = vmcs_read32(SECONDARY_VM_EXEC_CONTROL); | ||
292 | + exec_control &= ~SECONDARY_EXEC_ENABLE_INVPCID; | ||
293 | + vmcs_write32(SECONDARY_VM_EXEC_CONTROL, | ||
294 | + exec_control); | ||
295 | + } | ||
296 | if (best) | ||
297 | best->ebx &= ~bit(X86_FEATURE_INVPCID); | ||
298 | } | ||
299 | diff --git a/crypto/cryptd.c b/crypto/cryptd.c | ||
300 | index 671d4d6..7bdd61b 100644 | ||
301 | --- a/crypto/cryptd.c | ||
302 | +++ b/crypto/cryptd.c | ||
303 | @@ -137,13 +137,18 @@ static void cryptd_queue_worker(struct work_struct *work) | ||
304 | struct crypto_async_request *req, *backlog; | ||
305 | |||
306 | cpu_queue = container_of(work, struct cryptd_cpu_queue, work); | ||
307 | - /* Only handle one request at a time to avoid hogging crypto | ||
308 | - * workqueue. preempt_disable/enable is used to prevent | ||
309 | - * being preempted by cryptd_enqueue_request() */ | ||
310 | + /* | ||
311 | + * Only handle one request at a time to avoid hogging crypto workqueue. | ||
312 | + * preempt_disable/enable is used to prevent being preempted by | ||
313 | + * cryptd_enqueue_request(). local_bh_disable/enable is used to prevent | ||
314 | + * cryptd_enqueue_request() being accessed from software interrupts. | ||
315 | + */ | ||
316 | + local_bh_disable(); | ||
317 | preempt_disable(); | ||
318 | backlog = crypto_get_backlog(&cpu_queue->queue); | ||
319 | req = crypto_dequeue_request(&cpu_queue->queue); | ||
320 | preempt_enable(); | ||
321 | + local_bh_enable(); | ||
322 | |||
323 | if (!req) | ||
324 | return; | ||
325 | diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c | ||
326 | index 1e0a9e1..9fe2659 100644 | ||
327 | --- a/drivers/acpi/video.c | ||
328 | +++ b/drivers/acpi/video.c | ||
329 | @@ -1345,12 +1345,15 @@ static int | ||
330 | acpi_video_bus_get_devices(struct acpi_video_bus *video, | ||
331 | struct acpi_device *device) | ||
332 | { | ||
333 | - int status; | ||
334 | + int status = 0; | ||
335 | struct acpi_device *dev; | ||
336 | |||
337 | - status = acpi_video_device_enumerate(video); | ||
338 | - if (status) | ||
339 | - return status; | ||
340 | + /* | ||
341 | + * There are systems where video module known to work fine regardless | ||
342 | + * of broken _DOD and ignoring returned value here doesn't cause | ||
343 | + * any issues later. | ||
344 | + */ | ||
345 | + acpi_video_device_enumerate(video); | ||
346 | |||
347 | list_for_each_entry(dev, &device->children, node) { | ||
348 | |||
349 | diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c | ||
350 | index fd9ecf7..5b0ba3f 100644 | ||
351 | --- a/drivers/ata/libata-acpi.c | ||
352 | +++ b/drivers/ata/libata-acpi.c | ||
353 | @@ -1105,10 +1105,15 @@ static int ata_acpi_bind_device(struct ata_port *ap, struct scsi_device *sdev, | ||
354 | struct acpi_device *acpi_dev; | ||
355 | struct acpi_device_power_state *states; | ||
356 | |||
357 | - if (ap->flags & ATA_FLAG_ACPI_SATA) | ||
358 | - ata_dev = &ap->link.device[sdev->channel]; | ||
359 | - else | ||
360 | + if (ap->flags & ATA_FLAG_ACPI_SATA) { | ||
361 | + if (!sata_pmp_attached(ap)) | ||
362 | + ata_dev = &ap->link.device[sdev->id]; | ||
363 | + else | ||
364 | + ata_dev = &ap->pmp_link[sdev->channel].device[sdev->id]; | ||
365 | + } | ||
366 | + else { | ||
367 | ata_dev = &ap->link.device[sdev->id]; | ||
368 | + } | ||
369 | |||
370 | *handle = ata_dev_acpi_handle(ata_dev); | ||
371 | |||
372 | diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c | ||
373 | index 20cb52d..d554f64 100644 | ||
374 | --- a/drivers/gpu/drm/i915/intel_sdvo.c | ||
375 | +++ b/drivers/gpu/drm/i915/intel_sdvo.c | ||
376 | @@ -2287,6 +2287,18 @@ intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, uint16_t flags) | ||
377 | return true; | ||
378 | } | ||
379 | |||
380 | +static void intel_sdvo_output_cleanup(struct intel_sdvo *intel_sdvo) | ||
381 | +{ | ||
382 | + struct drm_device *dev = intel_sdvo->base.base.dev; | ||
383 | + struct drm_connector *connector, *tmp; | ||
384 | + | ||
385 | + list_for_each_entry_safe(connector, tmp, | ||
386 | + &dev->mode_config.connector_list, head) { | ||
387 | + if (intel_attached_encoder(connector) == &intel_sdvo->base) | ||
388 | + intel_sdvo_destroy(connector); | ||
389 | + } | ||
390 | +} | ||
391 | + | ||
392 | static bool intel_sdvo_tv_create_property(struct intel_sdvo *intel_sdvo, | ||
393 | struct intel_sdvo_connector *intel_sdvo_connector, | ||
394 | int type) | ||
395 | @@ -2606,7 +2618,8 @@ bool intel_sdvo_init(struct drm_device *dev, uint32_t sdvo_reg, bool is_sdvob) | ||
396 | intel_sdvo->caps.output_flags) != true) { | ||
397 | DRM_DEBUG_KMS("SDVO output failed to setup on %s\n", | ||
398 | SDVO_NAME(intel_sdvo)); | ||
399 | - goto err; | ||
400 | + /* Output_setup can leave behind connectors! */ | ||
401 | + goto err_output; | ||
402 | } | ||
403 | |||
404 | /* Only enable the hotplug irq if we need it, to work around noisy | ||
405 | @@ -2619,12 +2632,12 @@ bool intel_sdvo_init(struct drm_device *dev, uint32_t sdvo_reg, bool is_sdvob) | ||
406 | |||
407 | /* Set the input timing to the screen. Assume always input 0. */ | ||
408 | if (!intel_sdvo_set_target_input(intel_sdvo)) | ||
409 | - goto err; | ||
410 | + goto err_output; | ||
411 | |||
412 | if (!intel_sdvo_get_input_pixel_clock_range(intel_sdvo, | ||
413 | &intel_sdvo->pixel_clock_min, | ||
414 | &intel_sdvo->pixel_clock_max)) | ||
415 | - goto err; | ||
416 | + goto err_output; | ||
417 | |||
418 | DRM_DEBUG_KMS("%s device VID/DID: %02X:%02X.%02X, " | ||
419 | "clock range %dMHz - %dMHz, " | ||
420 | @@ -2644,6 +2657,9 @@ bool intel_sdvo_init(struct drm_device *dev, uint32_t sdvo_reg, bool is_sdvob) | ||
421 | (SDVO_OUTPUT_TMDS1 | SDVO_OUTPUT_RGB1) ? 'Y' : 'N'); | ||
422 | return true; | ||
423 | |||
424 | +err_output: | ||
425 | + intel_sdvo_output_cleanup(intel_sdvo); | ||
426 | + | ||
427 | err: | ||
428 | drm_encoder_cleanup(&intel_encoder->base); | ||
429 | i2c_del_adapter(&intel_sdvo->ddc); | ||
430 | diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c | ||
431 | index 6e8803a..2eb418e 100644 | ||
432 | --- a/drivers/gpu/drm/radeon/atombios_encoders.c | ||
433 | +++ b/drivers/gpu/drm/radeon/atombios_encoders.c | ||
434 | @@ -1421,7 +1421,7 @@ radeon_atom_encoder_dpms_dig(struct drm_encoder *encoder, int mode) | ||
435 | atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_SETUP, 0, 0); | ||
436 | atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE, 0, 0); | ||
437 | /* some early dce3.2 boards have a bug in their transmitter control table */ | ||
438 | - if ((rdev->family != CHIP_RV710) || (rdev->family != CHIP_RV730)) | ||
439 | + if ((rdev->family != CHIP_RV710) && (rdev->family != CHIP_RV730)) | ||
440 | atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE_OUTPUT, 0, 0); | ||
441 | } | ||
442 | if (ENCODER_MODE_IS_DP(atombios_get_encoder_mode(encoder)) && connector) { | ||
443 | diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c | ||
444 | index ebc6fac..578207e 100644 | ||
445 | --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c | ||
446 | +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c | ||
447 | @@ -749,7 +749,10 @@ static int ttm_get_pages(struct page **pages, unsigned npages, int flags, | ||
448 | /* clear the pages coming from the pool if requested */ | ||
449 | if (flags & TTM_PAGE_FLAG_ZERO_ALLOC) { | ||
450 | list_for_each_entry(p, &plist, lru) { | ||
451 | - clear_page(page_address(p)); | ||
452 | + if (PageHighMem(p)) | ||
453 | + clear_highpage(p); | ||
454 | + else | ||
455 | + clear_page(page_address(p)); | ||
456 | } | ||
457 | } | ||
458 | |||
459 | diff --git a/drivers/i2c/muxes/i2c-mux-pinctrl.c b/drivers/i2c/muxes/i2c-mux-pinctrl.c | ||
460 | index 46a6697..c524018 100644 | ||
461 | --- a/drivers/i2c/muxes/i2c-mux-pinctrl.c | ||
462 | +++ b/drivers/i2c/muxes/i2c-mux-pinctrl.c | ||
463 | @@ -169,7 +169,7 @@ static int __devinit i2c_mux_pinctrl_probe(struct platform_device *pdev) | ||
464 | mux->busses = devm_kzalloc(&pdev->dev, | ||
465 | sizeof(mux->busses) * mux->pdata->bus_count, | ||
466 | GFP_KERNEL); | ||
467 | - if (!mux->states) { | ||
468 | + if (!mux->busses) { | ||
469 | dev_err(&pdev->dev, "Cannot allocate busses\n"); | ||
470 | ret = -ENOMEM; | ||
471 | goto err; | ||
472 | diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c | ||
473 | index cb9e114..554e6ac 100644 | ||
474 | --- a/drivers/iommu/intel-iommu.c | ||
475 | +++ b/drivers/iommu/intel-iommu.c | ||
476 | @@ -4108,7 +4108,7 @@ static void swap_pci_ref(struct pci_dev **from, struct pci_dev *to) | ||
477 | static int intel_iommu_add_device(struct device *dev) | ||
478 | { | ||
479 | struct pci_dev *pdev = to_pci_dev(dev); | ||
480 | - struct pci_dev *bridge, *dma_pdev; | ||
481 | + struct pci_dev *bridge, *dma_pdev = NULL; | ||
482 | struct iommu_group *group; | ||
483 | int ret; | ||
484 | |||
485 | @@ -4122,7 +4122,7 @@ static int intel_iommu_add_device(struct device *dev) | ||
486 | dma_pdev = pci_get_domain_bus_and_slot( | ||
487 | pci_domain_nr(pdev->bus), | ||
488 | bridge->subordinate->number, 0); | ||
489 | - else | ||
490 | + if (!dma_pdev) | ||
491 | dma_pdev = pci_dev_get(bridge); | ||
492 | } else | ||
493 | dma_pdev = pci_dev_get(pdev); | ||
494 | diff --git a/drivers/net/ethernet/broadcom/Kconfig b/drivers/net/ethernet/broadcom/Kconfig | ||
495 | index f15e72e..4bd416b 100644 | ||
496 | --- a/drivers/net/ethernet/broadcom/Kconfig | ||
497 | +++ b/drivers/net/ethernet/broadcom/Kconfig | ||
498 | @@ -101,6 +101,7 @@ config TIGON3 | ||
499 | tristate "Broadcom Tigon3 support" | ||
500 | depends on PCI | ||
501 | select PHYLIB | ||
502 | + select HWMON | ||
503 | ---help--- | ||
504 | This driver supports Broadcom Tigon3 based gigabit Ethernet cards. | ||
505 | |||
506 | diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c | ||
507 | index bf906c5..711eb14 100644 | ||
508 | --- a/drivers/net/ethernet/broadcom/tg3.c | ||
509 | +++ b/drivers/net/ethernet/broadcom/tg3.c | ||
510 | @@ -44,10 +44,8 @@ | ||
511 | #include <linux/prefetch.h> | ||
512 | #include <linux/dma-mapping.h> | ||
513 | #include <linux/firmware.h> | ||
514 | -#if IS_ENABLED(CONFIG_HWMON) | ||
515 | #include <linux/hwmon.h> | ||
516 | #include <linux/hwmon-sysfs.h> | ||
517 | -#endif | ||
518 | |||
519 | #include <net/checksum.h> | ||
520 | #include <net/ip.h> | ||
521 | @@ -9517,7 +9515,6 @@ static int tg3_init_hw(struct tg3 *tp, int reset_phy) | ||
522 | return tg3_reset_hw(tp, reset_phy); | ||
523 | } | ||
524 | |||
525 | -#if IS_ENABLED(CONFIG_HWMON) | ||
526 | static void tg3_sd_scan_scratchpad(struct tg3 *tp, struct tg3_ocir *ocir) | ||
527 | { | ||
528 | int i; | ||
529 | @@ -9570,22 +9567,17 @@ static const struct attribute_group tg3_group = { | ||
530 | .attrs = tg3_attributes, | ||
531 | }; | ||
532 | |||
533 | -#endif | ||
534 | - | ||
535 | static void tg3_hwmon_close(struct tg3 *tp) | ||
536 | { | ||
537 | -#if IS_ENABLED(CONFIG_HWMON) | ||
538 | if (tp->hwmon_dev) { | ||
539 | hwmon_device_unregister(tp->hwmon_dev); | ||
540 | tp->hwmon_dev = NULL; | ||
541 | sysfs_remove_group(&tp->pdev->dev.kobj, &tg3_group); | ||
542 | } | ||
543 | -#endif | ||
544 | } | ||
545 | |||
546 | static void tg3_hwmon_open(struct tg3 *tp) | ||
547 | { | ||
548 | -#if IS_ENABLED(CONFIG_HWMON) | ||
549 | int i, err; | ||
550 | u32 size = 0; | ||
551 | struct pci_dev *pdev = tp->pdev; | ||
552 | @@ -9617,7 +9609,6 @@ static void tg3_hwmon_open(struct tg3 *tp) | ||
553 | dev_err(&pdev->dev, "Cannot register hwmon device, aborting\n"); | ||
554 | sysfs_remove_group(&pdev->dev.kobj, &tg3_group); | ||
555 | } | ||
556 | -#endif | ||
557 | } | ||
558 | |||
559 | |||
560 | diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c | ||
561 | index b47d5b3..df7bbba 100644 | ||
562 | --- a/drivers/net/ethernet/realtek/r8169.c | ||
563 | +++ b/drivers/net/ethernet/realtek/r8169.c | ||
564 | @@ -77,7 +77,7 @@ | ||
565 | static const int multicast_filter_limit = 32; | ||
566 | |||
567 | #define MAX_READ_REQUEST_SHIFT 12 | ||
568 | -#define TX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */ | ||
569 | +#define TX_DMA_BURST 7 /* Maximum PCI burst, '7' is unlimited */ | ||
570 | #define SafeMtu 0x1c20 /* ... actually life sucks beyond ~7k */ | ||
571 | #define InterFrameGap 0x03 /* 3 means InterFrameGap = the shortest one */ | ||
572 | |||
573 | @@ -3832,6 +3832,8 @@ static void rtl_wol_suspend_quirk(struct rtl8169_private *tp) | ||
574 | void __iomem *ioaddr = tp->mmio_addr; | ||
575 | |||
576 | switch (tp->mac_version) { | ||
577 | + case RTL_GIGA_MAC_VER_25: | ||
578 | + case RTL_GIGA_MAC_VER_26: | ||
579 | case RTL_GIGA_MAC_VER_29: | ||
580 | case RTL_GIGA_MAC_VER_30: | ||
581 | case RTL_GIGA_MAC_VER_32: | ||
582 | @@ -4524,6 +4526,9 @@ static void rtl_set_rx_mode(struct net_device *dev) | ||
583 | mc_filter[1] = swab32(data); | ||
584 | } | ||
585 | |||
586 | + if (tp->mac_version == RTL_GIGA_MAC_VER_35) | ||
587 | + mc_filter[1] = mc_filter[0] = 0xffffffff; | ||
588 | + | ||
589 | RTL_W32(MAR0 + 4, mc_filter[1]); | ||
590 | RTL_W32(MAR0 + 0, mc_filter[0]); | ||
591 | |||
592 | diff --git a/drivers/net/wireless/iwlwifi/pcie/rx.c b/drivers/net/wireless/iwlwifi/pcie/rx.c | ||
593 | index d1a61ba..c3d2751 100644 | ||
594 | --- a/drivers/net/wireless/iwlwifi/pcie/rx.c | ||
595 | +++ b/drivers/net/wireless/iwlwifi/pcie/rx.c | ||
596 | @@ -314,6 +314,14 @@ static void iwlagn_rx_allocate(struct iwl_trans *trans, gfp_t priority) | ||
597 | dma_map_page(trans->dev, page, 0, | ||
598 | PAGE_SIZE << trans_pcie->rx_page_order, | ||
599 | DMA_FROM_DEVICE); | ||
600 | + if (dma_mapping_error(trans->dev, rxb->page_dma)) { | ||
601 | + rxb->page = NULL; | ||
602 | + spin_lock_irqsave(&rxq->lock, flags); | ||
603 | + list_add(&rxb->list, &rxq->rx_used); | ||
604 | + spin_unlock_irqrestore(&rxq->lock, flags); | ||
605 | + __free_pages(page, trans_pcie->rx_page_order); | ||
606 | + return; | ||
607 | + } | ||
608 | /* dma address must be no more than 36 bits */ | ||
609 | BUG_ON(rxb->page_dma & ~DMA_BIT_MASK(36)); | ||
610 | /* and also 256 byte aligned! */ | ||
611 | @@ -463,8 +471,19 @@ static void iwl_rx_handle_rxbuf(struct iwl_trans *trans, | ||
612 | dma_map_page(trans->dev, rxb->page, 0, | ||
613 | PAGE_SIZE << trans_pcie->rx_page_order, | ||
614 | DMA_FROM_DEVICE); | ||
615 | - list_add_tail(&rxb->list, &rxq->rx_free); | ||
616 | - rxq->free_count++; | ||
617 | + if (dma_mapping_error(trans->dev, rxb->page_dma)) { | ||
618 | + /* | ||
619 | + * free the page(s) as well to not break | ||
620 | + * the invariant that the items on the used | ||
621 | + * list have no page(s) | ||
622 | + */ | ||
623 | + __free_pages(rxb->page, trans_pcie->rx_page_order); | ||
624 | + rxb->page = NULL; | ||
625 | + list_add_tail(&rxb->list, &rxq->rx_used); | ||
626 | + } else { | ||
627 | + list_add_tail(&rxb->list, &rxq->rx_free); | ||
628 | + rxq->free_count++; | ||
629 | + } | ||
630 | } else | ||
631 | list_add_tail(&rxb->list, &rxq->rx_used); | ||
632 | spin_unlock_irqrestore(&rxq->lock, flags); | ||
633 | diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c | ||
634 | index d6fd6b6..729e038 100644 | ||
635 | --- a/drivers/pci/pci-driver.c | ||
636 | +++ b/drivers/pci/pci-driver.c | ||
637 | @@ -421,6 +421,8 @@ static void pci_device_shutdown(struct device *dev) | ||
638 | struct pci_dev *pci_dev = to_pci_dev(dev); | ||
639 | struct pci_driver *drv = pci_dev->driver; | ||
640 | |||
641 | + pm_runtime_resume(dev); | ||
642 | + | ||
643 | if (drv && drv->shutdown) | ||
644 | drv->shutdown(pci_dev); | ||
645 | pci_msi_shutdown(pci_dev); | ||
646 | @@ -431,16 +433,6 @@ static void pci_device_shutdown(struct device *dev) | ||
647 | * continue to do DMA | ||
648 | */ | ||
649 | pci_disable_device(pci_dev); | ||
650 | - | ||
651 | - /* | ||
652 | - * Devices may be enabled to wake up by runtime PM, but they need not | ||
653 | - * be supposed to wake up the system from its "power off" state (e.g. | ||
654 | - * ACPI S5). Therefore disable wakeup for all devices that aren't | ||
655 | - * supposed to wake up the system at this point. The state argument | ||
656 | - * will be ignored by pci_enable_wake(). | ||
657 | - */ | ||
658 | - if (!device_may_wakeup(dev)) | ||
659 | - pci_enable_wake(pci_dev, PCI_UNKNOWN, false); | ||
660 | } | ||
661 | |||
662 | #ifdef CONFIG_PM | ||
663 | diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c | ||
664 | index 02d107b..f39378d 100644 | ||
665 | --- a/drivers/pci/pci-sysfs.c | ||
666 | +++ b/drivers/pci/pci-sysfs.c | ||
667 | @@ -458,40 +458,6 @@ boot_vga_show(struct device *dev, struct device_attribute *attr, char *buf) | ||
668 | } | ||
669 | struct device_attribute vga_attr = __ATTR_RO(boot_vga); | ||
670 | |||
671 | -static void | ||
672 | -pci_config_pm_runtime_get(struct pci_dev *pdev) | ||
673 | -{ | ||
674 | - struct device *dev = &pdev->dev; | ||
675 | - struct device *parent = dev->parent; | ||
676 | - | ||
677 | - if (parent) | ||
678 | - pm_runtime_get_sync(parent); | ||
679 | - pm_runtime_get_noresume(dev); | ||
680 | - /* | ||
681 | - * pdev->current_state is set to PCI_D3cold during suspending, | ||
682 | - * so wait until suspending completes | ||
683 | - */ | ||
684 | - pm_runtime_barrier(dev); | ||
685 | - /* | ||
686 | - * Only need to resume devices in D3cold, because config | ||
687 | - * registers are still accessible for devices suspended but | ||
688 | - * not in D3cold. | ||
689 | - */ | ||
690 | - if (pdev->current_state == PCI_D3cold) | ||
691 | - pm_runtime_resume(dev); | ||
692 | -} | ||
693 | - | ||
694 | -static void | ||
695 | -pci_config_pm_runtime_put(struct pci_dev *pdev) | ||
696 | -{ | ||
697 | - struct device *dev = &pdev->dev; | ||
698 | - struct device *parent = dev->parent; | ||
699 | - | ||
700 | - pm_runtime_put(dev); | ||
701 | - if (parent) | ||
702 | - pm_runtime_put_sync(parent); | ||
703 | -} | ||
704 | - | ||
705 | static ssize_t | ||
706 | pci_read_config(struct file *filp, struct kobject *kobj, | ||
707 | struct bin_attribute *bin_attr, | ||
708 | diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c | ||
709 | index ab4bf5a..a0f8e8f 100644 | ||
710 | --- a/drivers/pci/pci.c | ||
711 | +++ b/drivers/pci/pci.c | ||
712 | @@ -1910,6 +1910,38 @@ bool pci_dev_run_wake(struct pci_dev *dev) | ||
713 | } | ||
714 | EXPORT_SYMBOL_GPL(pci_dev_run_wake); | ||
715 | |||
716 | +void pci_config_pm_runtime_get(struct pci_dev *pdev) | ||
717 | +{ | ||
718 | + struct device *dev = &pdev->dev; | ||
719 | + struct device *parent = dev->parent; | ||
720 | + | ||
721 | + if (parent) | ||
722 | + pm_runtime_get_sync(parent); | ||
723 | + pm_runtime_get_noresume(dev); | ||
724 | + /* | ||
725 | + * pdev->current_state is set to PCI_D3cold during suspending, | ||
726 | + * so wait until suspending completes | ||
727 | + */ | ||
728 | + pm_runtime_barrier(dev); | ||
729 | + /* | ||
730 | + * Only need to resume devices in D3cold, because config | ||
731 | + * registers are still accessible for devices suspended but | ||
732 | + * not in D3cold. | ||
733 | + */ | ||
734 | + if (pdev->current_state == PCI_D3cold) | ||
735 | + pm_runtime_resume(dev); | ||
736 | +} | ||
737 | + | ||
738 | +void pci_config_pm_runtime_put(struct pci_dev *pdev) | ||
739 | +{ | ||
740 | + struct device *dev = &pdev->dev; | ||
741 | + struct device *parent = dev->parent; | ||
742 | + | ||
743 | + pm_runtime_put(dev); | ||
744 | + if (parent) | ||
745 | + pm_runtime_put_sync(parent); | ||
746 | +} | ||
747 | + | ||
748 | /** | ||
749 | * pci_pm_init - Initialize PM functions of given PCI device | ||
750 | * @dev: PCI device to handle. | ||
751 | diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h | ||
752 | index bacbcba..fd92aab 100644 | ||
753 | --- a/drivers/pci/pci.h | ||
754 | +++ b/drivers/pci/pci.h | ||
755 | @@ -72,6 +72,8 @@ extern void pci_disable_enabled_device(struct pci_dev *dev); | ||
756 | extern int pci_finish_runtime_suspend(struct pci_dev *dev); | ||
757 | extern int __pci_pme_wakeup(struct pci_dev *dev, void *ign); | ||
758 | extern void pci_wakeup_bus(struct pci_bus *bus); | ||
759 | +extern void pci_config_pm_runtime_get(struct pci_dev *dev); | ||
760 | +extern void pci_config_pm_runtime_put(struct pci_dev *dev); | ||
761 | extern void pci_pm_init(struct pci_dev *dev); | ||
762 | extern void platform_pci_wakeup_init(struct pci_dev *dev); | ||
763 | extern void pci_allocate_cap_save_buffers(struct pci_dev *dev); | ||
764 | diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c | ||
765 | index 27911b5..af028c7 100644 | ||
766 | --- a/drivers/pci/proc.c | ||
767 | +++ b/drivers/pci/proc.c | ||
768 | @@ -76,6 +76,8 @@ proc_bus_pci_read(struct file *file, char __user *buf, size_t nbytes, loff_t *pp | ||
769 | if (!access_ok(VERIFY_WRITE, buf, cnt)) | ||
770 | return -EINVAL; | ||
771 | |||
772 | + pci_config_pm_runtime_get(dev); | ||
773 | + | ||
774 | if ((pos & 1) && cnt) { | ||
775 | unsigned char val; | ||
776 | pci_user_read_config_byte(dev, pos, &val); | ||
777 | @@ -121,6 +123,8 @@ proc_bus_pci_read(struct file *file, char __user *buf, size_t nbytes, loff_t *pp | ||
778 | cnt--; | ||
779 | } | ||
780 | |||
781 | + pci_config_pm_runtime_put(dev); | ||
782 | + | ||
783 | *ppos = pos; | ||
784 | return nbytes; | ||
785 | } | ||
786 | @@ -146,6 +150,8 @@ proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, lof | ||
787 | if (!access_ok(VERIFY_READ, buf, cnt)) | ||
788 | return -EINVAL; | ||
789 | |||
790 | + pci_config_pm_runtime_get(dev); | ||
791 | + | ||
792 | if ((pos & 1) && cnt) { | ||
793 | unsigned char val; | ||
794 | __get_user(val, buf); | ||
795 | @@ -191,6 +197,8 @@ proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, lof | ||
796 | cnt--; | ||
797 | } | ||
798 | |||
799 | + pci_config_pm_runtime_put(dev); | ||
800 | + | ||
801 | *ppos = pos; | ||
802 | i_size_write(ino, dp->size); | ||
803 | return nbytes; | ||
804 | diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c | ||
805 | index 4838531..e6f2990a 100644 | ||
806 | --- a/drivers/regulator/core.c | ||
807 | +++ b/drivers/regulator/core.c | ||
808 | @@ -1942,7 +1942,7 @@ int regulator_is_supported_voltage(struct regulator *regulator, | ||
809 | if (!(rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_VOLTAGE)) { | ||
810 | ret = regulator_get_voltage(regulator); | ||
811 | if (ret >= 0) | ||
812 | - return (min_uV >= ret && ret <= max_uV); | ||
813 | + return (min_uV <= ret && ret <= max_uV); | ||
814 | else | ||
815 | return ret; | ||
816 | } | ||
817 | diff --git a/drivers/scsi/isci/host.c b/drivers/scsi/isci/host.c | ||
818 | index 45385f5..446fdd8 100644 | ||
819 | --- a/drivers/scsi/isci/host.c | ||
820 | +++ b/drivers/scsi/isci/host.c | ||
821 | @@ -1079,7 +1079,6 @@ static void sci_controller_completion_handler(struct isci_host *ihost) | ||
822 | |||
823 | void ireq_done(struct isci_host *ihost, struct isci_request *ireq, struct sas_task *task) | ||
824 | { | ||
825 | - task->lldd_task = NULL; | ||
826 | if (!test_bit(IREQ_ABORT_PATH_ACTIVE, &ireq->flags) && | ||
827 | !(task->task_state_flags & SAS_TASK_STATE_ABORTED)) { | ||
828 | if (test_bit(IREQ_COMPLETE_IN_TARGET, &ireq->flags)) { | ||
829 | @@ -1087,16 +1086,19 @@ void ireq_done(struct isci_host *ihost, struct isci_request *ireq, struct sas_ta | ||
830 | dev_dbg(&ihost->pdev->dev, | ||
831 | "%s: Normal - ireq/task = %p/%p\n", | ||
832 | __func__, ireq, task); | ||
833 | - | ||
834 | + task->lldd_task = NULL; | ||
835 | task->task_done(task); | ||
836 | } else { | ||
837 | dev_dbg(&ihost->pdev->dev, | ||
838 | "%s: Error - ireq/task = %p/%p\n", | ||
839 | __func__, ireq, task); | ||
840 | - | ||
841 | + if (sas_protocol_ata(task->task_proto)) | ||
842 | + task->lldd_task = NULL; | ||
843 | sas_task_abort(task); | ||
844 | } | ||
845 | - } | ||
846 | + } else | ||
847 | + task->lldd_task = NULL; | ||
848 | + | ||
849 | if (test_and_clear_bit(IREQ_ABORT_PATH_ACTIVE, &ireq->flags)) | ||
850 | wake_up_all(&ihost->eventq); | ||
851 | |||
852 | diff --git a/drivers/staging/android/android_alarm.h b/drivers/staging/android/android_alarm.h | ||
853 | index f2ffd96..d0cafd6 100644 | ||
854 | --- a/drivers/staging/android/android_alarm.h | ||
855 | +++ b/drivers/staging/android/android_alarm.h | ||
856 | @@ -51,12 +51,10 @@ enum android_alarm_return_flags { | ||
857 | #define ANDROID_ALARM_WAIT _IO('a', 1) | ||
858 | |||
859 | #define ALARM_IOW(c, type, size) _IOW('a', (c) | ((type) << 4), size) | ||
860 | -#define ALARM_IOR(c, type, size) _IOR('a', (c) | ((type) << 4), size) | ||
861 | - | ||
862 | /* Set alarm */ | ||
863 | #define ANDROID_ALARM_SET(type) ALARM_IOW(2, type, struct timespec) | ||
864 | #define ANDROID_ALARM_SET_AND_WAIT(type) ALARM_IOW(3, type, struct timespec) | ||
865 | -#define ANDROID_ALARM_GET_TIME(type) ALARM_IOR(4, type, struct timespec) | ||
866 | +#define ANDROID_ALARM_GET_TIME(type) ALARM_IOW(4, type, struct timespec) | ||
867 | #define ANDROID_ALARM_SET_RTC _IOW('a', 5, struct timespec) | ||
868 | #define ANDROID_ALARM_BASE_CMD(cmd) (cmd & ~(_IOC(0, 0, 0xf0, 0))) | ||
869 | #define ANDROID_ALARM_IOCTL_TO_TYPE(cmd) (_IOC_NR(cmd) >> 4) | ||
870 | diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c | ||
871 | index 22992cd..d3cda0c 100644 | ||
872 | --- a/drivers/tty/serial/omap-serial.c | ||
873 | +++ b/drivers/tty/serial/omap-serial.c | ||
874 | @@ -667,19 +667,19 @@ serial_omap_configure_xonxoff | ||
875 | |||
876 | /* | ||
877 | * IXON Flag: | ||
878 | - * Flow control for OMAP.TX | ||
879 | - * OMAP.RX should listen for XON/XOFF | ||
880 | + * Enable XON/XOFF flow control on output. | ||
881 | + * Transmit XON1, XOFF1 | ||
882 | */ | ||
883 | if (termios->c_iflag & IXON) | ||
884 | - up->efr |= OMAP_UART_SW_RX; | ||
885 | + up->efr |= OMAP_UART_SW_TX; | ||
886 | |||
887 | /* | ||
888 | * IXOFF Flag: | ||
889 | - * Flow control for OMAP.RX | ||
890 | - * OMAP.TX should send XON/XOFF | ||
891 | + * Enable XON/XOFF flow control on input. | ||
892 | + * Receiver compares XON1, XOFF1. | ||
893 | */ | ||
894 | if (termios->c_iflag & IXOFF) | ||
895 | - up->efr |= OMAP_UART_SW_TX; | ||
896 | + up->efr |= OMAP_UART_SW_RX; | ||
897 | |||
898 | serial_out(up, UART_EFR, up->efr | UART_EFR_ECB); | ||
899 | serial_out(up, UART_LCR, UART_LCR_CONF_MODE_A); | ||
900 | diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c | ||
901 | index f6788d7..059d44b 100644 | ||
902 | --- a/drivers/usb/serial/keyspan.c | ||
903 | +++ b/drivers/usb/serial/keyspan.c | ||
904 | @@ -2448,7 +2448,7 @@ static void keyspan_release(struct usb_serial *serial) | ||
905 | static int keyspan_port_probe(struct usb_serial_port *port) | ||
906 | { | ||
907 | struct usb_serial *serial = port->serial; | ||
908 | - struct keyspan_port_private *s_priv; | ||
909 | + struct keyspan_serial_private *s_priv; | ||
910 | struct keyspan_port_private *p_priv; | ||
911 | const struct keyspan_device_details *d_details; | ||
912 | struct callbacks *cback; | ||
913 | @@ -2463,7 +2463,6 @@ static int keyspan_port_probe(struct usb_serial_port *port) | ||
914 | if (!p_priv) | ||
915 | return -ENOMEM; | ||
916 | |||
917 | - s_priv = usb_get_serial_data(port->serial); | ||
918 | p_priv->device_details = d_details; | ||
919 | |||
920 | /* Setup values for the various callback routines */ | ||
921 | diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c | ||
922 | index 76a48e4..f852329 100644 | ||
923 | --- a/drivers/usb/serial/option.c | ||
924 | +++ b/drivers/usb/serial/option.c | ||
925 | @@ -158,6 +158,7 @@ static void option_instat_callback(struct urb *urb); | ||
926 | #define NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_HIGHSPEED 0x8001 | ||
927 | #define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED 0x9000 | ||
928 | #define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_HIGHSPEED 0x9001 | ||
929 | +#define NOVATELWIRELESS_PRODUCT_E362 0x9010 | ||
930 | #define NOVATELWIRELESS_PRODUCT_G1 0xA001 | ||
931 | #define NOVATELWIRELESS_PRODUCT_G1_M 0xA002 | ||
932 | #define NOVATELWIRELESS_PRODUCT_G2 0xA010 | ||
933 | @@ -193,6 +194,9 @@ static void option_instat_callback(struct urb *urb); | ||
934 | #define DELL_PRODUCT_5730_MINICARD_TELUS 0x8181 | ||
935 | #define DELL_PRODUCT_5730_MINICARD_VZW 0x8182 | ||
936 | |||
937 | +#define DELL_PRODUCT_5800_MINICARD_VZW 0x8195 /* Novatel E362 */ | ||
938 | +#define DELL_PRODUCT_5800_V2_MINICARD_VZW 0x8196 /* Novatel E362 */ | ||
939 | + | ||
940 | #define KYOCERA_VENDOR_ID 0x0c88 | ||
941 | #define KYOCERA_PRODUCT_KPC650 0x17da | ||
942 | #define KYOCERA_PRODUCT_KPC680 0x180a | ||
943 | @@ -283,6 +287,7 @@ static void option_instat_callback(struct urb *urb); | ||
944 | /* ALCATEL PRODUCTS */ | ||
945 | #define ALCATEL_VENDOR_ID 0x1bbb | ||
946 | #define ALCATEL_PRODUCT_X060S_X200 0x0000 | ||
947 | +#define ALCATEL_PRODUCT_X220_X500D 0x0017 | ||
948 | |||
949 | #define PIRELLI_VENDOR_ID 0x1266 | ||
950 | #define PIRELLI_PRODUCT_C100_1 0x1002 | ||
951 | @@ -706,6 +711,7 @@ static const struct usb_device_id option_ids[] = { | ||
952 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G2) }, | ||
953 | /* Novatel Ovation MC551 a.k.a. Verizon USB551L */ | ||
954 | { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC551, 0xff, 0xff, 0xff) }, | ||
955 | + { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_E362, 0xff, 0xff, 0xff) }, | ||
956 | |||
957 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) }, | ||
958 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) }, | ||
959 | @@ -728,6 +734,8 @@ static const struct usb_device_id option_ids[] = { | ||
960 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5730_MINICARD_SPRINT) }, /* Dell Wireless 5730 Mobile Broadband EVDO/HSPA Mini-Card */ | ||
961 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5730_MINICARD_TELUS) }, /* Dell Wireless 5730 Mobile Broadband EVDO/HSPA Mini-Card */ | ||
962 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5730_MINICARD_VZW) }, /* Dell Wireless 5730 Mobile Broadband EVDO/HSPA Mini-Card */ | ||
963 | + { USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, DELL_PRODUCT_5800_MINICARD_VZW, 0xff, 0xff, 0xff) }, | ||
964 | + { USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, DELL_PRODUCT_5800_V2_MINICARD_VZW, 0xff, 0xff, 0xff) }, | ||
965 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, /* ADU-E100, ADU-310 */ | ||
966 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) }, | ||
967 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_620UW) }, | ||
968 | @@ -1157,6 +1165,7 @@ static const struct usb_device_id option_ids[] = { | ||
969 | { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S_X200), | ||
970 | .driver_info = (kernel_ulong_t)&alcatel_x200_blacklist | ||
971 | }, | ||
972 | + { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X220_X500D) }, | ||
973 | { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) }, | ||
974 | { USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) }, | ||
975 | { USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14), | ||
976 | diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c | ||
977 | index 2f2d074..188b5b3 100644 | ||
978 | --- a/drivers/usb/serial/usb_wwan.c | ||
979 | +++ b/drivers/usb/serial/usb_wwan.c | ||
980 | @@ -455,9 +455,6 @@ static struct urb *usb_wwan_setup_urb(struct usb_serial_port *port, | ||
981 | struct usb_serial *serial = port->serial; | ||
982 | struct urb *urb; | ||
983 | |||
984 | - if (endpoint == -1) | ||
985 | - return NULL; /* endpoint not needed */ | ||
986 | - | ||
987 | urb = usb_alloc_urb(0, GFP_KERNEL); /* No ISO */ | ||
988 | if (urb == NULL) { | ||
989 | dbg("%s: alloc for endpoint %d failed.", __func__, endpoint); | ||
990 | @@ -487,6 +484,9 @@ int usb_wwan_port_probe(struct usb_serial_port *port) | ||
991 | init_usb_anchor(&portdata->delayed); | ||
992 | |||
993 | for (i = 0; i < N_IN_URB; i++) { | ||
994 | + if (!port->bulk_in_size) | ||
995 | + break; | ||
996 | + | ||
997 | buffer = (u8 *)__get_free_page(GFP_KERNEL); | ||
998 | if (!buffer) | ||
999 | goto bail_out_error; | ||
1000 | @@ -499,8 +499,8 @@ int usb_wwan_port_probe(struct usb_serial_port *port) | ||
1001 | portdata->in_urbs[i] = urb; | ||
1002 | } | ||
1003 | for (i = 0; i < N_OUT_URB; i++) { | ||
1004 | - if (port->bulk_out_endpointAddress == -1) | ||
1005 | - continue; | ||
1006 | + if (!port->bulk_out_size) | ||
1007 | + break; | ||
1008 | |||
1009 | buffer = kmalloc(OUT_BUFLEN, GFP_KERNEL); | ||
1010 | if (!buffer) | ||
1011 | diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c | ||
1012 | index c3b3f7f..abd47c7 100644 | ||
1013 | --- a/drivers/virtio/virtio.c | ||
1014 | +++ b/drivers/virtio/virtio.c | ||
1015 | @@ -225,8 +225,10 @@ EXPORT_SYMBOL_GPL(register_virtio_device); | ||
1016 | |||
1017 | void unregister_virtio_device(struct virtio_device *dev) | ||
1018 | { | ||
1019 | + int index = dev->index; /* save for after device release */ | ||
1020 | + | ||
1021 | device_unregister(&dev->dev); | ||
1022 | - ida_simple_remove(&virtio_index_ida, dev->index); | ||
1023 | + ida_simple_remove(&virtio_index_ida, index); | ||
1024 | } | ||
1025 | EXPORT_SYMBOL_GPL(unregister_virtio_device); | ||
1026 | |||
1027 | diff --git a/drivers/xen/events.c b/drivers/xen/events.c | ||
1028 | index 7595581..99c5345 100644 | ||
1029 | --- a/drivers/xen/events.c | ||
1030 | +++ b/drivers/xen/events.c | ||
1031 | @@ -1374,8 +1374,8 @@ void xen_evtchn_do_upcall(struct pt_regs *regs) | ||
1032 | { | ||
1033 | struct pt_regs *old_regs = set_irq_regs(regs); | ||
1034 | |||
1035 | - exit_idle(); | ||
1036 | irq_enter(); | ||
1037 | + exit_idle(); | ||
1038 | |||
1039 | __xen_evtchn_do_upcall(); | ||
1040 | |||
1041 | diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c | ||
1042 | index 05f4dc2..8d453b7 100644 | ||
1043 | --- a/fs/cifs/cifsacl.c | ||
1044 | +++ b/fs/cifs/cifsacl.c | ||
1045 | @@ -225,6 +225,13 @@ sid_to_str(struct cifs_sid *sidptr, char *sidstr) | ||
1046 | } | ||
1047 | |||
1048 | static void | ||
1049 | +cifs_copy_sid(struct cifs_sid *dst, const struct cifs_sid *src) | ||
1050 | +{ | ||
1051 | + memcpy(dst, src, sizeof(*dst)); | ||
1052 | + dst->num_subauth = min_t(u8, src->num_subauth, NUM_SUBAUTHS); | ||
1053 | +} | ||
1054 | + | ||
1055 | +static void | ||
1056 | id_rb_insert(struct rb_root *root, struct cifs_sid *sidptr, | ||
1057 | struct cifs_sid_id **psidid, char *typestr) | ||
1058 | { | ||
1059 | @@ -248,7 +255,7 @@ id_rb_insert(struct rb_root *root, struct cifs_sid *sidptr, | ||
1060 | } | ||
1061 | } | ||
1062 | |||
1063 | - memcpy(&(*psidid)->sid, sidptr, sizeof(struct cifs_sid)); | ||
1064 | + cifs_copy_sid(&(*psidid)->sid, sidptr); | ||
1065 | (*psidid)->time = jiffies - (SID_MAP_RETRY + 1); | ||
1066 | (*psidid)->refcount = 0; | ||
1067 | |||
1068 | @@ -354,7 +361,7 @@ id_to_sid(unsigned long cid, uint sidtype, struct cifs_sid *ssid) | ||
1069 | * any fields of the node after a reference is put . | ||
1070 | */ | ||
1071 | if (test_bit(SID_ID_MAPPED, &psidid->state)) { | ||
1072 | - memcpy(ssid, &psidid->sid, sizeof(struct cifs_sid)); | ||
1073 | + cifs_copy_sid(ssid, &psidid->sid); | ||
1074 | psidid->time = jiffies; /* update ts for accessing */ | ||
1075 | goto id_sid_out; | ||
1076 | } | ||
1077 | @@ -370,14 +377,14 @@ id_to_sid(unsigned long cid, uint sidtype, struct cifs_sid *ssid) | ||
1078 | if (IS_ERR(sidkey)) { | ||
1079 | rc = -EINVAL; | ||
1080 | cFYI(1, "%s: Can't map and id to a SID", __func__); | ||
1081 | + } else if (sidkey->datalen < sizeof(struct cifs_sid)) { | ||
1082 | + rc = -EIO; | ||
1083 | + cFYI(1, "%s: Downcall contained malformed key " | ||
1084 | + "(datalen=%hu)", __func__, sidkey->datalen); | ||
1085 | } else { | ||
1086 | lsid = (struct cifs_sid *)sidkey->payload.data; | ||
1087 | - memcpy(&psidid->sid, lsid, | ||
1088 | - sidkey->datalen < sizeof(struct cifs_sid) ? | ||
1089 | - sidkey->datalen : sizeof(struct cifs_sid)); | ||
1090 | - memcpy(ssid, &psidid->sid, | ||
1091 | - sidkey->datalen < sizeof(struct cifs_sid) ? | ||
1092 | - sidkey->datalen : sizeof(struct cifs_sid)); | ||
1093 | + cifs_copy_sid(&psidid->sid, lsid); | ||
1094 | + cifs_copy_sid(ssid, &psidid->sid); | ||
1095 | set_bit(SID_ID_MAPPED, &psidid->state); | ||
1096 | key_put(sidkey); | ||
1097 | kfree(psidid->sidstr); | ||
1098 | @@ -396,7 +403,7 @@ id_to_sid(unsigned long cid, uint sidtype, struct cifs_sid *ssid) | ||
1099 | return rc; | ||
1100 | } | ||
1101 | if (test_bit(SID_ID_MAPPED, &psidid->state)) | ||
1102 | - memcpy(ssid, &psidid->sid, sizeof(struct cifs_sid)); | ||
1103 | + cifs_copy_sid(ssid, &psidid->sid); | ||
1104 | else | ||
1105 | rc = -EINVAL; | ||
1106 | } | ||
1107 | @@ -675,8 +682,6 @@ int compare_sids(const struct cifs_sid *ctsid, const struct cifs_sid *cwsid) | ||
1108 | static void copy_sec_desc(const struct cifs_ntsd *pntsd, | ||
1109 | struct cifs_ntsd *pnntsd, __u32 sidsoffset) | ||
1110 | { | ||
1111 | - int i; | ||
1112 | - | ||
1113 | struct cifs_sid *owner_sid_ptr, *group_sid_ptr; | ||
1114 | struct cifs_sid *nowner_sid_ptr, *ngroup_sid_ptr; | ||
1115 | |||
1116 | @@ -692,26 +697,14 @@ static void copy_sec_desc(const struct cifs_ntsd *pntsd, | ||
1117 | owner_sid_ptr = (struct cifs_sid *)((char *)pntsd + | ||
1118 | le32_to_cpu(pntsd->osidoffset)); | ||
1119 | nowner_sid_ptr = (struct cifs_sid *)((char *)pnntsd + sidsoffset); | ||
1120 | - | ||
1121 | - nowner_sid_ptr->revision = owner_sid_ptr->revision; | ||
1122 | - nowner_sid_ptr->num_subauth = owner_sid_ptr->num_subauth; | ||
1123 | - for (i = 0; i < 6; i++) | ||
1124 | - nowner_sid_ptr->authority[i] = owner_sid_ptr->authority[i]; | ||
1125 | - for (i = 0; i < 5; i++) | ||
1126 | - nowner_sid_ptr->sub_auth[i] = owner_sid_ptr->sub_auth[i]; | ||
1127 | + cifs_copy_sid(nowner_sid_ptr, owner_sid_ptr); | ||
1128 | |||
1129 | /* copy group sid */ | ||
1130 | group_sid_ptr = (struct cifs_sid *)((char *)pntsd + | ||
1131 | le32_to_cpu(pntsd->gsidoffset)); | ||
1132 | ngroup_sid_ptr = (struct cifs_sid *)((char *)pnntsd + sidsoffset + | ||
1133 | sizeof(struct cifs_sid)); | ||
1134 | - | ||
1135 | - ngroup_sid_ptr->revision = group_sid_ptr->revision; | ||
1136 | - ngroup_sid_ptr->num_subauth = group_sid_ptr->num_subauth; | ||
1137 | - for (i = 0; i < 6; i++) | ||
1138 | - ngroup_sid_ptr->authority[i] = group_sid_ptr->authority[i]; | ||
1139 | - for (i = 0; i < 5; i++) | ||
1140 | - ngroup_sid_ptr->sub_auth[i] = group_sid_ptr->sub_auth[i]; | ||
1141 | + cifs_copy_sid(ngroup_sid_ptr, group_sid_ptr); | ||
1142 | |||
1143 | return; | ||
1144 | } | ||
1145 | @@ -1120,8 +1113,7 @@ static int build_sec_desc(struct cifs_ntsd *pntsd, struct cifs_ntsd *pnntsd, | ||
1146 | kfree(nowner_sid_ptr); | ||
1147 | return rc; | ||
1148 | } | ||
1149 | - memcpy(owner_sid_ptr, nowner_sid_ptr, | ||
1150 | - sizeof(struct cifs_sid)); | ||
1151 | + cifs_copy_sid(owner_sid_ptr, nowner_sid_ptr); | ||
1152 | kfree(nowner_sid_ptr); | ||
1153 | *aclflag = CIFS_ACL_OWNER; | ||
1154 | } | ||
1155 | @@ -1139,8 +1131,7 @@ static int build_sec_desc(struct cifs_ntsd *pntsd, struct cifs_ntsd *pnntsd, | ||
1156 | kfree(ngroup_sid_ptr); | ||
1157 | return rc; | ||
1158 | } | ||
1159 | - memcpy(group_sid_ptr, ngroup_sid_ptr, | ||
1160 | - sizeof(struct cifs_sid)); | ||
1161 | + cifs_copy_sid(group_sid_ptr, ngroup_sid_ptr); | ||
1162 | kfree(ngroup_sid_ptr); | ||
1163 | *aclflag = CIFS_ACL_GROUP; | ||
1164 | } | ||
1165 | diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c | ||
1166 | index 781025b..2b33b2c 100644 | ||
1167 | --- a/fs/cifs/dir.c | ||
1168 | +++ b/fs/cifs/dir.c | ||
1169 | @@ -392,7 +392,16 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry, | ||
1170 | * in network traffic in the other paths. | ||
1171 | */ | ||
1172 | if (!(oflags & O_CREAT)) { | ||
1173 | - struct dentry *res = cifs_lookup(inode, direntry, 0); | ||
1174 | + struct dentry *res; | ||
1175 | + | ||
1176 | + /* | ||
1177 | + * Check for hashed negative dentry. We have already revalidated | ||
1178 | + * the dentry and it is fine. No need to perform another lookup. | ||
1179 | + */ | ||
1180 | + if (!d_unhashed(direntry)) | ||
1181 | + return -ENOENT; | ||
1182 | + | ||
1183 | + res = cifs_lookup(inode, direntry, 0); | ||
1184 | if (IS_ERR(res)) | ||
1185 | return PTR_ERR(res); | ||
1186 | |||
1187 | diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h | ||
1188 | index 5c69f2b..b686b43 100644 | ||
1189 | --- a/fs/ext4/ext4.h | ||
1190 | +++ b/fs/ext4/ext4.h | ||
1191 | @@ -2046,8 +2046,7 @@ extern int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count); | ||
1192 | extern int ext4_calculate_overhead(struct super_block *sb); | ||
1193 | extern int ext4_superblock_csum_verify(struct super_block *sb, | ||
1194 | struct ext4_super_block *es); | ||
1195 | -extern void ext4_superblock_csum_set(struct super_block *sb, | ||
1196 | - struct ext4_super_block *es); | ||
1197 | +extern void ext4_superblock_csum_set(struct super_block *sb); | ||
1198 | extern void *ext4_kvmalloc(size_t size, gfp_t flags); | ||
1199 | extern void *ext4_kvzalloc(size_t size, gfp_t flags); | ||
1200 | extern void ext4_kvfree(void *ptr); | ||
1201 | diff --git a/fs/ext4/ext4_jbd2.c b/fs/ext4/ext4_jbd2.c | ||
1202 | index bfa65b4..b4323ba 100644 | ||
1203 | --- a/fs/ext4/ext4_jbd2.c | ||
1204 | +++ b/fs/ext4/ext4_jbd2.c | ||
1205 | @@ -143,17 +143,13 @@ int __ext4_handle_dirty_super(const char *where, unsigned int line, | ||
1206 | struct buffer_head *bh = EXT4_SB(sb)->s_sbh; | ||
1207 | int err = 0; | ||
1208 | |||
1209 | + ext4_superblock_csum_set(sb); | ||
1210 | if (ext4_handle_valid(handle)) { | ||
1211 | - ext4_superblock_csum_set(sb, | ||
1212 | - (struct ext4_super_block *)bh->b_data); | ||
1213 | err = jbd2_journal_dirty_metadata(handle, bh); | ||
1214 | if (err) | ||
1215 | ext4_journal_abort_handle(where, line, __func__, | ||
1216 | bh, handle, err); | ||
1217 | - } else { | ||
1218 | - ext4_superblock_csum_set(sb, | ||
1219 | - (struct ext4_super_block *)bh->b_data); | ||
1220 | + } else | ||
1221 | mark_buffer_dirty(bh); | ||
1222 | - } | ||
1223 | return err; | ||
1224 | } | ||
1225 | diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c | ||
1226 | index 71241bc..101b41c 100644 | ||
1227 | --- a/fs/ext4/resize.c | ||
1228 | +++ b/fs/ext4/resize.c | ||
1229 | @@ -979,7 +979,7 @@ static void update_backups(struct super_block *sb, | ||
1230 | goto exit_err; | ||
1231 | } | ||
1232 | |||
1233 | - ext4_superblock_csum_set(sb, (struct ext4_super_block *)data); | ||
1234 | + ext4_superblock_csum_set(sb); | ||
1235 | |||
1236 | while ((group = ext4_list_backups(sb, &three, &five, &seven)) < last) { | ||
1237 | struct buffer_head *bh; | ||
1238 | diff --git a/fs/ext4/super.c b/fs/ext4/super.c | ||
1239 | index e44b233..2b5fb60 100644 | ||
1240 | --- a/fs/ext4/super.c | ||
1241 | +++ b/fs/ext4/super.c | ||
1242 | @@ -143,9 +143,10 @@ int ext4_superblock_csum_verify(struct super_block *sb, | ||
1243 | return es->s_checksum == ext4_superblock_csum(sb, es); | ||
1244 | } | ||
1245 | |||
1246 | -void ext4_superblock_csum_set(struct super_block *sb, | ||
1247 | - struct ext4_super_block *es) | ||
1248 | +void ext4_superblock_csum_set(struct super_block *sb) | ||
1249 | { | ||
1250 | + struct ext4_super_block *es = EXT4_SB(sb)->s_es; | ||
1251 | + | ||
1252 | if (!EXT4_HAS_RO_COMPAT_FEATURE(sb, | ||
1253 | EXT4_FEATURE_RO_COMPAT_METADATA_CSUM)) | ||
1254 | return; | ||
1255 | @@ -4343,7 +4344,7 @@ static int ext4_commit_super(struct super_block *sb, int sync) | ||
1256 | cpu_to_le32(percpu_counter_sum_positive( | ||
1257 | &EXT4_SB(sb)->s_freeinodes_counter)); | ||
1258 | BUFFER_TRACE(sbh, "marking dirty"); | ||
1259 | - ext4_superblock_csum_set(sb, es); | ||
1260 | + ext4_superblock_csum_set(sb); | ||
1261 | mark_buffer_dirty(sbh); | ||
1262 | if (sync) { | ||
1263 | error = sync_dirty_buffer(sbh); | ||
1264 | diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c | ||
1265 | index 382000f..07cc71f 100644 | ||
1266 | --- a/fs/gfs2/file.c | ||
1267 | +++ b/fs/gfs2/file.c | ||
1268 | @@ -515,15 +515,13 @@ static int gfs2_mmap(struct file *file, struct vm_area_struct *vma) | ||
1269 | struct gfs2_holder i_gh; | ||
1270 | int error; | ||
1271 | |||
1272 | - gfs2_holder_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, &i_gh); | ||
1273 | - error = gfs2_glock_nq(&i_gh); | ||
1274 | - if (error == 0) { | ||
1275 | - file_accessed(file); | ||
1276 | - gfs2_glock_dq(&i_gh); | ||
1277 | - } | ||
1278 | - gfs2_holder_uninit(&i_gh); | ||
1279 | + error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, | ||
1280 | + &i_gh); | ||
1281 | if (error) | ||
1282 | return error; | ||
1283 | + /* grab lock to update inode */ | ||
1284 | + gfs2_glock_dq_uninit(&i_gh); | ||
1285 | + file_accessed(file); | ||
1286 | } | ||
1287 | vma->vm_ops = &gfs2_vm_ops; | ||
1288 | vma->vm_flags |= VM_CAN_NONLINEAR; | ||
1289 | diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c | ||
1290 | index fc3168f..12ff463 100644 | ||
1291 | --- a/fs/gfs2/super.c | ||
1292 | +++ b/fs/gfs2/super.c | ||
1293 | @@ -810,7 +810,8 @@ static void gfs2_dirty_inode(struct inode *inode, int flags) | ||
1294 | return; | ||
1295 | } | ||
1296 | need_unlock = 1; | ||
1297 | - } | ||
1298 | + } else if (WARN_ON_ONCE(ip->i_gl->gl_state != LM_ST_EXCLUSIVE)) | ||
1299 | + return; | ||
1300 | |||
1301 | if (current->journal_info == NULL) { | ||
1302 | ret = gfs2_trans_begin(sdp, RES_DINODE, 0); | ||
1303 | diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c | ||
1304 | index f35794b..a506360 100644 | ||
1305 | --- a/fs/notify/fanotify/fanotify.c | ||
1306 | +++ b/fs/notify/fanotify/fanotify.c | ||
1307 | @@ -21,6 +21,7 @@ static bool should_merge(struct fsnotify_event *old, struct fsnotify_event *new) | ||
1308 | if ((old->path.mnt == new->path.mnt) && | ||
1309 | (old->path.dentry == new->path.dentry)) | ||
1310 | return true; | ||
1311 | + break; | ||
1312 | case (FSNOTIFY_EVENT_NONE): | ||
1313 | return true; | ||
1314 | default: | ||
1315 | diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c | ||
1316 | index 29996e8..2d1e0f3 100644 | ||
1317 | --- a/fs/pstore/platform.c | ||
1318 | +++ b/fs/pstore/platform.c | ||
1319 | @@ -161,12 +161,13 @@ static void pstore_console_write(struct console *con, const char *s, unsigned c) | ||
1320 | |||
1321 | while (s < e) { | ||
1322 | unsigned long flags; | ||
1323 | + u64 id; | ||
1324 | |||
1325 | if (c > psinfo->bufsize) | ||
1326 | c = psinfo->bufsize; | ||
1327 | spin_lock_irqsave(&psinfo->buf_lock, flags); | ||
1328 | memcpy(psinfo->buf, s, c); | ||
1329 | - psinfo->write(PSTORE_TYPE_CONSOLE, 0, NULL, 0, c, psinfo); | ||
1330 | + psinfo->write(PSTORE_TYPE_CONSOLE, 0, &id, 0, c, psinfo); | ||
1331 | spin_unlock_irqrestore(&psinfo->buf_lock, flags); | ||
1332 | s += c; | ||
1333 | c = e - s; | ||
1334 | diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c | ||
1335 | index 63ce6be..567c10c 100644 | ||
1336 | --- a/fs/reiserfs/inode.c | ||
1337 | +++ b/fs/reiserfs/inode.c | ||
1338 | @@ -1782,8 +1782,9 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th, | ||
1339 | |||
1340 | BUG_ON(!th->t_trans_id); | ||
1341 | |||
1342 | - dquot_initialize(inode); | ||
1343 | + reiserfs_write_unlock(inode->i_sb); | ||
1344 | err = dquot_alloc_inode(inode); | ||
1345 | + reiserfs_write_lock(inode->i_sb); | ||
1346 | if (err) | ||
1347 | goto out_end_trans; | ||
1348 | if (!dir->i_nlink) { | ||
1349 | @@ -1979,8 +1980,10 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th, | ||
1350 | |||
1351 | out_end_trans: | ||
1352 | journal_end(th, th->t_super, th->t_blocks_allocated); | ||
1353 | + reiserfs_write_unlock(inode->i_sb); | ||
1354 | /* Drop can be outside and it needs more credits so it's better to have it outside */ | ||
1355 | dquot_drop(inode); | ||
1356 | + reiserfs_write_lock(inode->i_sb); | ||
1357 | inode->i_flags |= S_NOQUOTA; | ||
1358 | make_bad_inode(inode); | ||
1359 | |||
1360 | @@ -3103,10 +3106,9 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr) | ||
1361 | /* must be turned off for recursive notify_change calls */ | ||
1362 | ia_valid = attr->ia_valid &= ~(ATTR_KILL_SUID|ATTR_KILL_SGID); | ||
1363 | |||
1364 | - depth = reiserfs_write_lock_once(inode->i_sb); | ||
1365 | if (is_quota_modification(inode, attr)) | ||
1366 | dquot_initialize(inode); | ||
1367 | - | ||
1368 | + depth = reiserfs_write_lock_once(inode->i_sb); | ||
1369 | if (attr->ia_valid & ATTR_SIZE) { | ||
1370 | /* version 2 items will be caught by the s_maxbytes check | ||
1371 | ** done for us in vmtruncate | ||
1372 | @@ -3170,7 +3172,9 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr) | ||
1373 | error = journal_begin(&th, inode->i_sb, jbegin_count); | ||
1374 | if (error) | ||
1375 | goto out; | ||
1376 | + reiserfs_write_unlock_once(inode->i_sb, depth); | ||
1377 | error = dquot_transfer(inode, attr); | ||
1378 | + depth = reiserfs_write_lock_once(inode->i_sb); | ||
1379 | if (error) { | ||
1380 | journal_end(&th, inode->i_sb, jbegin_count); | ||
1381 | goto out; | ||
1382 | diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c | ||
1383 | index f8afa4b..2f40a4c 100644 | ||
1384 | --- a/fs/reiserfs/stree.c | ||
1385 | +++ b/fs/reiserfs/stree.c | ||
1386 | @@ -1968,7 +1968,9 @@ int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th, struct tree | ||
1387 | key2type(&(key->on_disk_key))); | ||
1388 | #endif | ||
1389 | |||
1390 | + reiserfs_write_unlock(inode->i_sb); | ||
1391 | retval = dquot_alloc_space_nodirty(inode, pasted_size); | ||
1392 | + reiserfs_write_lock(inode->i_sb); | ||
1393 | if (retval) { | ||
1394 | pathrelse(search_path); | ||
1395 | return retval; | ||
1396 | @@ -2061,9 +2063,11 @@ int reiserfs_insert_item(struct reiserfs_transaction_handle *th, | ||
1397 | "reiserquota insert_item(): allocating %u id=%u type=%c", | ||
1398 | quota_bytes, inode->i_uid, head2type(ih)); | ||
1399 | #endif | ||
1400 | + reiserfs_write_unlock(inode->i_sb); | ||
1401 | /* We can't dirty inode here. It would be immediately written but | ||
1402 | * appropriate stat item isn't inserted yet... */ | ||
1403 | retval = dquot_alloc_space_nodirty(inode, quota_bytes); | ||
1404 | + reiserfs_write_lock(inode->i_sb); | ||
1405 | if (retval) { | ||
1406 | pathrelse(path); | ||
1407 | return retval; | ||
1408 | diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c | ||
1409 | index 7a37dab..4300030 100644 | ||
1410 | --- a/fs/reiserfs/super.c | ||
1411 | +++ b/fs/reiserfs/super.c | ||
1412 | @@ -298,7 +298,9 @@ static int finish_unfinished(struct super_block *s) | ||
1413 | retval = remove_save_link_only(s, &save_link_key, 0); | ||
1414 | continue; | ||
1415 | } | ||
1416 | + reiserfs_write_unlock(s); | ||
1417 | dquot_initialize(inode); | ||
1418 | + reiserfs_write_lock(s); | ||
1419 | |||
1420 | if (truncate && S_ISDIR(inode->i_mode)) { | ||
1421 | /* We got a truncate request for a dir which is impossible. | ||
1422 | @@ -1330,7 +1332,7 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg) | ||
1423 | kfree(qf_names[i]); | ||
1424 | #endif | ||
1425 | err = -EINVAL; | ||
1426 | - goto out_err; | ||
1427 | + goto out_unlock; | ||
1428 | } | ||
1429 | #ifdef CONFIG_QUOTA | ||
1430 | handle_quota_files(s, qf_names, &qfmt); | ||
1431 | @@ -1374,7 +1376,7 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg) | ||
1432 | if (blocks) { | ||
1433 | err = reiserfs_resize(s, blocks); | ||
1434 | if (err != 0) | ||
1435 | - goto out_err; | ||
1436 | + goto out_unlock; | ||
1437 | } | ||
1438 | |||
1439 | if (*mount_flags & MS_RDONLY) { | ||
1440 | @@ -1384,9 +1386,15 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg) | ||
1441 | /* it is read-only already */ | ||
1442 | goto out_ok; | ||
1443 | |||
1444 | + /* | ||
1445 | + * Drop write lock. Quota will retake it when needed and lock | ||
1446 | + * ordering requires calling dquot_suspend() without it. | ||
1447 | + */ | ||
1448 | + reiserfs_write_unlock(s); | ||
1449 | err = dquot_suspend(s, -1); | ||
1450 | if (err < 0) | ||
1451 | goto out_err; | ||
1452 | + reiserfs_write_lock(s); | ||
1453 | |||
1454 | /* try to remount file system with read-only permissions */ | ||
1455 | if (sb_umount_state(rs) == REISERFS_VALID_FS | ||
1456 | @@ -1396,7 +1404,7 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg) | ||
1457 | |||
1458 | err = journal_begin(&th, s, 10); | ||
1459 | if (err) | ||
1460 | - goto out_err; | ||
1461 | + goto out_unlock; | ||
1462 | |||
1463 | /* Mounting a rw partition read-only. */ | ||
1464 | reiserfs_prepare_for_journal(s, SB_BUFFER_WITH_SB(s), 1); | ||
1465 | @@ -1411,7 +1419,7 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg) | ||
1466 | |||
1467 | if (reiserfs_is_journal_aborted(journal)) { | ||
1468 | err = journal->j_errno; | ||
1469 | - goto out_err; | ||
1470 | + goto out_unlock; | ||
1471 | } | ||
1472 | |||
1473 | handle_data_mode(s, mount_options); | ||
1474 | @@ -1420,7 +1428,7 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg) | ||
1475 | s->s_flags &= ~MS_RDONLY; /* now it is safe to call journal_begin */ | ||
1476 | err = journal_begin(&th, s, 10); | ||
1477 | if (err) | ||
1478 | - goto out_err; | ||
1479 | + goto out_unlock; | ||
1480 | |||
1481 | /* Mount a partition which is read-only, read-write */ | ||
1482 | reiserfs_prepare_for_journal(s, SB_BUFFER_WITH_SB(s), 1); | ||
1483 | @@ -1437,10 +1445,16 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg) | ||
1484 | SB_JOURNAL(s)->j_must_wait = 1; | ||
1485 | err = journal_end(&th, s, 10); | ||
1486 | if (err) | ||
1487 | - goto out_err; | ||
1488 | + goto out_unlock; | ||
1489 | |||
1490 | if (!(*mount_flags & MS_RDONLY)) { | ||
1491 | + /* | ||
1492 | + * Drop write lock. Quota will retake it when needed and lock | ||
1493 | + * ordering requires calling dquot_resume() without it. | ||
1494 | + */ | ||
1495 | + reiserfs_write_unlock(s); | ||
1496 | dquot_resume(s, -1); | ||
1497 | + reiserfs_write_lock(s); | ||
1498 | finish_unfinished(s); | ||
1499 | reiserfs_xattr_init(s, *mount_flags); | ||
1500 | } | ||
1501 | @@ -1450,9 +1464,10 @@ out_ok: | ||
1502 | reiserfs_write_unlock(s); | ||
1503 | return 0; | ||
1504 | |||
1505 | +out_unlock: | ||
1506 | + reiserfs_write_unlock(s); | ||
1507 | out_err: | ||
1508 | kfree(new_opts); | ||
1509 | - reiserfs_write_unlock(s); | ||
1510 | return err; | ||
1511 | } | ||
1512 | |||
1513 | @@ -2090,13 +2105,15 @@ static int reiserfs_write_dquot(struct dquot *dquot) | ||
1514 | REISERFS_QUOTA_TRANS_BLOCKS(dquot->dq_sb)); | ||
1515 | if (ret) | ||
1516 | goto out; | ||
1517 | + reiserfs_write_unlock(dquot->dq_sb); | ||
1518 | ret = dquot_commit(dquot); | ||
1519 | + reiserfs_write_lock(dquot->dq_sb); | ||
1520 | err = | ||
1521 | journal_end(&th, dquot->dq_sb, | ||
1522 | REISERFS_QUOTA_TRANS_BLOCKS(dquot->dq_sb)); | ||
1523 | if (!ret && err) | ||
1524 | ret = err; | ||
1525 | - out: | ||
1526 | +out: | ||
1527 | reiserfs_write_unlock(dquot->dq_sb); | ||
1528 | return ret; | ||
1529 | } | ||
1530 | @@ -2112,13 +2129,15 @@ static int reiserfs_acquire_dquot(struct dquot *dquot) | ||
1531 | REISERFS_QUOTA_INIT_BLOCKS(dquot->dq_sb)); | ||
1532 | if (ret) | ||
1533 | goto out; | ||
1534 | + reiserfs_write_unlock(dquot->dq_sb); | ||
1535 | ret = dquot_acquire(dquot); | ||
1536 | + reiserfs_write_lock(dquot->dq_sb); | ||
1537 | err = | ||
1538 | journal_end(&th, dquot->dq_sb, | ||
1539 | REISERFS_QUOTA_INIT_BLOCKS(dquot->dq_sb)); | ||
1540 | if (!ret && err) | ||
1541 | ret = err; | ||
1542 | - out: | ||
1543 | +out: | ||
1544 | reiserfs_write_unlock(dquot->dq_sb); | ||
1545 | return ret; | ||
1546 | } | ||
1547 | @@ -2132,19 +2151,21 @@ static int reiserfs_release_dquot(struct dquot *dquot) | ||
1548 | ret = | ||
1549 | journal_begin(&th, dquot->dq_sb, | ||
1550 | REISERFS_QUOTA_DEL_BLOCKS(dquot->dq_sb)); | ||
1551 | + reiserfs_write_unlock(dquot->dq_sb); | ||
1552 | if (ret) { | ||
1553 | /* Release dquot anyway to avoid endless cycle in dqput() */ | ||
1554 | dquot_release(dquot); | ||
1555 | goto out; | ||
1556 | } | ||
1557 | ret = dquot_release(dquot); | ||
1558 | + reiserfs_write_lock(dquot->dq_sb); | ||
1559 | err = | ||
1560 | journal_end(&th, dquot->dq_sb, | ||
1561 | REISERFS_QUOTA_DEL_BLOCKS(dquot->dq_sb)); | ||
1562 | if (!ret && err) | ||
1563 | ret = err; | ||
1564 | - out: | ||
1565 | reiserfs_write_unlock(dquot->dq_sb); | ||
1566 | +out: | ||
1567 | return ret; | ||
1568 | } | ||
1569 | |||
1570 | @@ -2169,11 +2190,13 @@ static int reiserfs_write_info(struct super_block *sb, int type) | ||
1571 | ret = journal_begin(&th, sb, 2); | ||
1572 | if (ret) | ||
1573 | goto out; | ||
1574 | + reiserfs_write_unlock(sb); | ||
1575 | ret = dquot_commit_info(sb, type); | ||
1576 | + reiserfs_write_lock(sb); | ||
1577 | err = journal_end(&th, sb, 2); | ||
1578 | if (!ret && err) | ||
1579 | ret = err; | ||
1580 | - out: | ||
1581 | +out: | ||
1582 | reiserfs_write_unlock(sb); | ||
1583 | return ret; | ||
1584 | } | ||
1585 | @@ -2198,8 +2221,11 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id, | ||
1586 | struct reiserfs_transaction_handle th; | ||
1587 | int opt = type == USRQUOTA ? REISERFS_USRQUOTA : REISERFS_GRPQUOTA; | ||
1588 | |||
1589 | - if (!(REISERFS_SB(sb)->s_mount_opt & (1 << opt))) | ||
1590 | - return -EINVAL; | ||
1591 | + reiserfs_write_lock(sb); | ||
1592 | + if (!(REISERFS_SB(sb)->s_mount_opt & (1 << opt))) { | ||
1593 | + err = -EINVAL; | ||
1594 | + goto out; | ||
1595 | + } | ||
1596 | |||
1597 | /* Quotafile not on the same filesystem? */ | ||
1598 | if (path->dentry->d_sb != sb) { | ||
1599 | @@ -2241,8 +2267,10 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id, | ||
1600 | if (err) | ||
1601 | goto out; | ||
1602 | } | ||
1603 | - err = dquot_quota_on(sb, type, format_id, path); | ||
1604 | + reiserfs_write_unlock(sb); | ||
1605 | + return dquot_quota_on(sb, type, format_id, path); | ||
1606 | out: | ||
1607 | + reiserfs_write_unlock(sb); | ||
1608 | return err; | ||
1609 | } | ||
1610 | |||
1611 | @@ -2315,7 +2343,9 @@ static ssize_t reiserfs_quota_write(struct super_block *sb, int type, | ||
1612 | tocopy = sb->s_blocksize - offset < towrite ? | ||
1613 | sb->s_blocksize - offset : towrite; | ||
1614 | tmp_bh.b_state = 0; | ||
1615 | + reiserfs_write_lock(sb); | ||
1616 | err = reiserfs_get_block(inode, blk, &tmp_bh, GET_BLOCK_CREATE); | ||
1617 | + reiserfs_write_unlock(sb); | ||
1618 | if (err) | ||
1619 | goto out; | ||
1620 | if (offset || tocopy != sb->s_blocksize) | ||
1621 | @@ -2331,10 +2361,12 @@ static ssize_t reiserfs_quota_write(struct super_block *sb, int type, | ||
1622 | flush_dcache_page(bh->b_page); | ||
1623 | set_buffer_uptodate(bh); | ||
1624 | unlock_buffer(bh); | ||
1625 | + reiserfs_write_lock(sb); | ||
1626 | reiserfs_prepare_for_journal(sb, bh, 1); | ||
1627 | journal_mark_dirty(current->journal_info, sb, bh); | ||
1628 | if (!journal_quota) | ||
1629 | reiserfs_add_ordered_list(inode, bh); | ||
1630 | + reiserfs_write_unlock(sb); | ||
1631 | brelse(bh); | ||
1632 | offset = 0; | ||
1633 | towrite -= tocopy; | ||
1634 | diff --git a/fs/ubifs/find.c b/fs/ubifs/find.c | ||
1635 | index 28ec13a..2dcf3d4 100644 | ||
1636 | --- a/fs/ubifs/find.c | ||
1637 | +++ b/fs/ubifs/find.c | ||
1638 | @@ -681,8 +681,16 @@ int ubifs_find_free_leb_for_idx(struct ubifs_info *c) | ||
1639 | if (!lprops) { | ||
1640 | lprops = ubifs_fast_find_freeable(c); | ||
1641 | if (!lprops) { | ||
1642 | - ubifs_assert(c->freeable_cnt == 0); | ||
1643 | - if (c->lst.empty_lebs - c->lst.taken_empty_lebs > 0) { | ||
1644 | + /* | ||
1645 | + * The first condition means the following: go scan the | ||
1646 | + * LPT if there are uncategorized lprops, which means | ||
1647 | + * there may be freeable LEBs there (UBIFS does not | ||
1648 | + * store the information about freeable LEBs in the | ||
1649 | + * master node). | ||
1650 | + */ | ||
1651 | + if (c->in_a_category_cnt != c->main_lebs || | ||
1652 | + c->lst.empty_lebs - c->lst.taken_empty_lebs > 0) { | ||
1653 | + ubifs_assert(c->freeable_cnt == 0); | ||
1654 | lprops = scan_for_leb_for_idx(c); | ||
1655 | if (IS_ERR(lprops)) { | ||
1656 | err = PTR_ERR(lprops); | ||
1657 | diff --git a/fs/ubifs/lprops.c b/fs/ubifs/lprops.c | ||
1658 | index 86eb8e5..b33ec7a 100644 | ||
1659 | --- a/fs/ubifs/lprops.c | ||
1660 | +++ b/fs/ubifs/lprops.c | ||
1661 | @@ -300,8 +300,11 @@ void ubifs_add_to_cat(struct ubifs_info *c, struct ubifs_lprops *lprops, | ||
1662 | default: | ||
1663 | ubifs_assert(0); | ||
1664 | } | ||
1665 | + | ||
1666 | lprops->flags &= ~LPROPS_CAT_MASK; | ||
1667 | lprops->flags |= cat; | ||
1668 | + c->in_a_category_cnt += 1; | ||
1669 | + ubifs_assert(c->in_a_category_cnt <= c->main_lebs); | ||
1670 | } | ||
1671 | |||
1672 | /** | ||
1673 | @@ -334,6 +337,9 @@ static void ubifs_remove_from_cat(struct ubifs_info *c, | ||
1674 | default: | ||
1675 | ubifs_assert(0); | ||
1676 | } | ||
1677 | + | ||
1678 | + c->in_a_category_cnt -= 1; | ||
1679 | + ubifs_assert(c->in_a_category_cnt >= 0); | ||
1680 | } | ||
1681 | |||
1682 | /** | ||
1683 | diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h | ||
1684 | index 1e5a086..51ac3e6 100644 | ||
1685 | --- a/fs/ubifs/ubifs.h | ||
1686 | +++ b/fs/ubifs/ubifs.h | ||
1687 | @@ -1184,6 +1184,8 @@ struct ubifs_debug_info; | ||
1688 | * @freeable_list: list of freeable non-index LEBs (free + dirty == @leb_size) | ||
1689 | * @frdi_idx_list: list of freeable index LEBs (free + dirty == @leb_size) | ||
1690 | * @freeable_cnt: number of freeable LEBs in @freeable_list | ||
1691 | + * @in_a_category_cnt: count of lprops which are in a certain category, which | ||
1692 | + * basically meants that they were loaded from the flash | ||
1693 | * | ||
1694 | * @ltab_lnum: LEB number of LPT's own lprops table | ||
1695 | * @ltab_offs: offset of LPT's own lprops table | ||
1696 | @@ -1413,6 +1415,7 @@ struct ubifs_info { | ||
1697 | struct list_head freeable_list; | ||
1698 | struct list_head frdi_idx_list; | ||
1699 | int freeable_cnt; | ||
1700 | + int in_a_category_cnt; | ||
1701 | |||
1702 | int ltab_lnum; | ||
1703 | int ltab_offs; | ||
1704 | diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c | ||
1705 | index 933b793..4b0b8dd 100644 | ||
1706 | --- a/fs/xfs/xfs_buf.c | ||
1707 | +++ b/fs/xfs/xfs_buf.c | ||
1708 | @@ -1197,9 +1197,14 @@ xfs_buf_bio_end_io( | ||
1709 | { | ||
1710 | xfs_buf_t *bp = (xfs_buf_t *)bio->bi_private; | ||
1711 | |||
1712 | - xfs_buf_ioerror(bp, -error); | ||
1713 | + /* | ||
1714 | + * don't overwrite existing errors - otherwise we can lose errors on | ||
1715 | + * buffers that require multiple bios to complete. | ||
1716 | + */ | ||
1717 | + if (!bp->b_error) | ||
1718 | + xfs_buf_ioerror(bp, -error); | ||
1719 | |||
1720 | - if (!error && xfs_buf_is_vmapped(bp) && (bp->b_flags & XBF_READ)) | ||
1721 | + if (!bp->b_error && xfs_buf_is_vmapped(bp) && (bp->b_flags & XBF_READ)) | ||
1722 | invalidate_kernel_vmap_range(bp->b_addr, xfs_buf_vmap_len(bp)); | ||
1723 | |||
1724 | _xfs_buf_ioend(bp, 1); | ||
1725 | @@ -1279,6 +1284,11 @@ next_chunk: | ||
1726 | if (size) | ||
1727 | goto next_chunk; | ||
1728 | } else { | ||
1729 | + /* | ||
1730 | + * This is guaranteed not to be the last io reference count | ||
1731 | + * because the caller (xfs_buf_iorequest) holds a count itself. | ||
1732 | + */ | ||
1733 | + atomic_dec(&bp->b_io_remaining); | ||
1734 | xfs_buf_ioerror(bp, EIO); | ||
1735 | bio_put(bio); | ||
1736 | } | ||
1737 | diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h | ||
1738 | index 2daa54f..a16d929 100644 | ||
1739 | --- a/include/linux/mmzone.h | ||
1740 | +++ b/include/linux/mmzone.h | ||
1741 | @@ -744,7 +744,7 @@ extern int init_currently_empty_zone(struct zone *zone, unsigned long start_pfn, | ||
1742 | unsigned long size, | ||
1743 | enum memmap_context context); | ||
1744 | |||
1745 | -extern void lruvec_init(struct lruvec *lruvec, struct zone *zone); | ||
1746 | +extern void lruvec_init(struct lruvec *lruvec); | ||
1747 | |||
1748 | static inline struct zone *lruvec_zone(struct lruvec *lruvec) | ||
1749 | { | ||
1750 | diff --git a/include/linux/ptp_clock_kernel.h b/include/linux/ptp_clock_kernel.h | ||
1751 | index 945704c..00b9e61 100644 | ||
1752 | --- a/include/linux/ptp_clock_kernel.h | ||
1753 | +++ b/include/linux/ptp_clock_kernel.h | ||
1754 | @@ -50,7 +50,8 @@ struct ptp_clock_request { | ||
1755 | * clock operations | ||
1756 | * | ||
1757 | * @adjfreq: Adjusts the frequency of the hardware clock. | ||
1758 | - * parameter delta: Desired period change in parts per billion. | ||
1759 | + * parameter delta: Desired frequency offset from nominal frequency | ||
1760 | + * in parts per billion | ||
1761 | * | ||
1762 | * @adjtime: Shifts the time of the hardware clock. | ||
1763 | * parameter delta: Desired change in nanoseconds. | ||
1764 | diff --git a/kernel/module.c b/kernel/module.c | ||
1765 | index 9ad9ee9..2a15c59 100644 | ||
1766 | --- a/kernel/module.c | ||
1767 | +++ b/kernel/module.c | ||
1768 | @@ -2273,12 +2273,17 @@ static void layout_symtab(struct module *mod, struct load_info *info) | ||
1769 | src = (void *)info->hdr + symsect->sh_offset; | ||
1770 | nsrc = symsect->sh_size / sizeof(*src); | ||
1771 | |||
1772 | + /* strtab always starts with a nul, so offset 0 is the empty string. */ | ||
1773 | + strtab_size = 1; | ||
1774 | + | ||
1775 | /* Compute total space required for the core symbols' strtab. */ | ||
1776 | - for (ndst = i = strtab_size = 1; i < nsrc; ++i, ++src) | ||
1777 | - if (is_core_symbol(src, info->sechdrs, info->hdr->e_shnum)) { | ||
1778 | - strtab_size += strlen(&info->strtab[src->st_name]) + 1; | ||
1779 | + for (ndst = i = 0; i < nsrc; i++) { | ||
1780 | + if (i == 0 || | ||
1781 | + is_core_symbol(src+i, info->sechdrs, info->hdr->e_shnum)) { | ||
1782 | + strtab_size += strlen(&info->strtab[src[i].st_name])+1; | ||
1783 | ndst++; | ||
1784 | } | ||
1785 | + } | ||
1786 | |||
1787 | /* Append room for core symbols at end of core part. */ | ||
1788 | info->symoffs = ALIGN(mod->core_size, symsect->sh_addralign ?: 1); | ||
1789 | @@ -2312,15 +2317,15 @@ static void add_kallsyms(struct module *mod, const struct load_info *info) | ||
1790 | mod->core_symtab = dst = mod->module_core + info->symoffs; | ||
1791 | mod->core_strtab = s = mod->module_core + info->stroffs; | ||
1792 | src = mod->symtab; | ||
1793 | - *dst = *src; | ||
1794 | *s++ = 0; | ||
1795 | - for (ndst = i = 1; i < mod->num_symtab; ++i, ++src) { | ||
1796 | - if (!is_core_symbol(src, info->sechdrs, info->hdr->e_shnum)) | ||
1797 | - continue; | ||
1798 | - | ||
1799 | - dst[ndst] = *src; | ||
1800 | - dst[ndst++].st_name = s - mod->core_strtab; | ||
1801 | - s += strlcpy(s, &mod->strtab[src->st_name], KSYM_NAME_LEN) + 1; | ||
1802 | + for (ndst = i = 0; i < mod->num_symtab; i++) { | ||
1803 | + if (i == 0 || | ||
1804 | + is_core_symbol(src+i, info->sechdrs, info->hdr->e_shnum)) { | ||
1805 | + dst[ndst] = src[i]; | ||
1806 | + dst[ndst++].st_name = s - mod->core_strtab; | ||
1807 | + s += strlcpy(s, &mod->strtab[src[i].st_name], | ||
1808 | + KSYM_NAME_LEN) + 1; | ||
1809 | + } | ||
1810 | } | ||
1811 | mod->core_num_syms = ndst; | ||
1812 | } | ||
1813 | diff --git a/mm/memcontrol.c b/mm/memcontrol.c | ||
1814 | index 795e525..a6e2f81 100644 | ||
1815 | --- a/mm/memcontrol.c | ||
1816 | +++ b/mm/memcontrol.c | ||
1817 | @@ -1061,12 +1061,24 @@ struct lruvec *mem_cgroup_zone_lruvec(struct zone *zone, | ||
1818 | struct mem_cgroup *memcg) | ||
1819 | { | ||
1820 | struct mem_cgroup_per_zone *mz; | ||
1821 | + struct lruvec *lruvec; | ||
1822 | |||
1823 | - if (mem_cgroup_disabled()) | ||
1824 | - return &zone->lruvec; | ||
1825 | + if (mem_cgroup_disabled()) { | ||
1826 | + lruvec = &zone->lruvec; | ||
1827 | + goto out; | ||
1828 | + } | ||
1829 | |||
1830 | mz = mem_cgroup_zoneinfo(memcg, zone_to_nid(zone), zone_idx(zone)); | ||
1831 | - return &mz->lruvec; | ||
1832 | + lruvec = &mz->lruvec; | ||
1833 | +out: | ||
1834 | + /* | ||
1835 | + * Since a node can be onlined after the mem_cgroup was created, | ||
1836 | + * we have to be prepared to initialize lruvec->zone here; | ||
1837 | + * and if offlined then reonlined, we need to reinitialize it. | ||
1838 | + */ | ||
1839 | + if (unlikely(lruvec->zone != zone)) | ||
1840 | + lruvec->zone = zone; | ||
1841 | + return lruvec; | ||
1842 | } | ||
1843 | |||
1844 | /* | ||
1845 | @@ -1093,9 +1105,12 @@ struct lruvec *mem_cgroup_page_lruvec(struct page *page, struct zone *zone) | ||
1846 | struct mem_cgroup_per_zone *mz; | ||
1847 | struct mem_cgroup *memcg; | ||
1848 | struct page_cgroup *pc; | ||
1849 | + struct lruvec *lruvec; | ||
1850 | |||
1851 | - if (mem_cgroup_disabled()) | ||
1852 | - return &zone->lruvec; | ||
1853 | + if (mem_cgroup_disabled()) { | ||
1854 | + lruvec = &zone->lruvec; | ||
1855 | + goto out; | ||
1856 | + } | ||
1857 | |||
1858 | pc = lookup_page_cgroup(page); | ||
1859 | memcg = pc->mem_cgroup; | ||
1860 | @@ -1113,7 +1128,16 @@ struct lruvec *mem_cgroup_page_lruvec(struct page *page, struct zone *zone) | ||
1861 | pc->mem_cgroup = memcg = root_mem_cgroup; | ||
1862 | |||
1863 | mz = page_cgroup_zoneinfo(memcg, page); | ||
1864 | - return &mz->lruvec; | ||
1865 | + lruvec = &mz->lruvec; | ||
1866 | +out: | ||
1867 | + /* | ||
1868 | + * Since a node can be onlined after the mem_cgroup was created, | ||
1869 | + * we have to be prepared to initialize lruvec->zone here; | ||
1870 | + * and if offlined then reonlined, we need to reinitialize it. | ||
1871 | + */ | ||
1872 | + if (unlikely(lruvec->zone != zone)) | ||
1873 | + lruvec->zone = zone; | ||
1874 | + return lruvec; | ||
1875 | } | ||
1876 | |||
1877 | /** | ||
1878 | @@ -1458,17 +1482,26 @@ static int mem_cgroup_count_children(struct mem_cgroup *memcg) | ||
1879 | static u64 mem_cgroup_get_limit(struct mem_cgroup *memcg) | ||
1880 | { | ||
1881 | u64 limit; | ||
1882 | - u64 memsw; | ||
1883 | |||
1884 | limit = res_counter_read_u64(&memcg->res, RES_LIMIT); | ||
1885 | - limit += total_swap_pages << PAGE_SHIFT; | ||
1886 | |||
1887 | - memsw = res_counter_read_u64(&memcg->memsw, RES_LIMIT); | ||
1888 | /* | ||
1889 | - * If memsw is finite and limits the amount of swap space available | ||
1890 | - * to this memcg, return that limit. | ||
1891 | + * Do not consider swap space if we cannot swap due to swappiness | ||
1892 | */ | ||
1893 | - return min(limit, memsw); | ||
1894 | + if (mem_cgroup_swappiness(memcg)) { | ||
1895 | + u64 memsw; | ||
1896 | + | ||
1897 | + limit += total_swap_pages << PAGE_SHIFT; | ||
1898 | + memsw = res_counter_read_u64(&memcg->memsw, RES_LIMIT); | ||
1899 | + | ||
1900 | + /* | ||
1901 | + * If memsw is finite and limits the amount of swap space | ||
1902 | + * available to this memcg, return that limit. | ||
1903 | + */ | ||
1904 | + limit = min(limit, memsw); | ||
1905 | + } | ||
1906 | + | ||
1907 | + return limit; | ||
1908 | } | ||
1909 | |||
1910 | void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask, | ||
1911 | @@ -3694,17 +3727,17 @@ unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, | ||
1912 | static bool mem_cgroup_force_empty_list(struct mem_cgroup *memcg, | ||
1913 | int node, int zid, enum lru_list lru) | ||
1914 | { | ||
1915 | - struct mem_cgroup_per_zone *mz; | ||
1916 | + struct lruvec *lruvec; | ||
1917 | unsigned long flags, loop; | ||
1918 | struct list_head *list; | ||
1919 | struct page *busy; | ||
1920 | struct zone *zone; | ||
1921 | |||
1922 | zone = &NODE_DATA(node)->node_zones[zid]; | ||
1923 | - mz = mem_cgroup_zoneinfo(memcg, node, zid); | ||
1924 | - list = &mz->lruvec.lists[lru]; | ||
1925 | + lruvec = mem_cgroup_zone_lruvec(zone, memcg); | ||
1926 | + list = &lruvec->lists[lru]; | ||
1927 | |||
1928 | - loop = mz->lru_size[lru]; | ||
1929 | + loop = mem_cgroup_get_lru_size(lruvec, lru); | ||
1930 | /* give some margin against EBUSY etc...*/ | ||
1931 | loop += 256; | ||
1932 | busy = NULL; | ||
1933 | @@ -4742,7 +4775,7 @@ static int alloc_mem_cgroup_per_zone_info(struct mem_cgroup *memcg, int node) | ||
1934 | |||
1935 | for (zone = 0; zone < MAX_NR_ZONES; zone++) { | ||
1936 | mz = &pn->zoneinfo[zone]; | ||
1937 | - lruvec_init(&mz->lruvec, &NODE_DATA(node)->node_zones[zone]); | ||
1938 | + lruvec_init(&mz->lruvec); | ||
1939 | mz->usage_in_excess = 0; | ||
1940 | mz->on_tree = false; | ||
1941 | mz->memcg = memcg; | ||
1942 | diff --git a/mm/mmzone.c b/mm/mmzone.c | ||
1943 | index 3cef80f..4596d81 100644 | ||
1944 | --- a/mm/mmzone.c | ||
1945 | +++ b/mm/mmzone.c | ||
1946 | @@ -87,7 +87,7 @@ int memmap_valid_within(unsigned long pfn, | ||
1947 | } | ||
1948 | #endif /* CONFIG_ARCH_HAS_HOLES_MEMORYMODEL */ | ||
1949 | |||
1950 | -void lruvec_init(struct lruvec *lruvec, struct zone *zone) | ||
1951 | +void lruvec_init(struct lruvec *lruvec) | ||
1952 | { | ||
1953 | enum lru_list lru; | ||
1954 | |||
1955 | @@ -95,8 +95,4 @@ void lruvec_init(struct lruvec *lruvec, struct zone *zone) | ||
1956 | |||
1957 | for_each_lru(lru) | ||
1958 | INIT_LIST_HEAD(&lruvec->lists[lru]); | ||
1959 | - | ||
1960 | -#ifdef CONFIG_MEMCG | ||
1961 | - lruvec->zone = zone; | ||
1962 | -#endif | ||
1963 | } | ||
1964 | diff --git a/mm/page_alloc.c b/mm/page_alloc.c | ||
1965 | index c13ea75..d2d8f54 100644 | ||
1966 | --- a/mm/page_alloc.c | ||
1967 | +++ b/mm/page_alloc.c | ||
1968 | @@ -4456,7 +4456,7 @@ static void __paginginit free_area_init_core(struct pglist_data *pgdat, | ||
1969 | zone->zone_pgdat = pgdat; | ||
1970 | |||
1971 | zone_pcp_init(zone); | ||
1972 | - lruvec_init(&zone->lruvec, zone); | ||
1973 | + lruvec_init(&zone->lruvec); | ||
1974 | if (!size) | ||
1975 | continue; | ||
1976 | |||
1977 | diff --git a/mm/shmem.c b/mm/shmem.c | ||
1978 | index d2eeca1..31e1506 100644 | ||
1979 | --- a/mm/shmem.c | ||
1980 | +++ b/mm/shmem.c | ||
1981 | @@ -654,7 +654,7 @@ static void shmem_evict_inode(struct inode *inode) | ||
1982 | kfree(xattr->name); | ||
1983 | kfree(xattr); | ||
1984 | } | ||
1985 | - BUG_ON(inode->i_blocks); | ||
1986 | + WARN_ON(inode->i_blocks); | ||
1987 | shmem_free_inode(inode->i_sb); | ||
1988 | clear_inode(inode); | ||
1989 | } | ||
1990 | @@ -1156,8 +1156,20 @@ repeat: | ||
1991 | if (!error) { | ||
1992 | error = shmem_add_to_page_cache(page, mapping, index, | ||
1993 | gfp, swp_to_radix_entry(swap)); | ||
1994 | - /* We already confirmed swap, and make no allocation */ | ||
1995 | - VM_BUG_ON(error); | ||
1996 | + /* | ||
1997 | + * We already confirmed swap under page lock, and make | ||
1998 | + * no memory allocation here, so usually no possibility | ||
1999 | + * of error; but free_swap_and_cache() only trylocks a | ||
2000 | + * page, so it is just possible that the entry has been | ||
2001 | + * truncated or holepunched since swap was confirmed. | ||
2002 | + * shmem_undo_range() will have done some of the | ||
2003 | + * unaccounting, now delete_from_swap_cache() will do | ||
2004 | + * the rest (including mem_cgroup_uncharge_swapcache). | ||
2005 | + * Reset swap.val? No, leave it so "failed" goes back to | ||
2006 | + * "repeat": reading a hole and writing should succeed. | ||
2007 | + */ | ||
2008 | + if (error) | ||
2009 | + delete_from_swap_cache(page); | ||
2010 | } | ||
2011 | if (error) | ||
2012 | goto failed; | ||
2013 | diff --git a/mm/vmscan.c b/mm/vmscan.c | ||
2014 | index 99b434b..a018dfc 100644 | ||
2015 | --- a/mm/vmscan.c | ||
2016 | +++ b/mm/vmscan.c | ||
2017 | @@ -2953,6 +2953,8 @@ static int kswapd(void *p) | ||
2018 | &balanced_classzone_idx); | ||
2019 | } | ||
2020 | } | ||
2021 | + | ||
2022 | + current->reclaim_state = NULL; | ||
2023 | return 0; | ||
2024 | } | ||
2025 | |||
2026 | diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c | ||
2027 | index eba022d..534250a 100644 | ||
2028 | --- a/net/bluetooth/mgmt.c | ||
2029 | +++ b/net/bluetooth/mgmt.c | ||
2030 | @@ -321,7 +321,7 @@ static int read_index_list(struct sock *sk, struct hci_dev *hdev, void *data, | ||
2031 | struct hci_dev *d; | ||
2032 | size_t rp_len; | ||
2033 | u16 count; | ||
2034 | - int i, err; | ||
2035 | + int err; | ||
2036 | |||
2037 | BT_DBG("sock %p", sk); | ||
2038 | |||
2039 | @@ -339,17 +339,18 @@ static int read_index_list(struct sock *sk, struct hci_dev *hdev, void *data, | ||
2040 | return -ENOMEM; | ||
2041 | } | ||
2042 | |||
2043 | - rp->num_controllers = cpu_to_le16(count); | ||
2044 | - | ||
2045 | - i = 0; | ||
2046 | + count = 0; | ||
2047 | list_for_each_entry(d, &hci_dev_list, list) { | ||
2048 | if (test_bit(HCI_SETUP, &d->dev_flags)) | ||
2049 | continue; | ||
2050 | |||
2051 | - rp->index[i++] = cpu_to_le16(d->id); | ||
2052 | + rp->index[count++] = cpu_to_le16(d->id); | ||
2053 | BT_DBG("Added hci%u", d->id); | ||
2054 | } | ||
2055 | |||
2056 | + rp->num_controllers = cpu_to_le16(count); | ||
2057 | + rp_len = sizeof(*rp) + (2 * count); | ||
2058 | + | ||
2059 | read_unlock(&hci_dev_list_lock); | ||
2060 | |||
2061 | err = cmd_complete(sk, MGMT_INDEX_NONE, MGMT_OP_READ_INDEX_LIST, 0, rp, | ||
2062 | diff --git a/net/core/dev.c b/net/core/dev.c | ||
2063 | index aed87a4..1dce5b5 100644 | ||
2064 | --- a/net/core/dev.c | ||
2065 | +++ b/net/core/dev.c | ||
2066 | @@ -2793,8 +2793,10 @@ static int get_rps_cpu(struct net_device *dev, struct sk_buff *skb, | ||
2067 | if (unlikely(tcpu != next_cpu) && | ||
2068 | (tcpu == RPS_NO_CPU || !cpu_online(tcpu) || | ||
2069 | ((int)(per_cpu(softnet_data, tcpu).input_queue_head - | ||
2070 | - rflow->last_qtail)) >= 0)) | ||
2071 | + rflow->last_qtail)) >= 0)) { | ||
2072 | + tcpu = next_cpu; | ||
2073 | rflow = set_rps_cpu(dev, skb, rflow, next_cpu); | ||
2074 | + } | ||
2075 | |||
2076 | if (tcpu != RPS_NO_CPU && cpu_online(tcpu)) { | ||
2077 | *rflowp = rflow; | ||
2078 | diff --git a/net/core/dev_addr_lists.c b/net/core/dev_addr_lists.c | ||
2079 | index c4cc2bc..716f363 100644 | ||
2080 | --- a/net/core/dev_addr_lists.c | ||
2081 | +++ b/net/core/dev_addr_lists.c | ||
2082 | @@ -317,7 +317,8 @@ int dev_addr_del(struct net_device *dev, unsigned char *addr, | ||
2083 | */ | ||
2084 | ha = list_first_entry(&dev->dev_addrs.list, | ||
2085 | struct netdev_hw_addr, list); | ||
2086 | - if (ha->addr == dev->dev_addr && ha->refcount == 1) | ||
2087 | + if (!memcmp(ha->addr, addr, dev->addr_len) && | ||
2088 | + ha->type == addr_type && ha->refcount == 1) | ||
2089 | return -ENOENT; | ||
2090 | |||
2091 | err = __hw_addr_del(&dev->dev_addrs, addr, dev->addr_len, | ||
2092 | diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c | ||
2093 | index 5eea4a8..14bbfcf 100644 | ||
2094 | --- a/net/ipv4/ip_sockglue.c | ||
2095 | +++ b/net/ipv4/ip_sockglue.c | ||
2096 | @@ -457,19 +457,28 @@ static int do_ip_setsockopt(struct sock *sk, int level, | ||
2097 | struct inet_sock *inet = inet_sk(sk); | ||
2098 | int val = 0, err; | ||
2099 | |||
2100 | - if (((1<<optname) & ((1<<IP_PKTINFO) | (1<<IP_RECVTTL) | | ||
2101 | - (1<<IP_RECVOPTS) | (1<<IP_RECVTOS) | | ||
2102 | - (1<<IP_RETOPTS) | (1<<IP_TOS) | | ||
2103 | - (1<<IP_TTL) | (1<<IP_HDRINCL) | | ||
2104 | - (1<<IP_MTU_DISCOVER) | (1<<IP_RECVERR) | | ||
2105 | - (1<<IP_ROUTER_ALERT) | (1<<IP_FREEBIND) | | ||
2106 | - (1<<IP_PASSSEC) | (1<<IP_TRANSPARENT) | | ||
2107 | - (1<<IP_MINTTL) | (1<<IP_NODEFRAG))) || | ||
2108 | - optname == IP_UNICAST_IF || | ||
2109 | - optname == IP_MULTICAST_TTL || | ||
2110 | - optname == IP_MULTICAST_ALL || | ||
2111 | - optname == IP_MULTICAST_LOOP || | ||
2112 | - optname == IP_RECVORIGDSTADDR) { | ||
2113 | + switch (optname) { | ||
2114 | + case IP_PKTINFO: | ||
2115 | + case IP_RECVTTL: | ||
2116 | + case IP_RECVOPTS: | ||
2117 | + case IP_RECVTOS: | ||
2118 | + case IP_RETOPTS: | ||
2119 | + case IP_TOS: | ||
2120 | + case IP_TTL: | ||
2121 | + case IP_HDRINCL: | ||
2122 | + case IP_MTU_DISCOVER: | ||
2123 | + case IP_RECVERR: | ||
2124 | + case IP_ROUTER_ALERT: | ||
2125 | + case IP_FREEBIND: | ||
2126 | + case IP_PASSSEC: | ||
2127 | + case IP_TRANSPARENT: | ||
2128 | + case IP_MINTTL: | ||
2129 | + case IP_NODEFRAG: | ||
2130 | + case IP_UNICAST_IF: | ||
2131 | + case IP_MULTICAST_TTL: | ||
2132 | + case IP_MULTICAST_ALL: | ||
2133 | + case IP_MULTICAST_LOOP: | ||
2134 | + case IP_RECVORIGDSTADDR: | ||
2135 | if (optlen >= sizeof(int)) { | ||
2136 | if (get_user(val, (int __user *) optval)) | ||
2137 | return -EFAULT; | ||
2138 | diff --git a/net/ipv4/ip_vti.c b/net/ipv4/ip_vti.c | ||
2139 | index 3511ffb..bf89b21 100644 | ||
2140 | --- a/net/ipv4/ip_vti.c | ||
2141 | +++ b/net/ipv4/ip_vti.c | ||
2142 | @@ -341,12 +341,17 @@ static int vti_rcv(struct sk_buff *skb) | ||
2143 | if (tunnel != NULL) { | ||
2144 | struct pcpu_tstats *tstats; | ||
2145 | |||
2146 | + if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) | ||
2147 | + return -1; | ||
2148 | + | ||
2149 | tstats = this_cpu_ptr(tunnel->dev->tstats); | ||
2150 | u64_stats_update_begin(&tstats->syncp); | ||
2151 | tstats->rx_packets++; | ||
2152 | tstats->rx_bytes += skb->len; | ||
2153 | u64_stats_update_end(&tstats->syncp); | ||
2154 | |||
2155 | + skb->mark = 0; | ||
2156 | + secpath_reset(skb); | ||
2157 | skb->dev = tunnel->dev; | ||
2158 | rcu_read_unlock(); | ||
2159 | return 1; | ||
2160 | diff --git a/net/ipv4/netfilter/nf_nat_standalone.c b/net/ipv4/netfilter/nf_nat_standalone.c | ||
2161 | index 3828a42..da4098f 100644 | ||
2162 | --- a/net/ipv4/netfilter/nf_nat_standalone.c | ||
2163 | +++ b/net/ipv4/netfilter/nf_nat_standalone.c | ||
2164 | @@ -194,7 +194,8 @@ nf_nat_out(unsigned int hooknum, | ||
2165 | |||
2166 | if ((ct->tuplehash[dir].tuple.src.u3.ip != | ||
2167 | ct->tuplehash[!dir].tuple.dst.u3.ip) || | ||
2168 | - (ct->tuplehash[dir].tuple.src.u.all != | ||
2169 | + (ct->tuplehash[dir].tuple.dst.protonum != IPPROTO_ICMP && | ||
2170 | + ct->tuplehash[dir].tuple.src.u.all != | ||
2171 | ct->tuplehash[!dir].tuple.dst.u.all) | ||
2172 | ) | ||
2173 | return ip_xfrm_me_harder(skb) == 0 ? ret : NF_DROP; | ||
2174 | @@ -230,7 +231,8 @@ nf_nat_local_fn(unsigned int hooknum, | ||
2175 | ret = NF_DROP; | ||
2176 | } | ||
2177 | #ifdef CONFIG_XFRM | ||
2178 | - else if (ct->tuplehash[dir].tuple.dst.u.all != | ||
2179 | + else if (ct->tuplehash[dir].tuple.dst.protonum != IPPROTO_ICMP && | ||
2180 | + ct->tuplehash[dir].tuple.dst.u.all != | ||
2181 | ct->tuplehash[!dir].tuple.src.u.all) | ||
2182 | if (ip_xfrm_me_harder(skb)) | ||
2183 | ret = NF_DROP; | ||
2184 | diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c | ||
2185 | index 49dd993..b0b39f6 100644 | ||
2186 | --- a/net/ipv4/tcp.c | ||
2187 | +++ b/net/ipv4/tcp.c | ||
2188 | @@ -1236,7 +1236,7 @@ new_segment: | ||
2189 | wait_for_sndbuf: | ||
2190 | set_bit(SOCK_NOSPACE, &sk->sk_socket->flags); | ||
2191 | wait_for_memory: | ||
2192 | - if (copied && likely(!tp->repair)) | ||
2193 | + if (copied) | ||
2194 | tcp_push(sk, flags & ~MSG_MORE, mss_now, TCP_NAGLE_PUSH); | ||
2195 | |||
2196 | if ((err = sk_stream_wait_memory(sk, &timeo)) != 0) | ||
2197 | @@ -1247,7 +1247,7 @@ wait_for_memory: | ||
2198 | } | ||
2199 | |||
2200 | out: | ||
2201 | - if (copied && likely(!tp->repair)) | ||
2202 | + if (copied) | ||
2203 | tcp_push(sk, flags, mss_now, tp->nonagle); | ||
2204 | release_sock(sk); | ||
2205 | return copied + copied_syn; | ||
2206 | diff --git a/net/ipv4/tcp_metrics.c b/net/ipv4/tcp_metrics.c | ||
2207 | index 0abe67b..2efd1a5 100644 | ||
2208 | --- a/net/ipv4/tcp_metrics.c | ||
2209 | +++ b/net/ipv4/tcp_metrics.c | ||
2210 | @@ -1,13 +1,13 @@ | ||
2211 | #include <linux/rcupdate.h> | ||
2212 | #include <linux/spinlock.h> | ||
2213 | #include <linux/jiffies.h> | ||
2214 | -#include <linux/bootmem.h> | ||
2215 | #include <linux/module.h> | ||
2216 | #include <linux/cache.h> | ||
2217 | #include <linux/slab.h> | ||
2218 | #include <linux/init.h> | ||
2219 | #include <linux/tcp.h> | ||
2220 | #include <linux/hash.h> | ||
2221 | +#include <linux/vmalloc.h> | ||
2222 | |||
2223 | #include <net/inet_connection_sock.h> | ||
2224 | #include <net/net_namespace.h> | ||
2225 | @@ -722,7 +722,10 @@ static int __net_init tcp_net_metrics_init(struct net *net) | ||
2226 | net->ipv4.tcp_metrics_hash_log = order_base_2(slots); | ||
2227 | size = sizeof(struct tcpm_hash_bucket) << net->ipv4.tcp_metrics_hash_log; | ||
2228 | |||
2229 | - net->ipv4.tcp_metrics_hash = kzalloc(size, GFP_KERNEL); | ||
2230 | + net->ipv4.tcp_metrics_hash = kzalloc(size, GFP_KERNEL | __GFP_NOWARN); | ||
2231 | + if (!net->ipv4.tcp_metrics_hash) | ||
2232 | + net->ipv4.tcp_metrics_hash = vzalloc(size); | ||
2233 | + | ||
2234 | if (!net->ipv4.tcp_metrics_hash) | ||
2235 | return -ENOMEM; | ||
2236 | |||
2237 | @@ -743,7 +746,10 @@ static void __net_exit tcp_net_metrics_exit(struct net *net) | ||
2238 | tm = next; | ||
2239 | } | ||
2240 | } | ||
2241 | - kfree(net->ipv4.tcp_metrics_hash); | ||
2242 | + if (is_vmalloc_addr(net->ipv4.tcp_metrics_hash)) | ||
2243 | + vfree(net->ipv4.tcp_metrics_hash); | ||
2244 | + else | ||
2245 | + kfree(net->ipv4.tcp_metrics_hash); | ||
2246 | } | ||
2247 | |||
2248 | static __net_initdata struct pernet_operations tcp_net_metrics_ops = { | ||
2249 | diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c | ||
2250 | index d046326..6735bea 100644 | ||
2251 | --- a/net/ipv4/tcp_output.c | ||
2252 | +++ b/net/ipv4/tcp_output.c | ||
2253 | @@ -1977,6 +1977,9 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle, | ||
2254 | tso_segs = tcp_init_tso_segs(sk, skb, mss_now); | ||
2255 | BUG_ON(!tso_segs); | ||
2256 | |||
2257 | + if (unlikely(tp->repair) && tp->repair_queue == TCP_SEND_QUEUE) | ||
2258 | + goto repair; /* Skip network transmission */ | ||
2259 | + | ||
2260 | cwnd_quota = tcp_cwnd_test(tp, skb); | ||
2261 | if (!cwnd_quota) | ||
2262 | break; | ||
2263 | @@ -2017,6 +2020,7 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle, | ||
2264 | if (unlikely(tcp_transmit_skb(sk, skb, 1, gfp))) | ||
2265 | break; | ||
2266 | |||
2267 | +repair: | ||
2268 | /* Advance the send_head. This one is sent out. | ||
2269 | * This call will increment packets_out. | ||
2270 | */ | ||
2271 | diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c | ||
2272 | index ba6d13d..e02faed 100644 | ||
2273 | --- a/net/ipv6/ipv6_sockglue.c | ||
2274 | +++ b/net/ipv6/ipv6_sockglue.c | ||
2275 | @@ -827,6 +827,7 @@ pref_skip_coa: | ||
2276 | if (val < 0 || val > 255) | ||
2277 | goto e_inval; | ||
2278 | np->min_hopcount = val; | ||
2279 | + retv = 0; | ||
2280 | break; | ||
2281 | case IPV6_DONTFRAG: | ||
2282 | np->dontfrag = valbool; | ||
2283 | diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h | ||
2284 | index bb61f77..642a2a3 100644 | ||
2285 | --- a/net/mac80211/ieee80211_i.h | ||
2286 | +++ b/net/mac80211/ieee80211_i.h | ||
2287 | @@ -1304,6 +1304,8 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb, | ||
2288 | struct net_device *dev); | ||
2289 | netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, | ||
2290 | struct net_device *dev); | ||
2291 | +void ieee80211_purge_tx_queue(struct ieee80211_hw *hw, | ||
2292 | + struct sk_buff_head *skbs); | ||
2293 | |||
2294 | /* HT */ | ||
2295 | void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata, | ||
2296 | diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c | ||
2297 | index 63882b9..31aa8b8 100644 | ||
2298 | --- a/net/mac80211/sta_info.c | ||
2299 | +++ b/net/mac80211/sta_info.c | ||
2300 | @@ -730,8 +730,8 @@ int __must_check __sta_info_destroy(struct sta_info *sta) | ||
2301 | |||
2302 | for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) { | ||
2303 | local->total_ps_buffered -= skb_queue_len(&sta->ps_tx_buf[ac]); | ||
2304 | - __skb_queue_purge(&sta->ps_tx_buf[ac]); | ||
2305 | - __skb_queue_purge(&sta->tx_filtered[ac]); | ||
2306 | + ieee80211_purge_tx_queue(&local->hw, &sta->ps_tx_buf[ac]); | ||
2307 | + ieee80211_purge_tx_queue(&local->hw, &sta->tx_filtered[ac]); | ||
2308 | } | ||
2309 | |||
2310 | #ifdef CONFIG_MAC80211_MESH | ||
2311 | @@ -765,7 +765,7 @@ int __must_check __sta_info_destroy(struct sta_info *sta) | ||
2312 | tid_tx = rcu_dereference_raw(sta->ampdu_mlme.tid_tx[i]); | ||
2313 | if (!tid_tx) | ||
2314 | continue; | ||
2315 | - __skb_queue_purge(&tid_tx->pending); | ||
2316 | + ieee80211_purge_tx_queue(&local->hw, &tid_tx->pending); | ||
2317 | kfree(tid_tx); | ||
2318 | } | ||
2319 | |||
2320 | @@ -948,6 +948,7 @@ void ieee80211_sta_ps_deliver_wakeup(struct sta_info *sta) | ||
2321 | struct ieee80211_local *local = sdata->local; | ||
2322 | struct sk_buff_head pending; | ||
2323 | int filtered = 0, buffered = 0, ac; | ||
2324 | + unsigned long flags; | ||
2325 | |||
2326 | clear_sta_flag(sta, WLAN_STA_SP); | ||
2327 | |||
2328 | @@ -963,12 +964,16 @@ void ieee80211_sta_ps_deliver_wakeup(struct sta_info *sta) | ||
2329 | for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) { | ||
2330 | int count = skb_queue_len(&pending), tmp; | ||
2331 | |||
2332 | + spin_lock_irqsave(&sta->tx_filtered[ac].lock, flags); | ||
2333 | skb_queue_splice_tail_init(&sta->tx_filtered[ac], &pending); | ||
2334 | + spin_unlock_irqrestore(&sta->tx_filtered[ac].lock, flags); | ||
2335 | tmp = skb_queue_len(&pending); | ||
2336 | filtered += tmp - count; | ||
2337 | count = tmp; | ||
2338 | |||
2339 | + spin_lock_irqsave(&sta->ps_tx_buf[ac].lock, flags); | ||
2340 | skb_queue_splice_tail_init(&sta->ps_tx_buf[ac], &pending); | ||
2341 | + spin_unlock_irqrestore(&sta->ps_tx_buf[ac].lock, flags); | ||
2342 | tmp = skb_queue_len(&pending); | ||
2343 | buffered += tmp - count; | ||
2344 | } | ||
2345 | diff --git a/net/mac80211/status.c b/net/mac80211/status.c | ||
2346 | index 118329a..14e1b83 100644 | ||
2347 | --- a/net/mac80211/status.c | ||
2348 | +++ b/net/mac80211/status.c | ||
2349 | @@ -648,3 +648,12 @@ void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb) | ||
2350 | dev_kfree_skb_any(skb); | ||
2351 | } | ||
2352 | EXPORT_SYMBOL(ieee80211_free_txskb); | ||
2353 | + | ||
2354 | +void ieee80211_purge_tx_queue(struct ieee80211_hw *hw, | ||
2355 | + struct sk_buff_head *skbs) | ||
2356 | +{ | ||
2357 | + struct sk_buff *skb; | ||
2358 | + | ||
2359 | + while ((skb = __skb_dequeue(skbs))) | ||
2360 | + ieee80211_free_txskb(hw, skb); | ||
2361 | +} | ||
2362 | diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c | ||
2363 | index 362c418..8133fed 100644 | ||
2364 | --- a/net/mac80211/tx.c | ||
2365 | +++ b/net/mac80211/tx.c | ||
2366 | @@ -1358,7 +1358,7 @@ static int invoke_tx_handlers(struct ieee80211_tx_data *tx) | ||
2367 | if (tx->skb) | ||
2368 | ieee80211_free_txskb(&tx->local->hw, tx->skb); | ||
2369 | else | ||
2370 | - __skb_queue_purge(&tx->skbs); | ||
2371 | + ieee80211_purge_tx_queue(&tx->local->hw, &tx->skbs); | ||
2372 | return -1; | ||
2373 | } else if (unlikely(res == TX_QUEUED)) { | ||
2374 | I802_DEBUG_INC(tx->local->tx_handlers_queued); | ||
2375 | @@ -2132,10 +2132,13 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, | ||
2376 | */ | ||
2377 | void ieee80211_clear_tx_pending(struct ieee80211_local *local) | ||
2378 | { | ||
2379 | + struct sk_buff *skb; | ||
2380 | int i; | ||
2381 | |||
2382 | - for (i = 0; i < local->hw.queues; i++) | ||
2383 | - skb_queue_purge(&local->pending[i]); | ||
2384 | + for (i = 0; i < local->hw.queues; i++) { | ||
2385 | + while ((skb = skb_dequeue(&local->pending[i])) != NULL) | ||
2386 | + ieee80211_free_txskb(&local->hw, skb); | ||
2387 | + } | ||
2388 | } | ||
2389 | |||
2390 | /* | ||
2391 | diff --git a/net/mac80211/util.c b/net/mac80211/util.c | ||
2392 | index 1cfe6d5..7883449 100644 | ||
2393 | --- a/net/mac80211/util.c | ||
2394 | +++ b/net/mac80211/util.c | ||
2395 | @@ -1434,6 +1434,8 @@ int ieee80211_reconfig(struct ieee80211_local *local) | ||
2396 | list_for_each_entry(sdata, &local->interfaces, list) { | ||
2397 | if (sdata->vif.type != NL80211_IFTYPE_STATION) | ||
2398 | continue; | ||
2399 | + if (!sdata->u.mgd.associated) | ||
2400 | + continue; | ||
2401 | |||
2402 | ieee80211_send_nullfunc(local, sdata, 0); | ||
2403 | } | ||
2404 | diff --git a/net/netfilter/nf_conntrack_h323_main.c b/net/netfilter/nf_conntrack_h323_main.c | ||
2405 | index 4283b20..02f65bc 100644 | ||
2406 | --- a/net/netfilter/nf_conntrack_h323_main.c | ||
2407 | +++ b/net/netfilter/nf_conntrack_h323_main.c | ||
2408 | @@ -733,7 +733,8 @@ static int callforward_do_filter(const union nf_inet_addr *src, | ||
2409 | flowi4_to_flowi(&fl1), false)) { | ||
2410 | if (!afinfo->route(&init_net, (struct dst_entry **)&rt2, | ||
2411 | flowi4_to_flowi(&fl2), false)) { | ||
2412 | - if (rt1->rt_gateway == rt2->rt_gateway && | ||
2413 | + if (rt_nexthop(rt1, fl1.daddr) == | ||
2414 | + rt_nexthop(rt2, fl2.daddr) && | ||
2415 | rt1->dst.dev == rt2->dst.dev) | ||
2416 | ret = 1; | ||
2417 | dst_release(&rt2->dst); | ||
2418 | diff --git a/net/netfilter/xt_TEE.c b/net/netfilter/xt_TEE.c | ||
2419 | index ee2e5bc..bd93e51 100644 | ||
2420 | --- a/net/netfilter/xt_TEE.c | ||
2421 | +++ b/net/netfilter/xt_TEE.c | ||
2422 | @@ -70,6 +70,7 @@ tee_tg_route4(struct sk_buff *skb, const struct xt_tee_tginfo *info) | ||
2423 | fl4.daddr = info->gw.ip; | ||
2424 | fl4.flowi4_tos = RT_TOS(iph->tos); | ||
2425 | fl4.flowi4_scope = RT_SCOPE_UNIVERSE; | ||
2426 | + fl4.flowi4_flags = FLOWI_FLAG_KNOWN_NH; | ||
2427 | rt = ip_route_output_key(net, &fl4); | ||
2428 | if (IS_ERR(rt)) | ||
2429 | return false; | ||
2430 | diff --git a/net/nfc/llcp/llcp.c b/net/nfc/llcp/llcp.c | ||
2431 | index 82f0f75..7dd983a 100644 | ||
2432 | --- a/net/nfc/llcp/llcp.c | ||
2433 | +++ b/net/nfc/llcp/llcp.c | ||
2434 | @@ -1182,8 +1182,8 @@ int nfc_llcp_register_device(struct nfc_dev *ndev) | ||
2435 | goto err_rx_wq; | ||
2436 | } | ||
2437 | |||
2438 | - local->sockets.lock = __RW_LOCK_UNLOCKED(local->sockets.lock); | ||
2439 | - local->connecting_sockets.lock = __RW_LOCK_UNLOCKED(local->connecting_sockets.lock); | ||
2440 | + rwlock_init(&local->sockets.lock); | ||
2441 | + rwlock_init(&local->connecting_sockets.lock); | ||
2442 | |||
2443 | nfc_llcp_build_gb(local); | ||
2444 | |||
2445 | diff --git a/net/wireless/reg.c b/net/wireless/reg.c | ||
2446 | index 72d170c..3062b88 100644 | ||
2447 | --- a/net/wireless/reg.c | ||
2448 | +++ b/net/wireless/reg.c | ||
2449 | @@ -141,9 +141,8 @@ static const struct ieee80211_regdomain world_regdom = { | ||
2450 | .reg_rules = { | ||
2451 | /* IEEE 802.11b/g, channels 1..11 */ | ||
2452 | REG_RULE(2412-10, 2462+10, 40, 6, 20, 0), | ||
2453 | - /* IEEE 802.11b/g, channels 12..13. No HT40 | ||
2454 | - * channel fits here. */ | ||
2455 | - REG_RULE(2467-10, 2472+10, 20, 6, 20, | ||
2456 | + /* IEEE 802.11b/g, channels 12..13. */ | ||
2457 | + REG_RULE(2467-10, 2472+10, 40, 6, 20, | ||
2458 | NL80211_RRF_PASSIVE_SCAN | | ||
2459 | NL80211_RRF_NO_IBSS), | ||
2460 | /* IEEE 802.11 channel 14 - Only JP enables | ||
2461 | diff --git a/security/selinux/netnode.c b/security/selinux/netnode.c | ||
2462 | index 28f911c..c5454c0 100644 | ||
2463 | --- a/security/selinux/netnode.c | ||
2464 | +++ b/security/selinux/netnode.c | ||
2465 | @@ -174,7 +174,8 @@ static void sel_netnode_insert(struct sel_netnode *node) | ||
2466 | if (sel_netnode_hash[idx].size == SEL_NETNODE_HASH_BKT_LIMIT) { | ||
2467 | struct sel_netnode *tail; | ||
2468 | tail = list_entry( | ||
2469 | - rcu_dereference(sel_netnode_hash[idx].list.prev), | ||
2470 | + rcu_dereference_protected(sel_netnode_hash[idx].list.prev, | ||
2471 | + lockdep_is_held(&sel_netnode_lock)), | ||
2472 | struct sel_netnode, list); | ||
2473 | list_del_rcu(&tail->list); | ||
2474 | kfree_rcu(tail, rcu); | ||
2475 | diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c | ||
2476 | index 0208fa1..b2cd011 100644 | ||
2477 | --- a/sound/pci/hda/patch_analog.c | ||
2478 | +++ b/sound/pci/hda/patch_analog.c | ||
2479 | @@ -545,6 +545,7 @@ static int ad198x_build_pcms(struct hda_codec *codec) | ||
2480 | if (spec->multiout.dig_out_nid) { | ||
2481 | info++; | ||
2482 | codec->num_pcms++; | ||
2483 | + codec->spdif_status_reset = 1; | ||
2484 | info->name = "AD198x Digital"; | ||
2485 | info->pcm_type = HDA_PCM_TYPE_SPDIF; | ||
2486 | info->stream[SNDRV_PCM_STREAM_PLAYBACK] = ad198x_pcm_digital_playback; | ||
2487 | diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c | ||
2488 | index cc31346..2bb9bee 100644 | ||
2489 | --- a/sound/pci/hda/patch_cirrus.c | ||
2490 | +++ b/sound/pci/hda/patch_cirrus.c | ||
2491 | @@ -96,8 +96,8 @@ enum { | ||
2492 | #define CS420X_VENDOR_NID 0x11 | ||
2493 | #define CS_DIG_OUT1_PIN_NID 0x10 | ||
2494 | #define CS_DIG_OUT2_PIN_NID 0x15 | ||
2495 | -#define CS_DMIC1_PIN_NID 0x12 | ||
2496 | -#define CS_DMIC2_PIN_NID 0x0e | ||
2497 | +#define CS_DMIC1_PIN_NID 0x0e | ||
2498 | +#define CS_DMIC2_PIN_NID 0x12 | ||
2499 | |||
2500 | /* coef indices */ | ||
2501 | #define IDX_SPDIF_STAT 0x0000 | ||
2502 | @@ -1074,14 +1074,18 @@ static void init_input(struct hda_codec *codec) | ||
2503 | cs_automic(codec); | ||
2504 | |||
2505 | coef = 0x000a; /* ADC1/2 - Digital and Analog Soft Ramp */ | ||
2506 | + cs_vendor_coef_set(codec, IDX_ADC_CFG, coef); | ||
2507 | + | ||
2508 | + coef = cs_vendor_coef_get(codec, IDX_BEEP_CFG); | ||
2509 | if (is_active_pin(codec, CS_DMIC2_PIN_NID)) | ||
2510 | - coef |= 0x0500; /* DMIC2 2 chan on, GPIO1 off */ | ||
2511 | + coef |= 1 << 4; /* DMIC2 2 chan on, GPIO1 off */ | ||
2512 | if (is_active_pin(codec, CS_DMIC1_PIN_NID)) | ||
2513 | - coef |= 0x1800; /* DMIC1 2 chan on, GPIO0 off | ||
2514 | + coef |= 1 << 3; /* DMIC1 2 chan on, GPIO0 off | ||
2515 | * No effect if SPDIF_OUT2 is | ||
2516 | * selected in IDX_SPDIF_CTL. | ||
2517 | */ | ||
2518 | - cs_vendor_coef_set(codec, IDX_ADC_CFG, coef); | ||
2519 | + | ||
2520 | + cs_vendor_coef_set(codec, IDX_BEEP_CFG, coef); | ||
2521 | } else { | ||
2522 | if (spec->mic_detect) | ||
2523 | cs_automic(codec); | ||
2524 | @@ -1102,7 +1106,7 @@ static const struct hda_verb cs_coef_init_verbs[] = { | ||
2525 | | 0x0400 /* Disable Coefficient Auto increment */ | ||
2526 | )}, | ||
2527 | /* Beep */ | ||
2528 | - {0x11, AC_VERB_SET_COEF_INDEX, IDX_DAC_CFG}, | ||
2529 | + {0x11, AC_VERB_SET_COEF_INDEX, IDX_BEEP_CFG}, | ||
2530 | {0x11, AC_VERB_SET_PROC_COEF, 0x0007}, /* Enable Beep thru DAC1/2/3 */ | ||
2531 | |||
2532 | {} /* terminator */ | ||
2533 | diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c | ||
2534 | index 70ce60f..f6b5995 100644 | ||
2535 | --- a/sound/pci/hda/patch_realtek.c | ||
2536 | +++ b/sound/pci/hda/patch_realtek.c | ||
2537 | @@ -5434,6 +5434,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = { | ||
2538 | SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF), | ||
2539 | SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF), | ||
2540 | SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 5,1", ALC885_FIXUP_MACPRO_GPIO), | ||
2541 | + SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF), | ||
2542 | SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF), | ||
2543 | SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF), | ||
2544 | SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_IMAC91_VREF), | ||
2545 | @@ -5867,7 +5868,7 @@ static int alc269_parse_auto_config(struct hda_codec *codec) | ||
2546 | return alc_parse_auto_config(codec, alc269_ignore, ssids); | ||
2547 | } | ||
2548 | |||
2549 | -static void alc269_toggle_power_output(struct hda_codec *codec, int power_up) | ||
2550 | +static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up) | ||
2551 | { | ||
2552 | int val = alc_read_coef_idx(codec, 0x04); | ||
2553 | if (power_up) | ||
2554 | @@ -5884,10 +5885,10 @@ static void alc269_shutup(struct hda_codec *codec) | ||
2555 | if (spec->codec_variant != ALC269_TYPE_ALC269VB) | ||
2556 | return; | ||
2557 | |||
2558 | - if ((alc_get_coef0(codec) & 0x00ff) == 0x017) | ||
2559 | - alc269_toggle_power_output(codec, 0); | ||
2560 | - if ((alc_get_coef0(codec) & 0x00ff) == 0x018) { | ||
2561 | - alc269_toggle_power_output(codec, 0); | ||
2562 | + if (spec->codec_variant == ALC269_TYPE_ALC269VB) | ||
2563 | + alc269vb_toggle_power_output(codec, 0); | ||
2564 | + if (spec->codec_variant == ALC269_TYPE_ALC269VB && | ||
2565 | + (alc_get_coef0(codec) & 0x00ff) == 0x018) { | ||
2566 | msleep(150); | ||
2567 | } | ||
2568 | } | ||
2569 | @@ -5897,24 +5898,22 @@ static int alc269_resume(struct hda_codec *codec) | ||
2570 | { | ||
2571 | struct alc_spec *spec = codec->spec; | ||
2572 | |||
2573 | - if (spec->codec_variant == ALC269_TYPE_ALC269VB || | ||
2574 | + if (spec->codec_variant == ALC269_TYPE_ALC269VB) | ||
2575 | + alc269vb_toggle_power_output(codec, 0); | ||
2576 | + if (spec->codec_variant == ALC269_TYPE_ALC269VB && | ||
2577 | (alc_get_coef0(codec) & 0x00ff) == 0x018) { | ||
2578 | - alc269_toggle_power_output(codec, 0); | ||
2579 | msleep(150); | ||
2580 | } | ||
2581 | |||
2582 | codec->patch_ops.init(codec); | ||
2583 | |||
2584 | - if (spec->codec_variant == ALC269_TYPE_ALC269VB || | ||
2585 | + if (spec->codec_variant == ALC269_TYPE_ALC269VB) | ||
2586 | + alc269vb_toggle_power_output(codec, 1); | ||
2587 | + if (spec->codec_variant == ALC269_TYPE_ALC269VB && | ||
2588 | (alc_get_coef0(codec) & 0x00ff) == 0x017) { | ||
2589 | - alc269_toggle_power_output(codec, 1); | ||
2590 | msleep(200); | ||
2591 | } | ||
2592 | |||
2593 | - if (spec->codec_variant == ALC269_TYPE_ALC269VB || | ||
2594 | - (alc_get_coef0(codec) & 0x00ff) == 0x018) | ||
2595 | - alc269_toggle_power_output(codec, 1); | ||
2596 | - | ||
2597 | snd_hda_codec_resume_amp(codec); | ||
2598 | snd_hda_codec_resume_cache(codec); | ||
2599 | hda_call_check_power_status(codec, 0x01); | ||
2600 | @@ -7103,6 +7102,7 @@ static const struct hda_codec_preset snd_hda_preset_realtek[] = { | ||
2601 | .patch = patch_alc662 }, | ||
2602 | { .id = 0x10ec0663, .name = "ALC663", .patch = patch_alc662 }, | ||
2603 | { .id = 0x10ec0665, .name = "ALC665", .patch = patch_alc662 }, | ||
2604 | + { .id = 0x10ec0668, .name = "ALC668", .patch = patch_alc662 }, | ||
2605 | { .id = 0x10ec0670, .name = "ALC670", .patch = patch_alc662 }, | ||
2606 | { .id = 0x10ec0680, .name = "ALC680", .patch = patch_alc680 }, | ||
2607 | { .id = 0x10ec0880, .name = "ALC880", .patch = patch_alc880 }, | ||
2608 | @@ -7120,6 +7120,7 @@ static const struct hda_codec_preset snd_hda_preset_realtek[] = { | ||
2609 | { .id = 0x10ec0889, .name = "ALC889", .patch = patch_alc882 }, | ||
2610 | { .id = 0x10ec0892, .name = "ALC892", .patch = patch_alc662 }, | ||
2611 | { .id = 0x10ec0899, .name = "ALC898", .patch = patch_alc882 }, | ||
2612 | + { .id = 0x10ec0900, .name = "ALC1150", .patch = patch_alc882 }, | ||
2613 | {} /* terminator */ | ||
2614 | }; | ||
2615 | |||
2616 | diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c | ||
2617 | index 4c404a0..66cd4f0 100644 | ||
2618 | --- a/sound/pci/hda/patch_via.c | ||
2619 | +++ b/sound/pci/hda/patch_via.c | ||
2620 | @@ -1875,11 +1875,11 @@ static int via_auto_fill_dac_nids(struct hda_codec *codec) | ||
2621 | { | ||
2622 | struct via_spec *spec = codec->spec; | ||
2623 | const struct auto_pin_cfg *cfg = &spec->autocfg; | ||
2624 | - int i, dac_num; | ||
2625 | + int i; | ||
2626 | hda_nid_t nid; | ||
2627 | |||
2628 | + spec->multiout.num_dacs = 0; | ||
2629 | spec->multiout.dac_nids = spec->private_dac_nids; | ||
2630 | - dac_num = 0; | ||
2631 | for (i = 0; i < cfg->line_outs; i++) { | ||
2632 | hda_nid_t dac = 0; | ||
2633 | nid = cfg->line_out_pins[i]; | ||
2634 | @@ -1890,16 +1890,13 @@ static int via_auto_fill_dac_nids(struct hda_codec *codec) | ||
2635 | if (!i && parse_output_path(codec, nid, dac, 1, | ||
2636 | &spec->out_mix_path)) | ||
2637 | dac = spec->out_mix_path.path[0]; | ||
2638 | - if (dac) { | ||
2639 | - spec->private_dac_nids[i] = dac; | ||
2640 | - dac_num++; | ||
2641 | - } | ||
2642 | + if (dac) | ||
2643 | + spec->private_dac_nids[spec->multiout.num_dacs++] = dac; | ||
2644 | } | ||
2645 | if (!spec->out_path[0].depth && spec->out_mix_path.depth) { | ||
2646 | spec->out_path[0] = spec->out_mix_path; | ||
2647 | spec->out_mix_path.depth = 0; | ||
2648 | } | ||
2649 | - spec->multiout.num_dacs = dac_num; | ||
2650 | return 0; | ||
2651 | } | ||
2652 | |||
2653 | @@ -3700,6 +3697,18 @@ static const struct snd_pci_quirk vt2002p_fixups[] = { | ||
2654 | {} | ||
2655 | }; | ||
2656 | |||
2657 | +/* NIDs 0x24 and 0x33 on VT1802 have connections to non-existing NID 0x3e | ||
2658 | + * Replace this with mixer NID 0x1c | ||
2659 | + */ | ||
2660 | +static void fix_vt1802_connections(struct hda_codec *codec) | ||
2661 | +{ | ||
2662 | + static hda_nid_t conn_24[] = { 0x14, 0x1c }; | ||
2663 | + static hda_nid_t conn_33[] = { 0x1c }; | ||
2664 | + | ||
2665 | + snd_hda_override_conn_list(codec, 0x24, ARRAY_SIZE(conn_24), conn_24); | ||
2666 | + snd_hda_override_conn_list(codec, 0x33, ARRAY_SIZE(conn_33), conn_33); | ||
2667 | +} | ||
2668 | + | ||
2669 | /* patch for vt2002P */ | ||
2670 | static int patch_vt2002P(struct hda_codec *codec) | ||
2671 | { | ||
2672 | @@ -3714,6 +3723,8 @@ static int patch_vt2002P(struct hda_codec *codec) | ||
2673 | spec->aa_mix_nid = 0x21; | ||
2674 | override_mic_boost(codec, 0x2b, 0, 3, 40); | ||
2675 | override_mic_boost(codec, 0x29, 0, 3, 40); | ||
2676 | + if (spec->codec_type == VT1802) | ||
2677 | + fix_vt1802_connections(codec); | ||
2678 | add_secret_dac_path(codec); | ||
2679 | |||
2680 | snd_hda_pick_fixup(codec, NULL, vt2002p_fixups, via_fixups); | ||
2681 | diff --git a/sound/soc/codecs/cs42l52.c b/sound/soc/codecs/cs42l52.c | ||
2682 | index 628daf6..d8cfcc7 100644 | ||
2683 | --- a/sound/soc/codecs/cs42l52.c | ||
2684 | +++ b/sound/soc/codecs/cs42l52.c | ||
2685 | @@ -774,7 +774,6 @@ static int cs42l52_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) | ||
2686 | { | ||
2687 | struct snd_soc_codec *codec = codec_dai->codec; | ||
2688 | struct cs42l52_private *cs42l52 = snd_soc_codec_get_drvdata(codec); | ||
2689 | - int ret = 0; | ||
2690 | u8 iface = 0; | ||
2691 | |||
2692 | switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { | ||
2693 | @@ -823,7 +822,7 @@ static int cs42l52_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) | ||
2694 | case SND_SOC_DAIFMT_NB_IF: | ||
2695 | break; | ||
2696 | default: | ||
2697 | - ret = -EINVAL; | ||
2698 | + return -EINVAL; | ||
2699 | } | ||
2700 | cs42l52->config.format = iface; | ||
2701 | snd_soc_write(codec, CS42L52_IFACE_CTL1, cs42l52->config.format); | ||
2702 | diff --git a/sound/soc/codecs/wm8978.c b/sound/soc/codecs/wm8978.c | ||
2703 | index a5be3ad..2f46d66 100644 | ||
2704 | --- a/sound/soc/codecs/wm8978.c | ||
2705 | +++ b/sound/soc/codecs/wm8978.c | ||
2706 | @@ -782,7 +782,7 @@ static int wm8978_hw_params(struct snd_pcm_substream *substream, | ||
2707 | wm8978->mclk_idx = -1; | ||
2708 | f_sel = wm8978->f_mclk; | ||
2709 | } else { | ||
2710 | - if (!wm8978->f_pllout) { | ||
2711 | + if (!wm8978->f_opclk) { | ||
2712 | /* We only enter here, if OPCLK is not used */ | ||
2713 | int ret = wm8978_configure_pll(codec); | ||
2714 | if (ret < 0) | ||
2715 | diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c | ||
2716 | index c501af6..8bf05d7 100644 | ||
2717 | --- a/sound/soc/soc-core.c | ||
2718 | +++ b/sound/soc/soc-core.c | ||
2719 | @@ -2776,8 +2776,9 @@ int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol, | ||
2720 | val = (ucontrol->value.integer.value[0] + min) & mask; | ||
2721 | val = val << shift; | ||
2722 | |||
2723 | - if (snd_soc_update_bits_locked(codec, reg, val_mask, val)) | ||
2724 | - return err; | ||
2725 | + err = snd_soc_update_bits_locked(codec, reg, val_mask, val); | ||
2726 | + if (err < 0) | ||
2727 | + return err; | ||
2728 | |||
2729 | if (snd_soc_volsw_is_stereo(mc)) { | ||
2730 | val_mask = mask << rshift; | ||
2731 | diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c | ||
2732 | index f90139b..c4a08a2 100644 | ||
2733 | --- a/sound/soc/soc-dapm.c | ||
2734 | +++ b/sound/soc/soc-dapm.c | ||
2735 | @@ -3710,7 +3710,7 @@ void snd_soc_dapm_shutdown(struct snd_soc_card *card) | ||
2736 | { | ||
2737 | struct snd_soc_codec *codec; | ||
2738 | |||
2739 | - list_for_each_entry(codec, &card->codec_dev_list, list) { | ||
2740 | + list_for_each_entry(codec, &card->codec_dev_list, card_list) { | ||
2741 | soc_dapm_shutdown_codec(&codec->dapm); | ||
2742 | if (codec->dapm.bias_level == SND_SOC_BIAS_STANDBY) | ||
2743 | snd_soc_dapm_set_bias_level(&codec->dapm, | ||
2744 | diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c | ||
2745 | index d9de667..eafc889 100644 | ||
2746 | --- a/sound/usb/endpoint.c | ||
2747 | +++ b/sound/usb/endpoint.c | ||
2748 | @@ -35,6 +35,7 @@ | ||
2749 | |||
2750 | #define EP_FLAG_ACTIVATED 0 | ||
2751 | #define EP_FLAG_RUNNING 1 | ||
2752 | +#define EP_FLAG_STOPPING 2 | ||
2753 | |||
2754 | /* | ||
2755 | * snd_usb_endpoint is a model that abstracts everything related to an | ||
2756 | @@ -502,10 +503,20 @@ static int wait_clear_urbs(struct snd_usb_endpoint *ep) | ||
2757 | if (alive) | ||
2758 | snd_printk(KERN_ERR "timeout: still %d active urbs on EP #%x\n", | ||
2759 | alive, ep->ep_num); | ||
2760 | + clear_bit(EP_FLAG_STOPPING, &ep->flags); | ||
2761 | |||
2762 | return 0; | ||
2763 | } | ||
2764 | |||
2765 | +/* sync the pending stop operation; | ||
2766 | + * this function itself doesn't trigger the stop operation | ||
2767 | + */ | ||
2768 | +void snd_usb_endpoint_sync_pending_stop(struct snd_usb_endpoint *ep) | ||
2769 | +{ | ||
2770 | + if (ep && test_bit(EP_FLAG_STOPPING, &ep->flags)) | ||
2771 | + wait_clear_urbs(ep); | ||
2772 | +} | ||
2773 | + | ||
2774 | /* | ||
2775 | * unlink active urbs. | ||
2776 | */ | ||
2777 | @@ -913,6 +924,8 @@ void snd_usb_endpoint_stop(struct snd_usb_endpoint *ep, | ||
2778 | |||
2779 | if (wait) | ||
2780 | wait_clear_urbs(ep); | ||
2781 | + else | ||
2782 | + set_bit(EP_FLAG_STOPPING, &ep->flags); | ||
2783 | } | ||
2784 | } | ||
2785 | |||
2786 | diff --git a/sound/usb/endpoint.h b/sound/usb/endpoint.h | ||
2787 | index cbbbdf2..774a0eb 100644 | ||
2788 | --- a/sound/usb/endpoint.h | ||
2789 | +++ b/sound/usb/endpoint.h | ||
2790 | @@ -16,6 +16,7 @@ int snd_usb_endpoint_set_params(struct snd_usb_endpoint *ep, | ||
2791 | int snd_usb_endpoint_start(struct snd_usb_endpoint *ep, int can_sleep); | ||
2792 | void snd_usb_endpoint_stop(struct snd_usb_endpoint *ep, | ||
2793 | int force, int can_sleep, int wait); | ||
2794 | +void snd_usb_endpoint_sync_pending_stop(struct snd_usb_endpoint *ep); | ||
2795 | int snd_usb_endpoint_activate(struct snd_usb_endpoint *ep); | ||
2796 | int snd_usb_endpoint_deactivate(struct snd_usb_endpoint *ep); | ||
2797 | void snd_usb_endpoint_free(struct list_head *head); | ||
2798 | diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c | ||
2799 | index ee3c15c..90731af 100644 | ||
2800 | --- a/sound/usb/pcm.c | ||
2801 | +++ b/sound/usb/pcm.c | ||
2802 | @@ -563,6 +563,9 @@ static int snd_usb_pcm_prepare(struct snd_pcm_substream *substream) | ||
2803 | goto unlock; | ||
2804 | } | ||
2805 | |||
2806 | + snd_usb_endpoint_sync_pending_stop(subs->sync_endpoint); | ||
2807 | + snd_usb_endpoint_sync_pending_stop(subs->data_endpoint); | ||
2808 | + | ||
2809 | /* some unit conversions in runtime */ | ||
2810 | subs->data_endpoint->maxframesize = | ||
2811 | bytes_to_frames(runtime, subs->data_endpoint->maxpacksize); |