Annotation of /trunk/kernel-alx/patches-4.4/0132-4.4.33-all-fixes.patch
Parent Directory | Revision Log
Revision 2868 -
(hide annotations)
(download)
Mon Mar 27 13:49:11 2017 UTC (7 years, 2 months ago) by niro
File size: 41563 byte(s)
Mon Mar 27 13:49:11 2017 UTC (7 years, 2 months ago) by niro
File size: 41563 byte(s)
linux-4.4.33
1 | niro | 2868 | diff --git a/Makefile b/Makefile |
2 | index fba9b09a1330..a513c045c8de 100644 | ||
3 | --- a/Makefile | ||
4 | +++ b/Makefile | ||
5 | @@ -1,6 +1,6 @@ | ||
6 | VERSION = 4 | ||
7 | PATCHLEVEL = 4 | ||
8 | -SUBLEVEL = 32 | ||
9 | +SUBLEVEL = 33 | ||
10 | EXTRAVERSION = | ||
11 | NAME = Blurry Fish Butt | ||
12 | |||
13 | diff --git a/arch/arc/kernel/time.c b/arch/arc/kernel/time.c | ||
14 | index dfad287f1db1..dbedc576e4ca 100644 | ||
15 | --- a/arch/arc/kernel/time.c | ||
16 | +++ b/arch/arc/kernel/time.c | ||
17 | @@ -130,14 +130,17 @@ static cycle_t arc_counter_read(struct clocksource *cs) | ||
18 | cycle_t full; | ||
19 | } stamp; | ||
20 | |||
21 | - | ||
22 | - __asm__ __volatile( | ||
23 | - "1: \n" | ||
24 | - " lr %0, [AUX_RTC_LOW] \n" | ||
25 | - " lr %1, [AUX_RTC_HIGH] \n" | ||
26 | - " lr %2, [AUX_RTC_CTRL] \n" | ||
27 | - " bbit0.nt %2, 31, 1b \n" | ||
28 | - : "=r" (stamp.low), "=r" (stamp.high), "=r" (status)); | ||
29 | + /* | ||
30 | + * hardware has an internal state machine which tracks readout of | ||
31 | + * low/high and updates the CTRL.status if | ||
32 | + * - interrupt/exception taken between the two reads | ||
33 | + * - high increments after low has been read | ||
34 | + */ | ||
35 | + do { | ||
36 | + stamp.low = read_aux_reg(AUX_RTC_LOW); | ||
37 | + stamp.high = read_aux_reg(AUX_RTC_HIGH); | ||
38 | + status = read_aux_reg(AUX_RTC_CTRL); | ||
39 | + } while (!(status & _BITUL(31))); | ||
40 | |||
41 | return stamp.full; | ||
42 | } | ||
43 | diff --git a/arch/mips/include/asm/kvm_host.h b/arch/mips/include/asm/kvm_host.h | ||
44 | index dd7cee795709..c8c04a1f1c9f 100644 | ||
45 | --- a/arch/mips/include/asm/kvm_host.h | ||
46 | +++ b/arch/mips/include/asm/kvm_host.h | ||
47 | @@ -400,7 +400,10 @@ struct kvm_vcpu_arch { | ||
48 | /* Host KSEG0 address of the EI/DI offset */ | ||
49 | void *kseg0_commpage; | ||
50 | |||
51 | - u32 io_gpr; /* GPR used as IO source/target */ | ||
52 | + /* Resume PC after MMIO completion */ | ||
53 | + unsigned long io_pc; | ||
54 | + /* GPR used as IO source/target */ | ||
55 | + u32 io_gpr; | ||
56 | |||
57 | struct hrtimer comparecount_timer; | ||
58 | /* Count timer control KVM register */ | ||
59 | @@ -422,8 +425,6 @@ struct kvm_vcpu_arch { | ||
60 | /* Bitmask of pending exceptions to be cleared */ | ||
61 | unsigned long pending_exceptions_clr; | ||
62 | |||
63 | - unsigned long pending_load_cause; | ||
64 | - | ||
65 | /* Save/Restore the entryhi register when are are preempted/scheduled back in */ | ||
66 | unsigned long preempt_entryhi; | ||
67 | |||
68 | diff --git a/arch/mips/kvm/emulate.c b/arch/mips/kvm/emulate.c | ||
69 | index 4298aeb1e20f..4c85ab808f99 100644 | ||
70 | --- a/arch/mips/kvm/emulate.c | ||
71 | +++ b/arch/mips/kvm/emulate.c | ||
72 | @@ -1473,6 +1473,7 @@ enum emulation_result kvm_mips_emulate_load(uint32_t inst, uint32_t cause, | ||
73 | struct kvm_vcpu *vcpu) | ||
74 | { | ||
75 | enum emulation_result er = EMULATE_DO_MMIO; | ||
76 | + unsigned long curr_pc; | ||
77 | int32_t op, base, rt, offset; | ||
78 | uint32_t bytes; | ||
79 | |||
80 | @@ -1481,7 +1482,18 @@ enum emulation_result kvm_mips_emulate_load(uint32_t inst, uint32_t cause, | ||
81 | offset = inst & 0xffff; | ||
82 | op = (inst >> 26) & 0x3f; | ||
83 | |||
84 | - vcpu->arch.pending_load_cause = cause; | ||
85 | + /* | ||
86 | + * Find the resume PC now while we have safe and easy access to the | ||
87 | + * prior branch instruction, and save it for | ||
88 | + * kvm_mips_complete_mmio_load() to restore later. | ||
89 | + */ | ||
90 | + curr_pc = vcpu->arch.pc; | ||
91 | + er = update_pc(vcpu, cause); | ||
92 | + if (er == EMULATE_FAIL) | ||
93 | + return er; | ||
94 | + vcpu->arch.io_pc = vcpu->arch.pc; | ||
95 | + vcpu->arch.pc = curr_pc; | ||
96 | + | ||
97 | vcpu->arch.io_gpr = rt; | ||
98 | |||
99 | switch (op) { | ||
100 | @@ -2461,9 +2473,8 @@ enum emulation_result kvm_mips_complete_mmio_load(struct kvm_vcpu *vcpu, | ||
101 | goto done; | ||
102 | } | ||
103 | |||
104 | - er = update_pc(vcpu, vcpu->arch.pending_load_cause); | ||
105 | - if (er == EMULATE_FAIL) | ||
106 | - return er; | ||
107 | + /* Restore saved resume PC */ | ||
108 | + vcpu->arch.pc = vcpu->arch.io_pc; | ||
109 | |||
110 | switch (run->mmio.len) { | ||
111 | case 4: | ||
112 | @@ -2485,11 +2496,6 @@ enum emulation_result kvm_mips_complete_mmio_load(struct kvm_vcpu *vcpu, | ||
113 | break; | ||
114 | } | ||
115 | |||
116 | - if (vcpu->arch.pending_load_cause & CAUSEF_BD) | ||
117 | - kvm_debug("[%#lx] Completing %d byte BD Load to gpr %d (0x%08lx) type %d\n", | ||
118 | - vcpu->arch.pc, run->mmio.len, vcpu->arch.io_gpr, *gpr, | ||
119 | - vcpu->mmio_needed); | ||
120 | - | ||
121 | done: | ||
122 | return er; | ||
123 | } | ||
124 | diff --git a/arch/s390/hypfs/hypfs_diag.c b/arch/s390/hypfs/hypfs_diag.c | ||
125 | index 045035796ca7..b63b9a42af70 100644 | ||
126 | --- a/arch/s390/hypfs/hypfs_diag.c | ||
127 | +++ b/arch/s390/hypfs/hypfs_diag.c | ||
128 | @@ -525,11 +525,11 @@ static int diag224(void *ptr) | ||
129 | static int diag224_get_name_table(void) | ||
130 | { | ||
131 | /* memory must be below 2GB */ | ||
132 | - diag224_cpu_names = kmalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA); | ||
133 | + diag224_cpu_names = (char *) __get_free_page(GFP_KERNEL | GFP_DMA); | ||
134 | if (!diag224_cpu_names) | ||
135 | return -ENOMEM; | ||
136 | if (diag224(diag224_cpu_names)) { | ||
137 | - kfree(diag224_cpu_names); | ||
138 | + free_page((unsigned long) diag224_cpu_names); | ||
139 | return -EOPNOTSUPP; | ||
140 | } | ||
141 | EBCASC(diag224_cpu_names + 16, (*diag224_cpu_names + 1) * 16); | ||
142 | @@ -538,7 +538,7 @@ static int diag224_get_name_table(void) | ||
143 | |||
144 | static void diag224_delete_name_table(void) | ||
145 | { | ||
146 | - kfree(diag224_cpu_names); | ||
147 | + free_page((unsigned long) diag224_cpu_names); | ||
148 | } | ||
149 | |||
150 | static int diag224_idx2name(int index, char *name) | ||
151 | diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c | ||
152 | index 3dd9c462d22a..8f8da9f92090 100644 | ||
153 | --- a/drivers/acpi/apei/ghes.c | ||
154 | +++ b/drivers/acpi/apei/ghes.c | ||
155 | @@ -657,7 +657,7 @@ static int ghes_proc(struct ghes *ghes) | ||
156 | ghes_do_proc(ghes, ghes->estatus); | ||
157 | out: | ||
158 | ghes_clear_estatus(ghes); | ||
159 | - return 0; | ||
160 | + return rc; | ||
161 | } | ||
162 | |||
163 | static void ghes_add_timer(struct ghes *ghes) | ||
164 | diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c | ||
165 | index 74d97f4bac34..1d58854c4a9f 100644 | ||
166 | --- a/drivers/block/drbd/drbd_main.c | ||
167 | +++ b/drivers/block/drbd/drbd_main.c | ||
168 | @@ -1802,7 +1802,7 @@ int drbd_send(struct drbd_connection *connection, struct socket *sock, | ||
169 | * do we need to block DRBD_SIG if sock == &meta.socket ?? | ||
170 | * otherwise wake_asender() might interrupt some send_*Ack ! | ||
171 | */ | ||
172 | - rv = kernel_sendmsg(sock, &msg, &iov, 1, size); | ||
173 | + rv = kernel_sendmsg(sock, &msg, &iov, 1, iov.iov_len); | ||
174 | if (rv == -EAGAIN) { | ||
175 | if (we_should_drop_the_connection(connection, sock)) | ||
176 | break; | ||
177 | diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c | ||
178 | index 6f497aa1b276..cf25020576fa 100644 | ||
179 | --- a/drivers/char/hw_random/core.c | ||
180 | +++ b/drivers/char/hw_random/core.c | ||
181 | @@ -84,14 +84,14 @@ static size_t rng_buffer_size(void) | ||
182 | |||
183 | static void add_early_randomness(struct hwrng *rng) | ||
184 | { | ||
185 | - unsigned char bytes[16]; | ||
186 | int bytes_read; | ||
187 | + size_t size = min_t(size_t, 16, rng_buffer_size()); | ||
188 | |||
189 | mutex_lock(&reading_mutex); | ||
190 | - bytes_read = rng_get_data(rng, bytes, sizeof(bytes), 1); | ||
191 | + bytes_read = rng_get_data(rng, rng_buffer, size, 1); | ||
192 | mutex_unlock(&reading_mutex); | ||
193 | if (bytes_read > 0) | ||
194 | - add_device_randomness(bytes, bytes_read); | ||
195 | + add_device_randomness(rng_buffer, bytes_read); | ||
196 | } | ||
197 | |||
198 | static inline void cleanup_rng(struct kref *kref) | ||
199 | diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c | ||
200 | index 8b77abb6bc22..a5070f9cb0d4 100644 | ||
201 | --- a/drivers/clk/clk-qoriq.c | ||
202 | +++ b/drivers/clk/clk-qoriq.c | ||
203 | @@ -700,6 +700,7 @@ static struct clk * __init create_mux_common(struct clockgen *cg, | ||
204 | struct mux_hwclock *hwc, | ||
205 | const struct clk_ops *ops, | ||
206 | unsigned long min_rate, | ||
207 | + unsigned long max_rate, | ||
208 | unsigned long pct80_rate, | ||
209 | const char *fmt, int idx) | ||
210 | { | ||
211 | @@ -728,6 +729,8 @@ static struct clk * __init create_mux_common(struct clockgen *cg, | ||
212 | continue; | ||
213 | if (rate < min_rate) | ||
214 | continue; | ||
215 | + if (rate > max_rate) | ||
216 | + continue; | ||
217 | |||
218 | parent_names[j] = div->name; | ||
219 | hwc->parent_to_clksel[j] = i; | ||
220 | @@ -759,7 +762,7 @@ static struct clk * __init create_one_cmux(struct clockgen *cg, int idx) | ||
221 | struct mux_hwclock *hwc; | ||
222 | const struct clockgen_pll_div *div; | ||
223 | unsigned long plat_rate, min_rate; | ||
224 | - u64 pct80_rate; | ||
225 | + u64 max_rate, pct80_rate; | ||
226 | u32 clksel; | ||
227 | |||
228 | hwc = kzalloc(sizeof(*hwc), GFP_KERNEL); | ||
229 | @@ -787,8 +790,8 @@ static struct clk * __init create_one_cmux(struct clockgen *cg, int idx) | ||
230 | return NULL; | ||
231 | } | ||
232 | |||
233 | - pct80_rate = clk_get_rate(div->clk); | ||
234 | - pct80_rate *= 8; | ||
235 | + max_rate = clk_get_rate(div->clk); | ||
236 | + pct80_rate = max_rate * 8; | ||
237 | do_div(pct80_rate, 10); | ||
238 | |||
239 | plat_rate = clk_get_rate(cg->pll[PLATFORM_PLL].div[PLL_DIV1].clk); | ||
240 | @@ -798,7 +801,7 @@ static struct clk * __init create_one_cmux(struct clockgen *cg, int idx) | ||
241 | else | ||
242 | min_rate = plat_rate / 2; | ||
243 | |||
244 | - return create_mux_common(cg, hwc, &cmux_ops, min_rate, | ||
245 | + return create_mux_common(cg, hwc, &cmux_ops, min_rate, max_rate, | ||
246 | pct80_rate, "cg-cmux%d", idx); | ||
247 | } | ||
248 | |||
249 | @@ -813,7 +816,7 @@ static struct clk * __init create_one_hwaccel(struct clockgen *cg, int idx) | ||
250 | hwc->reg = cg->regs + 0x20 * idx + 0x10; | ||
251 | hwc->info = cg->info.hwaccel[idx]; | ||
252 | |||
253 | - return create_mux_common(cg, hwc, &hwaccel_ops, 0, 0, | ||
254 | + return create_mux_common(cg, hwc, &hwaccel_ops, 0, ULONG_MAX, 0, | ||
255 | "cg-hwaccel%d", idx); | ||
256 | } | ||
257 | |||
258 | diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c | ||
259 | index 9d05d7dbcfa9..66c073fc8afc 100644 | ||
260 | --- a/drivers/dma/at_xdmac.c | ||
261 | +++ b/drivers/dma/at_xdmac.c | ||
262 | @@ -864,8 +864,12 @@ at_xdmac_interleaved_queue_desc(struct dma_chan *chan, | ||
263 | * access. Hopefully we can access DDR through both ports (at least on | ||
264 | * SAMA5D4x), so we can use the same interface for source and dest, | ||
265 | * that solves the fact we don't know the direction. | ||
266 | + * ERRATA: Even if useless for memory transfers, the PERID has to not | ||
267 | + * match the one of another channel. If not, it could lead to spurious | ||
268 | + * flag status. | ||
269 | */ | ||
270 | - u32 chan_cc = AT_XDMAC_CC_DIF(0) | ||
271 | + u32 chan_cc = AT_XDMAC_CC_PERID(0x3f) | ||
272 | + | AT_XDMAC_CC_DIF(0) | ||
273 | | AT_XDMAC_CC_SIF(0) | ||
274 | | AT_XDMAC_CC_MBSIZE_SIXTEEN | ||
275 | | AT_XDMAC_CC_TYPE_MEM_TRAN; | ||
276 | @@ -1042,8 +1046,12 @@ at_xdmac_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src, | ||
277 | * access DDR through both ports (at least on SAMA5D4x), so we can use | ||
278 | * the same interface for source and dest, that solves the fact we | ||
279 | * don't know the direction. | ||
280 | + * ERRATA: Even if useless for memory transfers, the PERID has to not | ||
281 | + * match the one of another channel. If not, it could lead to spurious | ||
282 | + * flag status. | ||
283 | */ | ||
284 | - u32 chan_cc = AT_XDMAC_CC_DAM_INCREMENTED_AM | ||
285 | + u32 chan_cc = AT_XDMAC_CC_PERID(0x3f) | ||
286 | + | AT_XDMAC_CC_DAM_INCREMENTED_AM | ||
287 | | AT_XDMAC_CC_SAM_INCREMENTED_AM | ||
288 | | AT_XDMAC_CC_DIF(0) | ||
289 | | AT_XDMAC_CC_SIF(0) | ||
290 | @@ -1144,8 +1152,12 @@ static struct at_xdmac_desc *at_xdmac_memset_create_desc(struct dma_chan *chan, | ||
291 | * access. Hopefully we can access DDR through both ports (at least on | ||
292 | * SAMA5D4x), so we can use the same interface for source and dest, | ||
293 | * that solves the fact we don't know the direction. | ||
294 | + * ERRATA: Even if useless for memory transfers, the PERID has to not | ||
295 | + * match the one of another channel. If not, it could lead to spurious | ||
296 | + * flag status. | ||
297 | */ | ||
298 | - u32 chan_cc = AT_XDMAC_CC_DAM_UBS_AM | ||
299 | + u32 chan_cc = AT_XDMAC_CC_PERID(0x3f) | ||
300 | + | AT_XDMAC_CC_DAM_UBS_AM | ||
301 | | AT_XDMAC_CC_SAM_INCREMENTED_AM | ||
302 | | AT_XDMAC_CC_DIF(0) | ||
303 | | AT_XDMAC_CC_SIF(0) | ||
304 | diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c | ||
305 | index 3b92cad8bef2..1ea8532f5ab2 100644 | ||
306 | --- a/drivers/gpu/drm/i915/intel_hdmi.c | ||
307 | +++ b/drivers/gpu/drm/i915/intel_hdmi.c | ||
308 | @@ -1997,6 +1997,50 @@ intel_hdmi_add_properties(struct intel_hdmi *intel_hdmi, struct drm_connector *c | ||
309 | intel_hdmi->aspect_ratio = HDMI_PICTURE_ASPECT_NONE; | ||
310 | } | ||
311 | |||
312 | +static u8 intel_hdmi_ddc_pin(struct drm_i915_private *dev_priv, | ||
313 | + enum port port) | ||
314 | +{ | ||
315 | + const struct ddi_vbt_port_info *info = | ||
316 | + &dev_priv->vbt.ddi_port_info[port]; | ||
317 | + u8 ddc_pin; | ||
318 | + | ||
319 | + if (info->alternate_ddc_pin) { | ||
320 | + DRM_DEBUG_KMS("Using DDC pin 0x%x for port %c (VBT)\n", | ||
321 | + info->alternate_ddc_pin, port_name(port)); | ||
322 | + return info->alternate_ddc_pin; | ||
323 | + } | ||
324 | + | ||
325 | + switch (port) { | ||
326 | + case PORT_B: | ||
327 | + if (IS_BROXTON(dev_priv)) | ||
328 | + ddc_pin = GMBUS_PIN_1_BXT; | ||
329 | + else | ||
330 | + ddc_pin = GMBUS_PIN_DPB; | ||
331 | + break; | ||
332 | + case PORT_C: | ||
333 | + if (IS_BROXTON(dev_priv)) | ||
334 | + ddc_pin = GMBUS_PIN_2_BXT; | ||
335 | + else | ||
336 | + ddc_pin = GMBUS_PIN_DPC; | ||
337 | + break; | ||
338 | + case PORT_D: | ||
339 | + if (IS_CHERRYVIEW(dev_priv)) | ||
340 | + ddc_pin = GMBUS_PIN_DPD_CHV; | ||
341 | + else | ||
342 | + ddc_pin = GMBUS_PIN_DPD; | ||
343 | + break; | ||
344 | + default: | ||
345 | + MISSING_CASE(port); | ||
346 | + ddc_pin = GMBUS_PIN_DPB; | ||
347 | + break; | ||
348 | + } | ||
349 | + | ||
350 | + DRM_DEBUG_KMS("Using DDC pin 0x%x for port %c (platform default)\n", | ||
351 | + ddc_pin, port_name(port)); | ||
352 | + | ||
353 | + return ddc_pin; | ||
354 | +} | ||
355 | + | ||
356 | void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port, | ||
357 | struct intel_connector *intel_connector) | ||
358 | { | ||
359 | @@ -2006,7 +2050,6 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port, | ||
360 | struct drm_device *dev = intel_encoder->base.dev; | ||
361 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
362 | enum port port = intel_dig_port->port; | ||
363 | - uint8_t alternate_ddc_pin; | ||
364 | |||
365 | DRM_DEBUG_KMS("Adding HDMI connector on port %c\n", | ||
366 | port_name(port)); | ||
367 | @@ -2019,12 +2062,10 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port, | ||
368 | connector->doublescan_allowed = 0; | ||
369 | connector->stereo_allowed = 1; | ||
370 | |||
371 | + intel_hdmi->ddc_bus = intel_hdmi_ddc_pin(dev_priv, port); | ||
372 | + | ||
373 | switch (port) { | ||
374 | case PORT_B: | ||
375 | - if (IS_BROXTON(dev_priv)) | ||
376 | - intel_hdmi->ddc_bus = GMBUS_PIN_1_BXT; | ||
377 | - else | ||
378 | - intel_hdmi->ddc_bus = GMBUS_PIN_DPB; | ||
379 | /* | ||
380 | * On BXT A0/A1, sw needs to activate DDIA HPD logic and | ||
381 | * interrupts to check the external panel connection. | ||
382 | @@ -2035,46 +2076,17 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port, | ||
383 | intel_encoder->hpd_pin = HPD_PORT_B; | ||
384 | break; | ||
385 | case PORT_C: | ||
386 | - if (IS_BROXTON(dev_priv)) | ||
387 | - intel_hdmi->ddc_bus = GMBUS_PIN_2_BXT; | ||
388 | - else | ||
389 | - intel_hdmi->ddc_bus = GMBUS_PIN_DPC; | ||
390 | intel_encoder->hpd_pin = HPD_PORT_C; | ||
391 | break; | ||
392 | case PORT_D: | ||
393 | - if (WARN_ON(IS_BROXTON(dev_priv))) | ||
394 | - intel_hdmi->ddc_bus = GMBUS_PIN_DISABLED; | ||
395 | - else if (IS_CHERRYVIEW(dev_priv)) | ||
396 | - intel_hdmi->ddc_bus = GMBUS_PIN_DPD_CHV; | ||
397 | - else | ||
398 | - intel_hdmi->ddc_bus = GMBUS_PIN_DPD; | ||
399 | intel_encoder->hpd_pin = HPD_PORT_D; | ||
400 | break; | ||
401 | case PORT_E: | ||
402 | - /* On SKL PORT E doesn't have seperate GMBUS pin | ||
403 | - * We rely on VBT to set a proper alternate GMBUS pin. */ | ||
404 | - alternate_ddc_pin = | ||
405 | - dev_priv->vbt.ddi_port_info[PORT_E].alternate_ddc_pin; | ||
406 | - switch (alternate_ddc_pin) { | ||
407 | - case DDC_PIN_B: | ||
408 | - intel_hdmi->ddc_bus = GMBUS_PIN_DPB; | ||
409 | - break; | ||
410 | - case DDC_PIN_C: | ||
411 | - intel_hdmi->ddc_bus = GMBUS_PIN_DPC; | ||
412 | - break; | ||
413 | - case DDC_PIN_D: | ||
414 | - intel_hdmi->ddc_bus = GMBUS_PIN_DPD; | ||
415 | - break; | ||
416 | - default: | ||
417 | - MISSING_CASE(alternate_ddc_pin); | ||
418 | - } | ||
419 | intel_encoder->hpd_pin = HPD_PORT_E; | ||
420 | break; | ||
421 | - case PORT_A: | ||
422 | - intel_encoder->hpd_pin = HPD_PORT_A; | ||
423 | - /* Internal port only for eDP. */ | ||
424 | default: | ||
425 | - BUG(); | ||
426 | + MISSING_CASE(port); | ||
427 | + return; | ||
428 | } | ||
429 | |||
430 | if (IS_VALLEYVIEW(dev)) { | ||
431 | diff --git a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c | ||
432 | index dc33c1dd5191..b5beea53d6f6 100644 | ||
433 | --- a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c | ||
434 | +++ b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c | ||
435 | @@ -30,26 +30,26 @@ static struct { | ||
436 | u32 usage_id; | ||
437 | int unit; /* 0 for default others from HID sensor spec */ | ||
438 | int scale_val0; /* scale, whole number */ | ||
439 | - int scale_val1; /* scale, fraction in micros */ | ||
440 | + int scale_val1; /* scale, fraction in nanos */ | ||
441 | } unit_conversion[] = { | ||
442 | - {HID_USAGE_SENSOR_ACCEL_3D, 0, 9, 806650}, | ||
443 | + {HID_USAGE_SENSOR_ACCEL_3D, 0, 9, 806650000}, | ||
444 | {HID_USAGE_SENSOR_ACCEL_3D, | ||
445 | HID_USAGE_SENSOR_UNITS_METERS_PER_SEC_SQRD, 1, 0}, | ||
446 | {HID_USAGE_SENSOR_ACCEL_3D, | ||
447 | - HID_USAGE_SENSOR_UNITS_G, 9, 806650}, | ||
448 | + HID_USAGE_SENSOR_UNITS_G, 9, 806650000}, | ||
449 | |||
450 | - {HID_USAGE_SENSOR_GYRO_3D, 0, 0, 17453}, | ||
451 | + {HID_USAGE_SENSOR_GYRO_3D, 0, 0, 17453293}, | ||
452 | {HID_USAGE_SENSOR_GYRO_3D, | ||
453 | HID_USAGE_SENSOR_UNITS_RADIANS_PER_SECOND, 1, 0}, | ||
454 | {HID_USAGE_SENSOR_GYRO_3D, | ||
455 | - HID_USAGE_SENSOR_UNITS_DEGREES_PER_SECOND, 0, 17453}, | ||
456 | + HID_USAGE_SENSOR_UNITS_DEGREES_PER_SECOND, 0, 17453293}, | ||
457 | |||
458 | - {HID_USAGE_SENSOR_COMPASS_3D, 0, 0, 1000}, | ||
459 | + {HID_USAGE_SENSOR_COMPASS_3D, 0, 0, 1000000}, | ||
460 | {HID_USAGE_SENSOR_COMPASS_3D, HID_USAGE_SENSOR_UNITS_GAUSS, 1, 0}, | ||
461 | |||
462 | - {HID_USAGE_SENSOR_INCLINOMETER_3D, 0, 0, 17453}, | ||
463 | + {HID_USAGE_SENSOR_INCLINOMETER_3D, 0, 0, 17453293}, | ||
464 | {HID_USAGE_SENSOR_INCLINOMETER_3D, | ||
465 | - HID_USAGE_SENSOR_UNITS_DEGREES, 0, 17453}, | ||
466 | + HID_USAGE_SENSOR_UNITS_DEGREES, 0, 17453293}, | ||
467 | {HID_USAGE_SENSOR_INCLINOMETER_3D, | ||
468 | HID_USAGE_SENSOR_UNITS_RADIANS, 1, 0}, | ||
469 | |||
470 | @@ -57,7 +57,7 @@ static struct { | ||
471 | {HID_USAGE_SENSOR_ALS, HID_USAGE_SENSOR_UNITS_LUX, 1, 0}, | ||
472 | |||
473 | {HID_USAGE_SENSOR_PRESSURE, 0, 100, 0}, | ||
474 | - {HID_USAGE_SENSOR_PRESSURE, HID_USAGE_SENSOR_UNITS_PASCAL, 0, 1000}, | ||
475 | + {HID_USAGE_SENSOR_PRESSURE, HID_USAGE_SENSOR_UNITS_PASCAL, 0, 1000000}, | ||
476 | }; | ||
477 | |||
478 | static int pow_10(unsigned power) | ||
479 | @@ -266,15 +266,15 @@ EXPORT_SYMBOL(hid_sensor_write_raw_hyst_value); | ||
480 | /* | ||
481 | * This fuction applies the unit exponent to the scale. | ||
482 | * For example: | ||
483 | - * 9.806650 ->exp:2-> val0[980]val1[665000] | ||
484 | - * 9.000806 ->exp:2-> val0[900]val1[80600] | ||
485 | - * 0.174535 ->exp:2-> val0[17]val1[453500] | ||
486 | - * 1.001745 ->exp:0-> val0[1]val1[1745] | ||
487 | - * 1.001745 ->exp:2-> val0[100]val1[174500] | ||
488 | - * 1.001745 ->exp:4-> val0[10017]val1[450000] | ||
489 | - * 9.806650 ->exp:-2-> val0[0]val1[98066] | ||
490 | + * 9.806650000 ->exp:2-> val0[980]val1[665000000] | ||
491 | + * 9.000806000 ->exp:2-> val0[900]val1[80600000] | ||
492 | + * 0.174535293 ->exp:2-> val0[17]val1[453529300] | ||
493 | + * 1.001745329 ->exp:0-> val0[1]val1[1745329] | ||
494 | + * 1.001745329 ->exp:2-> val0[100]val1[174532900] | ||
495 | + * 1.001745329 ->exp:4-> val0[10017]val1[453290000] | ||
496 | + * 9.806650000 ->exp:-2-> val0[0]val1[98066500] | ||
497 | */ | ||
498 | -static void adjust_exponent_micro(int *val0, int *val1, int scale0, | ||
499 | +static void adjust_exponent_nano(int *val0, int *val1, int scale0, | ||
500 | int scale1, int exp) | ||
501 | { | ||
502 | int i; | ||
503 | @@ -285,32 +285,32 @@ static void adjust_exponent_micro(int *val0, int *val1, int scale0, | ||
504 | if (exp > 0) { | ||
505 | *val0 = scale0 * pow_10(exp); | ||
506 | res = 0; | ||
507 | - if (exp > 6) { | ||
508 | + if (exp > 9) { | ||
509 | *val1 = 0; | ||
510 | return; | ||
511 | } | ||
512 | for (i = 0; i < exp; ++i) { | ||
513 | - x = scale1 / pow_10(5 - i); | ||
514 | + x = scale1 / pow_10(8 - i); | ||
515 | res += (pow_10(exp - 1 - i) * x); | ||
516 | - scale1 = scale1 % pow_10(5 - i); | ||
517 | + scale1 = scale1 % pow_10(8 - i); | ||
518 | } | ||
519 | *val0 += res; | ||
520 | *val1 = scale1 * pow_10(exp); | ||
521 | } else if (exp < 0) { | ||
522 | exp = abs(exp); | ||
523 | - if (exp > 6) { | ||
524 | + if (exp > 9) { | ||
525 | *val0 = *val1 = 0; | ||
526 | return; | ||
527 | } | ||
528 | *val0 = scale0 / pow_10(exp); | ||
529 | rem = scale0 % pow_10(exp); | ||
530 | res = 0; | ||
531 | - for (i = 0; i < (6 - exp); ++i) { | ||
532 | - x = scale1 / pow_10(5 - i); | ||
533 | - res += (pow_10(5 - exp - i) * x); | ||
534 | - scale1 = scale1 % pow_10(5 - i); | ||
535 | + for (i = 0; i < (9 - exp); ++i) { | ||
536 | + x = scale1 / pow_10(8 - i); | ||
537 | + res += (pow_10(8 - exp - i) * x); | ||
538 | + scale1 = scale1 % pow_10(8 - i); | ||
539 | } | ||
540 | - *val1 = rem * pow_10(6 - exp) + res; | ||
541 | + *val1 = rem * pow_10(9 - exp) + res; | ||
542 | } else { | ||
543 | *val0 = scale0; | ||
544 | *val1 = scale1; | ||
545 | @@ -332,14 +332,14 @@ int hid_sensor_format_scale(u32 usage_id, | ||
546 | unit_conversion[i].unit == attr_info->units) { | ||
547 | exp = hid_sensor_convert_exponent( | ||
548 | attr_info->unit_expo); | ||
549 | - adjust_exponent_micro(val0, val1, | ||
550 | + adjust_exponent_nano(val0, val1, | ||
551 | unit_conversion[i].scale_val0, | ||
552 | unit_conversion[i].scale_val1, exp); | ||
553 | break; | ||
554 | } | ||
555 | } | ||
556 | |||
557 | - return IIO_VAL_INT_PLUS_MICRO; | ||
558 | + return IIO_VAL_INT_PLUS_NANO; | ||
559 | } | ||
560 | EXPORT_SYMBOL(hid_sensor_format_scale); | ||
561 | |||
562 | diff --git a/drivers/iio/orientation/hid-sensor-rotation.c b/drivers/iio/orientation/hid-sensor-rotation.c | ||
563 | index b98b9d94d184..a97e802ca523 100644 | ||
564 | --- a/drivers/iio/orientation/hid-sensor-rotation.c | ||
565 | +++ b/drivers/iio/orientation/hid-sensor-rotation.c | ||
566 | @@ -335,6 +335,7 @@ static struct platform_driver hid_dev_rot_platform_driver = { | ||
567 | .id_table = hid_dev_rot_ids, | ||
568 | .driver = { | ||
569 | .name = KBUILD_MODNAME, | ||
570 | + .pm = &hid_sensor_pm_ops, | ||
571 | }, | ||
572 | .probe = hid_dev_rot_probe, | ||
573 | .remove = hid_dev_rot_remove, | ||
574 | diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c | ||
575 | index 0397985a2601..5975d76ce755 100644 | ||
576 | --- a/drivers/iommu/amd_iommu.c | ||
577 | +++ b/drivers/iommu/amd_iommu.c | ||
578 | @@ -1833,6 +1833,9 @@ static void dma_ops_domain_free(struct dma_ops_domain *dom) | ||
579 | kfree(dom->aperture[i]); | ||
580 | } | ||
581 | |||
582 | + if (dom->domain.id) | ||
583 | + domain_id_free(dom->domain.id); | ||
584 | + | ||
585 | kfree(dom); | ||
586 | } | ||
587 | |||
588 | diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c | ||
589 | index b7f852d824a3..5baa830ce49f 100644 | ||
590 | --- a/drivers/iommu/intel-iommu.c | ||
591 | +++ b/drivers/iommu/intel-iommu.c | ||
592 | @@ -1672,6 +1672,7 @@ static void disable_dmar_iommu(struct intel_iommu *iommu) | ||
593 | if (!iommu->domains || !iommu->domain_ids) | ||
594 | return; | ||
595 | |||
596 | +again: | ||
597 | spin_lock_irqsave(&device_domain_lock, flags); | ||
598 | list_for_each_entry_safe(info, tmp, &device_domain_list, global) { | ||
599 | struct dmar_domain *domain; | ||
600 | @@ -1684,10 +1685,19 @@ static void disable_dmar_iommu(struct intel_iommu *iommu) | ||
601 | |||
602 | domain = info->domain; | ||
603 | |||
604 | - dmar_remove_one_dev_info(domain, info->dev); | ||
605 | + __dmar_remove_one_dev_info(info); | ||
606 | |||
607 | - if (!domain_type_is_vm_or_si(domain)) | ||
608 | + if (!domain_type_is_vm_or_si(domain)) { | ||
609 | + /* | ||
610 | + * The domain_exit() function can't be called under | ||
611 | + * device_domain_lock, as it takes this lock itself. | ||
612 | + * So release the lock here and re-run the loop | ||
613 | + * afterwards. | ||
614 | + */ | ||
615 | + spin_unlock_irqrestore(&device_domain_lock, flags); | ||
616 | domain_exit(domain); | ||
617 | + goto again; | ||
618 | + } | ||
619 | } | ||
620 | spin_unlock_irqrestore(&device_domain_lock, flags); | ||
621 | |||
622 | diff --git a/drivers/media/usb/dvb-usb/dib0700_core.c b/drivers/media/usb/dvb-usb/dib0700_core.c | ||
623 | index 0d248ce02a9b..ab58f0b9da5c 100644 | ||
624 | --- a/drivers/media/usb/dvb-usb/dib0700_core.c | ||
625 | +++ b/drivers/media/usb/dvb-usb/dib0700_core.c | ||
626 | @@ -677,7 +677,7 @@ static void dib0700_rc_urb_completion(struct urb *purb) | ||
627 | struct dvb_usb_device *d = purb->context; | ||
628 | struct dib0700_rc_response *poll_reply; | ||
629 | enum rc_type protocol; | ||
630 | - u32 uninitialized_var(keycode); | ||
631 | + u32 keycode; | ||
632 | u8 toggle; | ||
633 | |||
634 | deb_info("%s()\n", __func__); | ||
635 | @@ -719,7 +719,8 @@ static void dib0700_rc_urb_completion(struct urb *purb) | ||
636 | poll_reply->nec.data == 0x00 && | ||
637 | poll_reply->nec.not_data == 0xff) { | ||
638 | poll_reply->data_state = 2; | ||
639 | - break; | ||
640 | + rc_repeat(d->rc_dev); | ||
641 | + goto resubmit; | ||
642 | } | ||
643 | |||
644 | if ((poll_reply->nec.data ^ poll_reply->nec.not_data) != 0xff) { | ||
645 | diff --git a/drivers/misc/mei/bus-fixup.c b/drivers/misc/mei/bus-fixup.c | ||
646 | index 020de5919c21..bdc7fcd80eca 100644 | ||
647 | --- a/drivers/misc/mei/bus-fixup.c | ||
648 | +++ b/drivers/misc/mei/bus-fixup.c | ||
649 | @@ -151,7 +151,7 @@ static int mei_nfc_if_version(struct mei_cl *cl, | ||
650 | |||
651 | ret = 0; | ||
652 | bytes_recv = __mei_cl_recv(cl, (u8 *)reply, if_version_length); | ||
653 | - if (bytes_recv < 0 || bytes_recv < sizeof(struct mei_nfc_reply)) { | ||
654 | + if (bytes_recv < if_version_length) { | ||
655 | dev_err(bus->dev, "Could not read IF version\n"); | ||
656 | ret = -EIO; | ||
657 | goto err; | ||
658 | diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c | ||
659 | index d839147e591d..44ecebd1ea8c 100644 | ||
660 | --- a/drivers/mmc/host/mxs-mmc.c | ||
661 | +++ b/drivers/mmc/host/mxs-mmc.c | ||
662 | @@ -661,13 +661,13 @@ static int mxs_mmc_probe(struct platform_device *pdev) | ||
663 | |||
664 | platform_set_drvdata(pdev, mmc); | ||
665 | |||
666 | + spin_lock_init(&host->lock); | ||
667 | + | ||
668 | ret = devm_request_irq(&pdev->dev, irq_err, mxs_mmc_irq_handler, 0, | ||
669 | dev_name(&pdev->dev), host); | ||
670 | if (ret) | ||
671 | goto out_free_dma; | ||
672 | |||
673 | - spin_lock_init(&host->lock); | ||
674 | - | ||
675 | ret = mmc_add_host(mmc); | ||
676 | if (ret) | ||
677 | goto out_free_dma; | ||
678 | diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c | ||
679 | index 979cc024bca7..4edbab6ca7ef 100644 | ||
680 | --- a/drivers/net/ethernet/intel/i40e/i40e_main.c | ||
681 | +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c | ||
682 | @@ -8595,7 +8595,7 @@ static int i40e_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, | ||
683 | return 0; | ||
684 | |||
685 | return ndo_dflt_bridge_getlink(skb, pid, seq, dev, veb->bridge_mode, | ||
686 | - nlflags, 0, 0, filter_mask, NULL); | ||
687 | + 0, 0, nlflags, filter_mask, NULL); | ||
688 | } | ||
689 | |||
690 | #define I40E_MAX_TUNNEL_HDR_LEN 80 | ||
691 | diff --git a/drivers/nfc/mei_phy.c b/drivers/nfc/mei_phy.c | ||
692 | index 83deda4bb4d6..6f9563a96488 100644 | ||
693 | --- a/drivers/nfc/mei_phy.c | ||
694 | +++ b/drivers/nfc/mei_phy.c | ||
695 | @@ -133,7 +133,7 @@ static int mei_nfc_if_version(struct nfc_mei_phy *phy) | ||
696 | return -ENOMEM; | ||
697 | |||
698 | bytes_recv = mei_cldev_recv(phy->cldev, (u8 *)reply, if_version_length); | ||
699 | - if (bytes_recv < 0 || bytes_recv < sizeof(struct mei_nfc_reply)) { | ||
700 | + if (bytes_recv < 0 || bytes_recv < if_version_length) { | ||
701 | pr_err("Could not read IF version\n"); | ||
702 | r = -EIO; | ||
703 | goto err; | ||
704 | diff --git a/drivers/pinctrl/intel/pinctrl-cherryview.c b/drivers/pinctrl/intel/pinctrl-cherryview.c | ||
705 | index 4e377599d266..a009ae34c5ef 100644 | ||
706 | --- a/drivers/pinctrl/intel/pinctrl-cherryview.c | ||
707 | +++ b/drivers/pinctrl/intel/pinctrl-cherryview.c | ||
708 | @@ -1564,12 +1564,15 @@ static int chv_pinctrl_remove(struct platform_device *pdev) | ||
709 | } | ||
710 | |||
711 | #ifdef CONFIG_PM_SLEEP | ||
712 | -static int chv_pinctrl_suspend(struct device *dev) | ||
713 | +static int chv_pinctrl_suspend_noirq(struct device *dev) | ||
714 | { | ||
715 | struct platform_device *pdev = to_platform_device(dev); | ||
716 | struct chv_pinctrl *pctrl = platform_get_drvdata(pdev); | ||
717 | + unsigned long flags; | ||
718 | int i; | ||
719 | |||
720 | + raw_spin_lock_irqsave(&chv_lock, flags); | ||
721 | + | ||
722 | pctrl->saved_intmask = readl(pctrl->regs + CHV_INTMASK); | ||
723 | |||
724 | for (i = 0; i < pctrl->community->npins; i++) { | ||
725 | @@ -1590,15 +1593,20 @@ static int chv_pinctrl_suspend(struct device *dev) | ||
726 | ctx->padctrl1 = readl(reg); | ||
727 | } | ||
728 | |||
729 | + raw_spin_unlock_irqrestore(&chv_lock, flags); | ||
730 | + | ||
731 | return 0; | ||
732 | } | ||
733 | |||
734 | -static int chv_pinctrl_resume(struct device *dev) | ||
735 | +static int chv_pinctrl_resume_noirq(struct device *dev) | ||
736 | { | ||
737 | struct platform_device *pdev = to_platform_device(dev); | ||
738 | struct chv_pinctrl *pctrl = platform_get_drvdata(pdev); | ||
739 | + unsigned long flags; | ||
740 | int i; | ||
741 | |||
742 | + raw_spin_lock_irqsave(&chv_lock, flags); | ||
743 | + | ||
744 | /* | ||
745 | * Mask all interrupts before restoring per-pin configuration | ||
746 | * registers because we don't know in which state BIOS left them | ||
747 | @@ -1643,12 +1651,15 @@ static int chv_pinctrl_resume(struct device *dev) | ||
748 | chv_writel(0xffff, pctrl->regs + CHV_INTSTAT); | ||
749 | chv_writel(pctrl->saved_intmask, pctrl->regs + CHV_INTMASK); | ||
750 | |||
751 | + raw_spin_unlock_irqrestore(&chv_lock, flags); | ||
752 | + | ||
753 | return 0; | ||
754 | } | ||
755 | #endif | ||
756 | |||
757 | static const struct dev_pm_ops chv_pinctrl_pm_ops = { | ||
758 | - SET_LATE_SYSTEM_SLEEP_PM_OPS(chv_pinctrl_suspend, chv_pinctrl_resume) | ||
759 | + SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(chv_pinctrl_suspend_noirq, | ||
760 | + chv_pinctrl_resume_noirq) | ||
761 | }; | ||
762 | |||
763 | static const struct acpi_device_id chv_pinctrl_acpi_match[] = { | ||
764 | diff --git a/drivers/platform/x86/toshiba-wmi.c b/drivers/platform/x86/toshiba-wmi.c | ||
765 | index feac4576b837..2df07ee8f3c3 100644 | ||
766 | --- a/drivers/platform/x86/toshiba-wmi.c | ||
767 | +++ b/drivers/platform/x86/toshiba-wmi.c | ||
768 | @@ -24,14 +24,15 @@ | ||
769 | #include <linux/acpi.h> | ||
770 | #include <linux/input.h> | ||
771 | #include <linux/input/sparse-keymap.h> | ||
772 | +#include <linux/dmi.h> | ||
773 | |||
774 | MODULE_AUTHOR("Azael Avalos"); | ||
775 | MODULE_DESCRIPTION("Toshiba WMI Hotkey Driver"); | ||
776 | MODULE_LICENSE("GPL"); | ||
777 | |||
778 | -#define TOSHIBA_WMI_EVENT_GUID "59142400-C6A3-40FA-BADB-8A2652834100" | ||
779 | +#define WMI_EVENT_GUID "59142400-C6A3-40FA-BADB-8A2652834100" | ||
780 | |||
781 | -MODULE_ALIAS("wmi:"TOSHIBA_WMI_EVENT_GUID); | ||
782 | +MODULE_ALIAS("wmi:"WMI_EVENT_GUID); | ||
783 | |||
784 | static struct input_dev *toshiba_wmi_input_dev; | ||
785 | |||
786 | @@ -63,6 +64,16 @@ static void toshiba_wmi_notify(u32 value, void *context) | ||
787 | kfree(response.pointer); | ||
788 | } | ||
789 | |||
790 | +static struct dmi_system_id toshiba_wmi_dmi_table[] __initdata = { | ||
791 | + { | ||
792 | + .ident = "Toshiba laptop", | ||
793 | + .matches = { | ||
794 | + DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), | ||
795 | + }, | ||
796 | + }, | ||
797 | + {} | ||
798 | +}; | ||
799 | + | ||
800 | static int __init toshiba_wmi_input_setup(void) | ||
801 | { | ||
802 | acpi_status status; | ||
803 | @@ -81,7 +92,7 @@ static int __init toshiba_wmi_input_setup(void) | ||
804 | if (err) | ||
805 | goto err_free_dev; | ||
806 | |||
807 | - status = wmi_install_notify_handler(TOSHIBA_WMI_EVENT_GUID, | ||
808 | + status = wmi_install_notify_handler(WMI_EVENT_GUID, | ||
809 | toshiba_wmi_notify, NULL); | ||
810 | if (ACPI_FAILURE(status)) { | ||
811 | err = -EIO; | ||
812 | @@ -95,7 +106,7 @@ static int __init toshiba_wmi_input_setup(void) | ||
813 | return 0; | ||
814 | |||
815 | err_remove_notifier: | ||
816 | - wmi_remove_notify_handler(TOSHIBA_WMI_EVENT_GUID); | ||
817 | + wmi_remove_notify_handler(WMI_EVENT_GUID); | ||
818 | err_free_keymap: | ||
819 | sparse_keymap_free(toshiba_wmi_input_dev); | ||
820 | err_free_dev: | ||
821 | @@ -105,7 +116,7 @@ static int __init toshiba_wmi_input_setup(void) | ||
822 | |||
823 | static void toshiba_wmi_input_destroy(void) | ||
824 | { | ||
825 | - wmi_remove_notify_handler(TOSHIBA_WMI_EVENT_GUID); | ||
826 | + wmi_remove_notify_handler(WMI_EVENT_GUID); | ||
827 | sparse_keymap_free(toshiba_wmi_input_dev); | ||
828 | input_unregister_device(toshiba_wmi_input_dev); | ||
829 | } | ||
830 | @@ -114,7 +125,8 @@ static int __init toshiba_wmi_init(void) | ||
831 | { | ||
832 | int ret; | ||
833 | |||
834 | - if (!wmi_has_guid(TOSHIBA_WMI_EVENT_GUID)) | ||
835 | + if (!wmi_has_guid(WMI_EVENT_GUID) || | ||
836 | + !dmi_check_system(toshiba_wmi_dmi_table)) | ||
837 | return -ENODEV; | ||
838 | |||
839 | ret = toshiba_wmi_input_setup(); | ||
840 | @@ -130,7 +142,7 @@ static int __init toshiba_wmi_init(void) | ||
841 | |||
842 | static void __exit toshiba_wmi_exit(void) | ||
843 | { | ||
844 | - if (wmi_has_guid(TOSHIBA_WMI_EVENT_GUID)) | ||
845 | + if (wmi_has_guid(WMI_EVENT_GUID)) | ||
846 | toshiba_wmi_input_destroy(); | ||
847 | } | ||
848 | |||
849 | diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c | ||
850 | index 0969cea1089a..2d867c5bfd9f 100644 | ||
851 | --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c | ||
852 | +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c | ||
853 | @@ -1275,9 +1275,9 @@ scsih_target_alloc(struct scsi_target *starget) | ||
854 | sas_target_priv_data->handle = raid_device->handle; | ||
855 | sas_target_priv_data->sas_address = raid_device->wwid; | ||
856 | sas_target_priv_data->flags |= MPT_TARGET_FLAGS_VOLUME; | ||
857 | - sas_target_priv_data->raid_device = raid_device; | ||
858 | if (ioc->is_warpdrive) | ||
859 | - raid_device->starget = starget; | ||
860 | + sas_target_priv_data->raid_device = raid_device; | ||
861 | + raid_device->starget = starget; | ||
862 | } | ||
863 | spin_unlock_irqrestore(&ioc->raid_device_lock, flags); | ||
864 | return 0; | ||
865 | diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c | ||
866 | index fc6674db4f2d..c44cbf46221c 100644 | ||
867 | --- a/drivers/scsi/qla2xxx/qla_os.c | ||
868 | +++ b/drivers/scsi/qla2xxx/qla_os.c | ||
869 | @@ -2257,6 +2257,8 @@ qla2xxx_scan_finished(struct Scsi_Host *shost, unsigned long time) | ||
870 | { | ||
871 | scsi_qla_host_t *vha = shost_priv(shost); | ||
872 | |||
873 | + if (test_bit(UNLOADING, &vha->dpc_flags)) | ||
874 | + return 1; | ||
875 | if (!vha->host) | ||
876 | return 1; | ||
877 | if (time > vha->hw->loop_reset_delay * HZ) | ||
878 | diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c b/drivers/staging/iio/impedance-analyzer/ad5933.c | ||
879 | index 10c43dda0f5a..196da09e20a1 100644 | ||
880 | --- a/drivers/staging/iio/impedance-analyzer/ad5933.c | ||
881 | +++ b/drivers/staging/iio/impedance-analyzer/ad5933.c | ||
882 | @@ -647,6 +647,7 @@ static void ad5933_work(struct work_struct *work) | ||
883 | __be16 buf[2]; | ||
884 | int val[2]; | ||
885 | unsigned char status; | ||
886 | + int ret; | ||
887 | |||
888 | mutex_lock(&indio_dev->mlock); | ||
889 | if (st->state == AD5933_CTRL_INIT_START_FREQ) { | ||
890 | @@ -654,19 +655,22 @@ static void ad5933_work(struct work_struct *work) | ||
891 | ad5933_cmd(st, AD5933_CTRL_START_SWEEP); | ||
892 | st->state = AD5933_CTRL_START_SWEEP; | ||
893 | schedule_delayed_work(&st->work, st->poll_time_jiffies); | ||
894 | - mutex_unlock(&indio_dev->mlock); | ||
895 | - return; | ||
896 | + goto out; | ||
897 | } | ||
898 | |||
899 | - ad5933_i2c_read(st->client, AD5933_REG_STATUS, 1, &status); | ||
900 | + ret = ad5933_i2c_read(st->client, AD5933_REG_STATUS, 1, &status); | ||
901 | + if (ret) | ||
902 | + goto out; | ||
903 | |||
904 | if (status & AD5933_STAT_DATA_VALID) { | ||
905 | int scan_count = bitmap_weight(indio_dev->active_scan_mask, | ||
906 | indio_dev->masklength); | ||
907 | - ad5933_i2c_read(st->client, | ||
908 | + ret = ad5933_i2c_read(st->client, | ||
909 | test_bit(1, indio_dev->active_scan_mask) ? | ||
910 | AD5933_REG_REAL_DATA : AD5933_REG_IMAG_DATA, | ||
911 | scan_count * 2, (u8 *)buf); | ||
912 | + if (ret) | ||
913 | + goto out; | ||
914 | |||
915 | if (scan_count == 2) { | ||
916 | val[0] = be16_to_cpu(buf[0]); | ||
917 | @@ -678,8 +682,7 @@ static void ad5933_work(struct work_struct *work) | ||
918 | } else { | ||
919 | /* no data available - try again later */ | ||
920 | schedule_delayed_work(&st->work, st->poll_time_jiffies); | ||
921 | - mutex_unlock(&indio_dev->mlock); | ||
922 | - return; | ||
923 | + goto out; | ||
924 | } | ||
925 | |||
926 | if (status & AD5933_STAT_SWEEP_DONE) { | ||
927 | @@ -691,7 +694,7 @@ static void ad5933_work(struct work_struct *work) | ||
928 | ad5933_cmd(st, AD5933_CTRL_INC_FREQ); | ||
929 | schedule_delayed_work(&st->work, st->poll_time_jiffies); | ||
930 | } | ||
931 | - | ||
932 | +out: | ||
933 | mutex_unlock(&indio_dev->mlock); | ||
934 | } | ||
935 | |||
936 | diff --git a/drivers/staging/nvec/nvec_ps2.c b/drivers/staging/nvec/nvec_ps2.c | ||
937 | index 0922dd3a08d3..196f6b0a288f 100644 | ||
938 | --- a/drivers/staging/nvec/nvec_ps2.c | ||
939 | +++ b/drivers/staging/nvec/nvec_ps2.c | ||
940 | @@ -106,13 +106,12 @@ static int nvec_mouse_probe(struct platform_device *pdev) | ||
941 | { | ||
942 | struct nvec_chip *nvec = dev_get_drvdata(pdev->dev.parent); | ||
943 | struct serio *ser_dev; | ||
944 | - char mouse_reset[] = { NVEC_PS2, SEND_COMMAND, PSMOUSE_RST, 3 }; | ||
945 | |||
946 | - ser_dev = devm_kzalloc(&pdev->dev, sizeof(struct serio), GFP_KERNEL); | ||
947 | + ser_dev = kzalloc(sizeof(struct serio), GFP_KERNEL); | ||
948 | if (!ser_dev) | ||
949 | return -ENOMEM; | ||
950 | |||
951 | - ser_dev->id.type = SERIO_PS_PSTHRU; | ||
952 | + ser_dev->id.type = SERIO_8042; | ||
953 | ser_dev->write = ps2_sendcommand; | ||
954 | ser_dev->start = ps2_startstreaming; | ||
955 | ser_dev->stop = ps2_stopstreaming; | ||
956 | @@ -127,9 +126,6 @@ static int nvec_mouse_probe(struct platform_device *pdev) | ||
957 | |||
958 | serio_register_port(ser_dev); | ||
959 | |||
960 | - /* mouse reset */ | ||
961 | - nvec_write_async(nvec, mouse_reset, sizeof(mouse_reset)); | ||
962 | - | ||
963 | return 0; | ||
964 | } | ||
965 | |||
966 | diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c | ||
967 | index 7b5462eb8388..e0b89b961e1b 100644 | ||
968 | --- a/drivers/tty/serial/atmel_serial.c | ||
969 | +++ b/drivers/tty/serial/atmel_serial.c | ||
970 | @@ -2075,6 +2075,7 @@ static void atmel_serial_pm(struct uart_port *port, unsigned int state, | ||
971 | static void atmel_set_termios(struct uart_port *port, struct ktermios *termios, | ||
972 | struct ktermios *old) | ||
973 | { | ||
974 | + struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); | ||
975 | unsigned long flags; | ||
976 | unsigned int old_mode, mode, imr, quot, baud; | ||
977 | |||
978 | @@ -2178,11 +2179,29 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios, | ||
979 | mode |= ATMEL_US_USMODE_RS485; | ||
980 | } else if (termios->c_cflag & CRTSCTS) { | ||
981 | /* RS232 with hardware handshake (RTS/CTS) */ | ||
982 | - if (atmel_use_dma_rx(port) && !atmel_use_fifo(port)) { | ||
983 | - dev_info(port->dev, "not enabling hardware flow control because DMA is used"); | ||
984 | - termios->c_cflag &= ~CRTSCTS; | ||
985 | - } else { | ||
986 | + if (atmel_use_fifo(port) && | ||
987 | + !mctrl_gpio_to_gpiod(atmel_port->gpios, UART_GPIO_CTS)) { | ||
988 | + /* | ||
989 | + * with ATMEL_US_USMODE_HWHS set, the controller will | ||
990 | + * be able to drive the RTS pin high/low when the RX | ||
991 | + * FIFO is above RXFTHRES/below RXFTHRES2. | ||
992 | + * It will also disable the transmitter when the CTS | ||
993 | + * pin is high. | ||
994 | + * This mode is not activated if CTS pin is a GPIO | ||
995 | + * because in this case, the transmitter is always | ||
996 | + * disabled (there must be an internal pull-up | ||
997 | + * responsible for this behaviour). | ||
998 | + * If the RTS pin is a GPIO, the controller won't be | ||
999 | + * able to drive it according to the FIFO thresholds, | ||
1000 | + * but it will be handled by the driver. | ||
1001 | + */ | ||
1002 | mode |= ATMEL_US_USMODE_HWHS; | ||
1003 | + } else { | ||
1004 | + /* | ||
1005 | + * For platforms without FIFO, the flow control is | ||
1006 | + * handled by the driver. | ||
1007 | + */ | ||
1008 | + mode |= ATMEL_US_USMODE_NORMAL; | ||
1009 | } | ||
1010 | } else { | ||
1011 | /* RS232 without hadware handshake */ | ||
1012 | diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c | ||
1013 | index 7f374369e539..4d77745f439f 100644 | ||
1014 | --- a/drivers/usb/class/cdc-acm.c | ||
1015 | +++ b/drivers/usb/class/cdc-acm.c | ||
1016 | @@ -877,8 +877,6 @@ static int wait_serial_change(struct acm *acm, unsigned long arg) | ||
1017 | DECLARE_WAITQUEUE(wait, current); | ||
1018 | struct async_icount old, new; | ||
1019 | |||
1020 | - if (arg & (TIOCM_DSR | TIOCM_RI | TIOCM_CD )) | ||
1021 | - return -EINVAL; | ||
1022 | do { | ||
1023 | spin_lock_irq(&acm->read_lock); | ||
1024 | old = acm->oldcount; | ||
1025 | diff --git a/drivers/usb/gadget/function/u_ether.c b/drivers/usb/gadget/function/u_ether.c | ||
1026 | index b644248f4b8e..7413f89660f7 100644 | ||
1027 | --- a/drivers/usb/gadget/function/u_ether.c | ||
1028 | +++ b/drivers/usb/gadget/function/u_ether.c | ||
1029 | @@ -594,14 +594,6 @@ static netdev_tx_t eth_start_xmit(struct sk_buff *skb, | ||
1030 | |||
1031 | req->length = length; | ||
1032 | |||
1033 | - /* throttle high/super speed IRQ rate back slightly */ | ||
1034 | - if (gadget_is_dualspeed(dev->gadget)) | ||
1035 | - req->no_interrupt = (((dev->gadget->speed == USB_SPEED_HIGH || | ||
1036 | - dev->gadget->speed == USB_SPEED_SUPER)) && | ||
1037 | - !list_empty(&dev->tx_reqs)) | ||
1038 | - ? ((atomic_read(&dev->tx_qlen) % dev->qmult) != 0) | ||
1039 | - : 0; | ||
1040 | - | ||
1041 | retval = usb_ep_queue(in, req, GFP_ATOMIC); | ||
1042 | switch (retval) { | ||
1043 | default: | ||
1044 | diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c | ||
1045 | index 4bc9dbf29a73..3cff6523f27d 100644 | ||
1046 | --- a/fs/btrfs/inode.c | ||
1047 | +++ b/fs/btrfs/inode.c | ||
1048 | @@ -8691,9 +8691,14 @@ static void btrfs_invalidatepage(struct page *page, unsigned int offset, | ||
1049 | * So even we call qgroup_free_data(), it won't decrease reserved | ||
1050 | * space. | ||
1051 | * 2) Not written to disk | ||
1052 | - * This means the reserved space should be freed here. | ||
1053 | + * This means the reserved space should be freed here. However, | ||
1054 | + * if a truncate invalidates the page (by clearing PageDirty) | ||
1055 | + * and the page is accounted for while allocating extent | ||
1056 | + * in btrfs_check_data_free_space() we let delayed_ref to | ||
1057 | + * free the entire extent. | ||
1058 | */ | ||
1059 | - btrfs_qgroup_free_data(inode, page_start, PAGE_CACHE_SIZE); | ||
1060 | + if (PageDirty(page)) | ||
1061 | + btrfs_qgroup_free_data(inode, page_start, PAGE_SIZE); | ||
1062 | if (!inode_evicting) { | ||
1063 | clear_extent_bit(tree, page_start, page_end, | ||
1064 | EXTENT_LOCKED | EXTENT_DIRTY | | ||
1065 | diff --git a/fs/coredump.c b/fs/coredump.c | ||
1066 | index dfc87c5f5a54..5d15c4975ba1 100644 | ||
1067 | --- a/fs/coredump.c | ||
1068 | +++ b/fs/coredump.c | ||
1069 | @@ -1,6 +1,7 @@ | ||
1070 | #include <linux/slab.h> | ||
1071 | #include <linux/file.h> | ||
1072 | #include <linux/fdtable.h> | ||
1073 | +#include <linux/freezer.h> | ||
1074 | #include <linux/mm.h> | ||
1075 | #include <linux/stat.h> | ||
1076 | #include <linux/fcntl.h> | ||
1077 | @@ -399,7 +400,9 @@ static int coredump_wait(int exit_code, struct core_state *core_state) | ||
1078 | if (core_waiters > 0) { | ||
1079 | struct core_thread *ptr; | ||
1080 | |||
1081 | + freezer_do_not_count(); | ||
1082 | wait_for_completion(&core_state->startup); | ||
1083 | + freezer_count(); | ||
1084 | /* | ||
1085 | * Wait for all the threads to become inactive, so that | ||
1086 | * all the thread context (extended register state, like | ||
1087 | diff --git a/lib/genalloc.c b/lib/genalloc.c | ||
1088 | index 116a166b096f..27aa9c629d13 100644 | ||
1089 | --- a/lib/genalloc.c | ||
1090 | +++ b/lib/genalloc.c | ||
1091 | @@ -273,7 +273,7 @@ unsigned long gen_pool_alloc(struct gen_pool *pool, size_t size) | ||
1092 | struct gen_pool_chunk *chunk; | ||
1093 | unsigned long addr = 0; | ||
1094 | int order = pool->min_alloc_order; | ||
1095 | - int nbits, start_bit = 0, end_bit, remain; | ||
1096 | + int nbits, start_bit, end_bit, remain; | ||
1097 | |||
1098 | #ifndef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG | ||
1099 | BUG_ON(in_nmi()); | ||
1100 | @@ -288,6 +288,7 @@ unsigned long gen_pool_alloc(struct gen_pool *pool, size_t size) | ||
1101 | if (size > atomic_read(&chunk->avail)) | ||
1102 | continue; | ||
1103 | |||
1104 | + start_bit = 0; | ||
1105 | end_bit = chunk_size(chunk) >> order; | ||
1106 | retry: | ||
1107 | start_bit = pool->algo(chunk->bits, end_bit, start_bit, nbits, | ||
1108 | diff --git a/mm/swapfile.c b/mm/swapfile.c | ||
1109 | index 58877312cf6b..c1a0f3dea8b5 100644 | ||
1110 | --- a/mm/swapfile.c | ||
1111 | +++ b/mm/swapfile.c | ||
1112 | @@ -2225,6 +2225,8 @@ static unsigned long read_swap_header(struct swap_info_struct *p, | ||
1113 | swab32s(&swap_header->info.version); | ||
1114 | swab32s(&swap_header->info.last_page); | ||
1115 | swab32s(&swap_header->info.nr_badpages); | ||
1116 | + if (swap_header->info.nr_badpages > MAX_SWAP_BADPAGES) | ||
1117 | + return 0; | ||
1118 | for (i = 0; i < swap_header->info.nr_badpages; i++) | ||
1119 | swab32s(&swap_header->info.badpages[i]); | ||
1120 | } | ||
1121 | diff --git a/net/netfilter/nf_log.c b/net/netfilter/nf_log.c | ||
1122 | index a5d41dfa9f05..2c89f90cd7bc 100644 | ||
1123 | --- a/net/netfilter/nf_log.c | ||
1124 | +++ b/net/netfilter/nf_log.c | ||
1125 | @@ -401,7 +401,7 @@ static int nf_log_proc_dostring(struct ctl_table *table, int write, | ||
1126 | size_t size = *lenp; | ||
1127 | int r = 0; | ||
1128 | int tindex = (unsigned long)table->extra1; | ||
1129 | - struct net *net = current->nsproxy->net_ns; | ||
1130 | + struct net *net = table->extra2; | ||
1131 | |||
1132 | if (write) { | ||
1133 | if (size > sizeof(buf)) | ||
1134 | @@ -453,7 +453,6 @@ static int netfilter_log_sysctl_init(struct net *net) | ||
1135 | 3, "%d", i); | ||
1136 | nf_log_sysctl_table[i].procname = | ||
1137 | nf_log_sysctl_fnames[i]; | ||
1138 | - nf_log_sysctl_table[i].data = NULL; | ||
1139 | nf_log_sysctl_table[i].maxlen = NFLOGGER_NAME_LEN; | ||
1140 | nf_log_sysctl_table[i].mode = 0644; | ||
1141 | nf_log_sysctl_table[i].proc_handler = | ||
1142 | @@ -463,6 +462,9 @@ static int netfilter_log_sysctl_init(struct net *net) | ||
1143 | } | ||
1144 | } | ||
1145 | |||
1146 | + for (i = NFPROTO_UNSPEC; i < NFPROTO_NUMPROTO; i++) | ||
1147 | + table[i].extra2 = net; | ||
1148 | + | ||
1149 | net->nf.nf_log_dir_header = register_net_sysctl(net, | ||
1150 | "net/netfilter/nf_log", | ||
1151 | table); | ||
1152 | diff --git a/sound/core/info.c b/sound/core/info.c | ||
1153 | index 895362a696c9..8ab72e0f5932 100644 | ||
1154 | --- a/sound/core/info.c | ||
1155 | +++ b/sound/core/info.c | ||
1156 | @@ -325,10 +325,15 @@ static ssize_t snd_info_text_entry_write(struct file *file, | ||
1157 | size_t next; | ||
1158 | int err = 0; | ||
1159 | |||
1160 | + if (!entry->c.text.write) | ||
1161 | + return -EIO; | ||
1162 | pos = *offset; | ||
1163 | if (!valid_pos(pos, count)) | ||
1164 | return -EIO; | ||
1165 | next = pos + count; | ||
1166 | + /* don't handle too large text inputs */ | ||
1167 | + if (next > 16 * 1024) | ||
1168 | + return -EIO; | ||
1169 | mutex_lock(&entry->access); | ||
1170 | buf = data->wbuffer; | ||
1171 | if (!buf) { | ||
1172 | @@ -366,7 +371,9 @@ static int snd_info_seq_show(struct seq_file *seq, void *p) | ||
1173 | struct snd_info_private_data *data = seq->private; | ||
1174 | struct snd_info_entry *entry = data->entry; | ||
1175 | |||
1176 | - if (entry->c.text.read) { | ||
1177 | + if (!entry->c.text.read) { | ||
1178 | + return -EIO; | ||
1179 | + } else { | ||
1180 | data->rbuffer->buffer = (char *)seq; /* XXX hack! */ | ||
1181 | entry->c.text.read(entry, data->rbuffer); | ||
1182 | } | ||
1183 | diff --git a/sound/soc/codecs/cs4270.c b/sound/soc/codecs/cs4270.c | ||
1184 | index e07807d96b68..3670086b9227 100644 | ||
1185 | --- a/sound/soc/codecs/cs4270.c | ||
1186 | +++ b/sound/soc/codecs/cs4270.c | ||
1187 | @@ -148,11 +148,11 @@ SND_SOC_DAPM_OUTPUT("AOUTR"), | ||
1188 | }; | ||
1189 | |||
1190 | static const struct snd_soc_dapm_route cs4270_dapm_routes[] = { | ||
1191 | - { "Capture", NULL, "AINA" }, | ||
1192 | - { "Capture", NULL, "AINB" }, | ||
1193 | + { "Capture", NULL, "AINL" }, | ||
1194 | + { "Capture", NULL, "AINR" }, | ||
1195 | |||
1196 | - { "AOUTA", NULL, "Playback" }, | ||
1197 | - { "AOUTB", NULL, "Playback" }, | ||
1198 | + { "AOUTL", NULL, "Playback" }, | ||
1199 | + { "AOUTR", NULL, "Playback" }, | ||
1200 | }; | ||
1201 | |||
1202 | /** | ||
1203 | diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c | ||
1204 | index 1bb896d78d09..1a4999f9d56f 100644 | ||
1205 | --- a/sound/soc/sunxi/sun4i-codec.c | ||
1206 | +++ b/sound/soc/sunxi/sun4i-codec.c | ||
1207 | @@ -575,11 +575,11 @@ static struct snd_soc_card *sun4i_codec_create_card(struct device *dev) | ||
1208 | |||
1209 | card = devm_kzalloc(dev, sizeof(*card), GFP_KERNEL); | ||
1210 | if (!card) | ||
1211 | - return NULL; | ||
1212 | + return ERR_PTR(-ENOMEM); | ||
1213 | |||
1214 | card->dai_link = sun4i_codec_create_link(dev, &card->num_links); | ||
1215 | if (!card->dai_link) | ||
1216 | - return NULL; | ||
1217 | + return ERR_PTR(-ENOMEM); | ||
1218 | |||
1219 | card->dev = dev; | ||
1220 | card->name = "sun4i-codec"; | ||
1221 | @@ -661,7 +661,8 @@ static int sun4i_codec_probe(struct platform_device *pdev) | ||
1222 | } | ||
1223 | |||
1224 | card = sun4i_codec_create_card(&pdev->dev); | ||
1225 | - if (!card) { | ||
1226 | + if (IS_ERR(card)) { | ||
1227 | + ret = PTR_ERR(card); | ||
1228 | dev_err(&pdev->dev, "Failed to create our card\n"); | ||
1229 | goto err_unregister_codec; | ||
1230 | } |