1 |
commit: 20af2c7b1257a8ca9ded828903a66b1bdee515c5 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Mar 27 10:20:15 2019 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Mar 27 10:20:15 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=20af2c7b |
7 |
|
8 |
Linux patch 4.9.166 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1165_linux-4.9.166.patch | 782 +++++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 786 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index edabd75..64cbb0c 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -703,6 +703,10 @@ Patch: 1164_linux-4.9.165.patch |
21 |
From: http://www.kernel.org |
22 |
Desc: Linux 4.9.165 |
23 |
|
24 |
+Patch: 1165_linux-4.9.166.patch |
25 |
+From: http://www.kernel.org |
26 |
+Desc: Linux 4.9.166 |
27 |
+ |
28 |
Patch: 1500_XATTR_USER_PREFIX.patch |
29 |
From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
30 |
Desc: Support for namespace user.pax.* on tmpfs. |
31 |
|
32 |
diff --git a/1165_linux-4.9.166.patch b/1165_linux-4.9.166.patch |
33 |
new file mode 100644 |
34 |
index 0000000..6c80dec |
35 |
--- /dev/null |
36 |
+++ b/1165_linux-4.9.166.patch |
37 |
@@ -0,0 +1,782 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index 9b61da532c42..90478086eff5 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,6 +1,6 @@ |
43 |
+ VERSION = 4 |
44 |
+ PATCHLEVEL = 9 |
45 |
+-SUBLEVEL = 165 |
46 |
++SUBLEVEL = 166 |
47 |
+ EXTRAVERSION = |
48 |
+ NAME = Roaring Lionus |
49 |
+ |
50 |
+diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c |
51 |
+index 5963be2e05f0..28bef94cf792 100644 |
52 |
+--- a/arch/arm64/kernel/traps.c |
53 |
++++ b/arch/arm64/kernel/traps.c |
54 |
+@@ -266,10 +266,12 @@ void die(const char *str, struct pt_regs *regs, int err) |
55 |
+ { |
56 |
+ struct thread_info *thread = current_thread_info(); |
57 |
+ int ret; |
58 |
++ unsigned long flags; |
59 |
++ |
60 |
++ raw_spin_lock_irqsave(&die_lock, flags); |
61 |
+ |
62 |
+ oops_enter(); |
63 |
+ |
64 |
+- raw_spin_lock_irq(&die_lock); |
65 |
+ console_verbose(); |
66 |
+ bust_spinlocks(1); |
67 |
+ ret = __die(str, err, thread, regs); |
68 |
+@@ -279,13 +281,15 @@ void die(const char *str, struct pt_regs *regs, int err) |
69 |
+ |
70 |
+ bust_spinlocks(0); |
71 |
+ add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE); |
72 |
+- raw_spin_unlock_irq(&die_lock); |
73 |
+ oops_exit(); |
74 |
+ |
75 |
+ if (in_interrupt()) |
76 |
+ panic("Fatal exception in interrupt"); |
77 |
+ if (panic_on_oops) |
78 |
+ panic("Fatal exception"); |
79 |
++ |
80 |
++ raw_spin_unlock_irqrestore(&die_lock, flags); |
81 |
++ |
82 |
+ if (ret != NOTIFY_STOP) |
83 |
+ do_exit(SIGSEGV); |
84 |
+ } |
85 |
+diff --git a/arch/mips/include/asm/jump_label.h b/arch/mips/include/asm/jump_label.h |
86 |
+index e77672539e8e..e4456e450f94 100644 |
87 |
+--- a/arch/mips/include/asm/jump_label.h |
88 |
++++ b/arch/mips/include/asm/jump_label.h |
89 |
+@@ -21,15 +21,15 @@ |
90 |
+ #endif |
91 |
+ |
92 |
+ #ifdef CONFIG_CPU_MICROMIPS |
93 |
+-#define NOP_INSN "nop32" |
94 |
++#define B_INSN "b32" |
95 |
+ #else |
96 |
+-#define NOP_INSN "nop" |
97 |
++#define B_INSN "b" |
98 |
+ #endif |
99 |
+ |
100 |
+ static __always_inline bool arch_static_branch(struct static_key *key, bool branch) |
101 |
+ { |
102 |
+- asm_volatile_goto("1:\t" NOP_INSN "\n\t" |
103 |
+- "nop\n\t" |
104 |
++ asm_volatile_goto("1:\t" B_INSN " 2f\n\t" |
105 |
++ "2:\tnop\n\t" |
106 |
+ ".pushsection __jump_table, \"aw\"\n\t" |
107 |
+ WORD_INSN " 1b, %l[l_yes], %0\n\t" |
108 |
+ ".popsection\n\t" |
109 |
+diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S |
110 |
+index f0a0e6d62be3..2d965d91fee4 100644 |
111 |
+--- a/arch/mips/kernel/vmlinux.lds.S |
112 |
++++ b/arch/mips/kernel/vmlinux.lds.S |
113 |
+@@ -138,6 +138,13 @@ SECTIONS |
114 |
+ PERCPU_SECTION(1 << CONFIG_MIPS_L1_CACHE_SHIFT) |
115 |
+ #endif |
116 |
+ |
117 |
++#ifdef CONFIG_MIPS_ELF_APPENDED_DTB |
118 |
++ .appended_dtb : AT(ADDR(.appended_dtb) - LOAD_OFFSET) { |
119 |
++ *(.appended_dtb) |
120 |
++ KEEP(*(.appended_dtb)) |
121 |
++ } |
122 |
++#endif |
123 |
++ |
124 |
+ #ifdef CONFIG_RELOCATABLE |
125 |
+ . = ALIGN(4); |
126 |
+ |
127 |
+@@ -162,11 +169,6 @@ SECTIONS |
128 |
+ __appended_dtb = .; |
129 |
+ /* leave space for appended DTB */ |
130 |
+ . += 0x100000; |
131 |
+-#elif defined(CONFIG_MIPS_ELF_APPENDED_DTB) |
132 |
+- .appended_dtb : AT(ADDR(.appended_dtb) - LOAD_OFFSET) { |
133 |
+- *(.appended_dtb) |
134 |
+- KEEP(*(.appended_dtb)) |
135 |
+- } |
136 |
+ #endif |
137 |
+ /* |
138 |
+ * Align to 64K in attempt to eliminate holes before the |
139 |
+diff --git a/arch/mips/loongson64/lemote-2f/irq.c b/arch/mips/loongson64/lemote-2f/irq.c |
140 |
+index cab5f43e0e29..d371f0294cbb 100644 |
141 |
+--- a/arch/mips/loongson64/lemote-2f/irq.c |
142 |
++++ b/arch/mips/loongson64/lemote-2f/irq.c |
143 |
+@@ -102,7 +102,7 @@ static struct irqaction ip6_irqaction = { |
144 |
+ static struct irqaction cascade_irqaction = { |
145 |
+ .handler = no_action, |
146 |
+ .name = "cascade", |
147 |
+- .flags = IRQF_NO_THREAD, |
148 |
++ .flags = IRQF_NO_THREAD | IRQF_NO_SUSPEND, |
149 |
+ }; |
150 |
+ |
151 |
+ void __init mach_init_irq(void) |
152 |
+diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c |
153 |
+index aec6e9eef489..55884cb5a0fc 100644 |
154 |
+--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c |
155 |
++++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c |
156 |
+@@ -531,11 +531,9 @@ static int vmw_fb_set_par(struct fb_info *info) |
157 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
158 |
+ DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) |
159 |
+ }; |
160 |
+- struct drm_display_mode *old_mode; |
161 |
+ struct drm_display_mode *mode; |
162 |
+ int ret; |
163 |
+ |
164 |
+- old_mode = par->set_mode; |
165 |
+ mode = drm_mode_duplicate(vmw_priv->dev, &new_mode); |
166 |
+ if (!mode) { |
167 |
+ DRM_ERROR("Could not create new fb mode.\n"); |
168 |
+@@ -546,11 +544,7 @@ static int vmw_fb_set_par(struct fb_info *info) |
169 |
+ mode->vdisplay = var->yres; |
170 |
+ vmw_guess_mode_timing(mode); |
171 |
+ |
172 |
+- if (old_mode && drm_mode_equal(old_mode, mode)) { |
173 |
+- drm_mode_destroy(vmw_priv->dev, mode); |
174 |
+- mode = old_mode; |
175 |
+- old_mode = NULL; |
176 |
+- } else if (!vmw_kms_validate_mode_vram(vmw_priv, |
177 |
++ if (!vmw_kms_validate_mode_vram(vmw_priv, |
178 |
+ mode->hdisplay * |
179 |
+ DIV_ROUND_UP(var->bits_per_pixel, 8), |
180 |
+ mode->vdisplay)) { |
181 |
+@@ -613,8 +607,8 @@ static int vmw_fb_set_par(struct fb_info *info) |
182 |
+ schedule_delayed_work(&par->local_work, 0); |
183 |
+ |
184 |
+ out_unlock: |
185 |
+- if (old_mode) |
186 |
+- drm_mode_destroy(vmw_priv->dev, old_mode); |
187 |
++ if (par->set_mode) |
188 |
++ drm_mode_destroy(vmw_priv->dev, par->set_mode); |
189 |
+ par->set_mode = mode; |
190 |
+ |
191 |
+ drm_modeset_unlock_all(vmw_priv->dev); |
192 |
+diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c |
193 |
+index ca22483d253f..c1233d0288a0 100644 |
194 |
+--- a/drivers/iommu/amd_iommu.c |
195 |
++++ b/drivers/iommu/amd_iommu.c |
196 |
+@@ -2599,7 +2599,12 @@ static int map_sg(struct device *dev, struct scatterlist *sglist, |
197 |
+ |
198 |
+ /* Everything is mapped - write the right values into s->dma_address */ |
199 |
+ for_each_sg(sglist, s, nelems, i) { |
200 |
+- s->dma_address += address + s->offset; |
201 |
++ /* |
202 |
++ * Add in the remaining piece of the scatter-gather offset that |
203 |
++ * was masked out when we were determining the physical address |
204 |
++ * via (sg_phys(s) & PAGE_MASK) earlier. |
205 |
++ */ |
206 |
++ s->dma_address += address + (s->offset & ~PAGE_MASK); |
207 |
+ s->dma_length = s->length; |
208 |
+ } |
209 |
+ |
210 |
+diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c |
211 |
+index 20397aba6849..d92967e2e385 100644 |
212 |
+--- a/drivers/media/usb/uvc/uvc_ctrl.c |
213 |
++++ b/drivers/media/usb/uvc/uvc_ctrl.c |
214 |
+@@ -1203,7 +1203,7 @@ static void uvc_ctrl_fill_event(struct uvc_video_chain *chain, |
215 |
+ |
216 |
+ __uvc_query_v4l2_ctrl(chain, ctrl, mapping, &v4l2_ctrl); |
217 |
+ |
218 |
+- memset(ev->reserved, 0, sizeof(ev->reserved)); |
219 |
++ memset(ev, 0, sizeof(*ev)); |
220 |
+ ev->type = V4L2_EVENT_CTRL; |
221 |
+ ev->id = v4l2_ctrl.id; |
222 |
+ ev->u.ctrl.value = value; |
223 |
+diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c |
224 |
+index bd6884223a0d..c56d649fa7da 100644 |
225 |
+--- a/drivers/media/v4l2-core/v4l2-ctrls.c |
226 |
++++ b/drivers/media/v4l2-core/v4l2-ctrls.c |
227 |
+@@ -1231,7 +1231,7 @@ static u32 user_flags(const struct v4l2_ctrl *ctrl) |
228 |
+ |
229 |
+ static void fill_event(struct v4l2_event *ev, struct v4l2_ctrl *ctrl, u32 changes) |
230 |
+ { |
231 |
+- memset(ev->reserved, 0, sizeof(ev->reserved)); |
232 |
++ memset(ev, 0, sizeof(*ev)); |
233 |
+ ev->type = V4L2_EVENT_CTRL; |
234 |
+ ev->id = ctrl->id; |
235 |
+ ev->u.ctrl.changes = changes; |
236 |
+diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c |
237 |
+index c763b404510f..3e139692fe8f 100644 |
238 |
+--- a/drivers/mmc/host/pxamci.c |
239 |
++++ b/drivers/mmc/host/pxamci.c |
240 |
+@@ -181,7 +181,7 @@ static void pxamci_dma_irq(void *param); |
241 |
+ static void pxamci_setup_data(struct pxamci_host *host, struct mmc_data *data) |
242 |
+ { |
243 |
+ struct dma_async_tx_descriptor *tx; |
244 |
+- enum dma_data_direction direction; |
245 |
++ enum dma_transfer_direction direction; |
246 |
+ struct dma_slave_config config; |
247 |
+ struct dma_chan *chan; |
248 |
+ unsigned int nob = data->blocks; |
249 |
+diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c |
250 |
+index 21aec5c252ee..bbfe7be214e1 100644 |
251 |
+--- a/drivers/net/wireless/ath/ath10k/wmi.c |
252 |
++++ b/drivers/net/wireless/ath/ath10k/wmi.c |
253 |
+@@ -4277,7 +4277,7 @@ static void ath10k_tpc_config_disp_tables(struct ath10k *ar, |
254 |
+ rate_code[i], |
255 |
+ type); |
256 |
+ snprintf(buff, sizeof(buff), "%8d ", tpc[j]); |
257 |
+- strncat(tpc_value, buff, strlen(buff)); |
258 |
++ strlcat(tpc_value, buff, sizeof(tpc_value)); |
259 |
+ } |
260 |
+ tpc_stats->tpc_table[type].pream_idx[i] = pream_idx; |
261 |
+ tpc_stats->tpc_table[type].rate_code[i] = rate_code[i]; |
262 |
+diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c |
263 |
+index e664ca7c0afd..13f23c00538b 100644 |
264 |
+--- a/drivers/power/supply/charger-manager.c |
265 |
++++ b/drivers/power/supply/charger-manager.c |
266 |
+@@ -1212,7 +1212,6 @@ static int charger_extcon_init(struct charger_manager *cm, |
267 |
+ if (ret < 0) { |
268 |
+ pr_info("Cannot register extcon_dev for %s(cable: %s)\n", |
269 |
+ cable->extcon_name, cable->name); |
270 |
+- ret = -EINVAL; |
271 |
+ } |
272 |
+ |
273 |
+ return ret; |
274 |
+@@ -1634,7 +1633,7 @@ static int charger_manager_probe(struct platform_device *pdev) |
275 |
+ |
276 |
+ if (IS_ERR(desc)) { |
277 |
+ dev_err(&pdev->dev, "No platform data (desc) found\n"); |
278 |
+- return -ENODEV; |
279 |
++ return PTR_ERR(desc); |
280 |
+ } |
281 |
+ |
282 |
+ cm = devm_kzalloc(&pdev->dev, |
283 |
+diff --git a/drivers/rtc/rtc-lib.c b/drivers/rtc/rtc-lib.c |
284 |
+index e6bfb9c42a10..5b136bdc03d4 100644 |
285 |
+--- a/drivers/rtc/rtc-lib.c |
286 |
++++ b/drivers/rtc/rtc-lib.c |
287 |
+@@ -52,13 +52,11 @@ EXPORT_SYMBOL(rtc_year_days); |
288 |
+ */ |
289 |
+ void rtc_time64_to_tm(time64_t time, struct rtc_time *tm) |
290 |
+ { |
291 |
+- unsigned int month, year; |
292 |
+- unsigned long secs; |
293 |
++ unsigned int month, year, secs; |
294 |
+ int days; |
295 |
+ |
296 |
+ /* time must be positive */ |
297 |
+- days = div_s64(time, 86400); |
298 |
+- secs = time - (unsigned int) days * 86400; |
299 |
++ days = div_s64_rem(time, 86400, &secs); |
300 |
+ |
301 |
+ /* day of the week, 1970-01-01 was a Thursday */ |
302 |
+ tm->tm_wday = (days + 4) % 7; |
303 |
+diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c |
304 |
+index 5cfd56f08ffb..0b858414c558 100644 |
305 |
+--- a/drivers/scsi/ufs/ufshcd.c |
306 |
++++ b/drivers/scsi/ufs/ufshcd.c |
307 |
+@@ -1348,10 +1348,11 @@ static int ufshcd_comp_devman_upiu(struct ufs_hba *hba, struct ufshcd_lrb *lrbp) |
308 |
+ u32 upiu_flags; |
309 |
+ int ret = 0; |
310 |
+ |
311 |
+- if (hba->ufs_version == UFSHCI_VERSION_20) |
312 |
+- lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE; |
313 |
+- else |
314 |
++ if ((hba->ufs_version == UFSHCI_VERSION_10) || |
315 |
++ (hba->ufs_version == UFSHCI_VERSION_11)) |
316 |
+ lrbp->command_type = UTP_CMD_TYPE_DEV_MANAGE; |
317 |
++ else |
318 |
++ lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE; |
319 |
+ |
320 |
+ ufshcd_prepare_req_desc_hdr(lrbp, &upiu_flags, DMA_NONE); |
321 |
+ if (hba->dev_cmd.type == DEV_CMD_TYPE_QUERY) |
322 |
+@@ -1375,10 +1376,11 @@ static int ufshcd_comp_scsi_upiu(struct ufs_hba *hba, struct ufshcd_lrb *lrbp) |
323 |
+ u32 upiu_flags; |
324 |
+ int ret = 0; |
325 |
+ |
326 |
+- if (hba->ufs_version == UFSHCI_VERSION_20) |
327 |
+- lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE; |
328 |
+- else |
329 |
++ if ((hba->ufs_version == UFSHCI_VERSION_10) || |
330 |
++ (hba->ufs_version == UFSHCI_VERSION_11)) |
331 |
+ lrbp->command_type = UTP_CMD_TYPE_SCSI; |
332 |
++ else |
333 |
++ lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE; |
334 |
+ |
335 |
+ if (likely(lrbp->cmd)) { |
336 |
+ ufshcd_prepare_req_desc_hdr(lrbp, &upiu_flags, |
337 |
+diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c |
338 |
+index 699447aa8b43..747560feb63e 100644 |
339 |
+--- a/drivers/tty/serial/sprd_serial.c |
340 |
++++ b/drivers/tty/serial/sprd_serial.c |
341 |
+@@ -36,7 +36,7 @@ |
342 |
+ #define SPRD_FIFO_SIZE 128 |
343 |
+ #define SPRD_DEF_RATE 26000000 |
344 |
+ #define SPRD_BAUD_IO_LIMIT 3000000 |
345 |
+-#define SPRD_TIMEOUT 256 |
346 |
++#define SPRD_TIMEOUT 256000 |
347 |
+ |
348 |
+ /* the offset of serial registers and BITs for them */ |
349 |
+ /* data registers */ |
350 |
+@@ -63,6 +63,7 @@ |
351 |
+ |
352 |
+ /* interrupt clear register */ |
353 |
+ #define SPRD_ICLR 0x0014 |
354 |
++#define SPRD_ICLR_TIMEOUT BIT(13) |
355 |
+ |
356 |
+ /* line control register */ |
357 |
+ #define SPRD_LCR 0x0018 |
358 |
+@@ -298,7 +299,8 @@ static irqreturn_t sprd_handle_irq(int irq, void *dev_id) |
359 |
+ return IRQ_NONE; |
360 |
+ } |
361 |
+ |
362 |
+- serial_out(port, SPRD_ICLR, ~0); |
363 |
++ if (ims & SPRD_IMSR_TIMEOUT) |
364 |
++ serial_out(port, SPRD_ICLR, SPRD_ICLR_TIMEOUT); |
365 |
+ |
366 |
+ if (ims & (SPRD_IMSR_RX_FIFO_FULL | |
367 |
+ SPRD_IMSR_BREAK_DETECT | SPRD_IMSR_TIMEOUT)) |
368 |
+diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c |
369 |
+index 5e6136d2ed71..c6578b321838 100644 |
370 |
+--- a/drivers/usb/core/config.c |
371 |
++++ b/drivers/usb/core/config.c |
372 |
+@@ -763,18 +763,21 @@ void usb_destroy_configuration(struct usb_device *dev) |
373 |
+ return; |
374 |
+ |
375 |
+ if (dev->rawdescriptors) { |
376 |
+- for (i = 0; i < dev->descriptor.bNumConfigurations; i++) |
377 |
++ for (i = 0; i < dev->descriptor.bNumConfigurations && |
378 |
++ i < USB_MAXCONFIG; i++) |
379 |
+ kfree(dev->rawdescriptors[i]); |
380 |
+ |
381 |
+ kfree(dev->rawdescriptors); |
382 |
+ dev->rawdescriptors = NULL; |
383 |
+ } |
384 |
+ |
385 |
+- for (c = 0; c < dev->descriptor.bNumConfigurations; c++) { |
386 |
++ for (c = 0; c < dev->descriptor.bNumConfigurations && |
387 |
++ c < USB_MAXCONFIG; c++) { |
388 |
+ struct usb_host_config *cf = &dev->config[c]; |
389 |
+ |
390 |
+ kfree(cf->string); |
391 |
+- for (i = 0; i < cf->desc.bNumInterfaces; i++) { |
392 |
++ for (i = 0; i < cf->desc.bNumInterfaces && |
393 |
++ i < USB_MAXINTERFACES; i++) { |
394 |
+ if (cf->intf_cache[i]) |
395 |
+ kref_put(&cf->intf_cache[i]->ref, |
396 |
+ usb_release_interface_cache); |
397 |
+diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c |
398 |
+index d95ae092f154..baa1510a5298 100644 |
399 |
+--- a/drivers/video/backlight/pwm_bl.c |
400 |
++++ b/drivers/video/backlight/pwm_bl.c |
401 |
+@@ -54,10 +54,11 @@ static void pwm_backlight_power_on(struct pwm_bl_data *pb, int brightness) |
402 |
+ if (err < 0) |
403 |
+ dev_err(pb->dev, "failed to enable power supply\n"); |
404 |
+ |
405 |
++ pwm_enable(pb->pwm); |
406 |
++ |
407 |
+ if (pb->enable_gpio) |
408 |
+ gpiod_set_value_cansleep(pb->enable_gpio, 1); |
409 |
+ |
410 |
+- pwm_enable(pb->pwm); |
411 |
+ pb->enabled = true; |
412 |
+ } |
413 |
+ |
414 |
+@@ -66,12 +67,12 @@ static void pwm_backlight_power_off(struct pwm_bl_data *pb) |
415 |
+ if (!pb->enabled) |
416 |
+ return; |
417 |
+ |
418 |
+- pwm_config(pb->pwm, 0, pb->period); |
419 |
+- pwm_disable(pb->pwm); |
420 |
+- |
421 |
+ if (pb->enable_gpio) |
422 |
+ gpiod_set_value_cansleep(pb->enable_gpio, 0); |
423 |
+ |
424 |
++ pwm_config(pb->pwm, 0, pb->period); |
425 |
++ pwm_disable(pb->pwm); |
426 |
++ |
427 |
+ regulator_disable(pb->power_supply); |
428 |
+ pb->enabled = false; |
429 |
+ } |
430 |
+diff --git a/fs/dcache.c b/fs/dcache.c |
431 |
+index 29c0286bd638..05bad55352bb 100644 |
432 |
+--- a/fs/dcache.c |
433 |
++++ b/fs/dcache.c |
434 |
+@@ -1522,7 +1522,7 @@ static void check_and_drop(void *_data) |
435 |
+ { |
436 |
+ struct detach_data *data = _data; |
437 |
+ |
438 |
+- if (!data->mountpoint && !data->select.found) |
439 |
++ if (!data->mountpoint && list_empty(&data->select.dispose)) |
440 |
+ __d_drop(data->select.start); |
441 |
+ } |
442 |
+ |
443 |
+@@ -1564,17 +1564,15 @@ void d_invalidate(struct dentry *dentry) |
444 |
+ |
445 |
+ d_walk(dentry, &data, detach_and_collect, check_and_drop); |
446 |
+ |
447 |
+- if (data.select.found) |
448 |
++ if (!list_empty(&data.select.dispose)) |
449 |
+ shrink_dentry_list(&data.select.dispose); |
450 |
++ else if (!data.mountpoint) |
451 |
++ return; |
452 |
+ |
453 |
+ if (data.mountpoint) { |
454 |
+ detach_mounts(data.mountpoint); |
455 |
+ dput(data.mountpoint); |
456 |
+ } |
457 |
+- |
458 |
+- if (!data.mountpoint && !data.select.found) |
459 |
+- break; |
460 |
+- |
461 |
+ cond_resched(); |
462 |
+ } |
463 |
+ } |
464 |
+diff --git a/fs/ext4/ext4_jbd2.h b/fs/ext4/ext4_jbd2.h |
465 |
+index f97611171023..4b7cc1af03a0 100644 |
466 |
+--- a/fs/ext4/ext4_jbd2.h |
467 |
++++ b/fs/ext4/ext4_jbd2.h |
468 |
+@@ -391,7 +391,7 @@ static inline void ext4_update_inode_fsync_trans(handle_t *handle, |
469 |
+ { |
470 |
+ struct ext4_inode_info *ei = EXT4_I(inode); |
471 |
+ |
472 |
+- if (ext4_handle_valid(handle)) { |
473 |
++ if (ext4_handle_valid(handle) && !is_handle_aborted(handle)) { |
474 |
+ ei->i_sync_tid = handle->h_transaction->t_tid; |
475 |
+ if (datasync) |
476 |
+ ei->i_datasync_tid = handle->h_transaction->t_tid; |
477 |
+diff --git a/fs/ext4/file.c b/fs/ext4/file.c |
478 |
+index 08fca4add1e2..fe76d0957a1f 100644 |
479 |
+--- a/fs/ext4/file.c |
480 |
++++ b/fs/ext4/file.c |
481 |
+@@ -79,7 +79,7 @@ ext4_unaligned_aio(struct inode *inode, struct iov_iter *from, loff_t pos) |
482 |
+ struct super_block *sb = inode->i_sb; |
483 |
+ int blockmask = sb->s_blocksize - 1; |
484 |
+ |
485 |
+- if (pos >= i_size_read(inode)) |
486 |
++ if (pos >= ALIGN(i_size_read(inode), sb->s_blocksize)) |
487 |
+ return 0; |
488 |
+ |
489 |
+ if ((pos | iov_iter_alignment(from)) & blockmask) |
490 |
+diff --git a/fs/ext4/indirect.c b/fs/ext4/indirect.c |
491 |
+index 58229c1b4a3d..14007e621d2a 100644 |
492 |
+--- a/fs/ext4/indirect.c |
493 |
++++ b/fs/ext4/indirect.c |
494 |
+@@ -1385,10 +1385,14 @@ end_range: |
495 |
+ partial->p + 1, |
496 |
+ partial2->p, |
497 |
+ (chain+n-1) - partial); |
498 |
+- BUFFER_TRACE(partial->bh, "call brelse"); |
499 |
+- brelse(partial->bh); |
500 |
+- BUFFER_TRACE(partial2->bh, "call brelse"); |
501 |
+- brelse(partial2->bh); |
502 |
++ while (partial > chain) { |
503 |
++ BUFFER_TRACE(partial->bh, "call brelse"); |
504 |
++ brelse(partial->bh); |
505 |
++ } |
506 |
++ while (partial2 > chain2) { |
507 |
++ BUFFER_TRACE(partial2->bh, "call brelse"); |
508 |
++ brelse(partial2->bh); |
509 |
++ } |
510 |
+ return 0; |
511 |
+ } |
512 |
+ |
513 |
+diff --git a/fs/udf/truncate.c b/fs/udf/truncate.c |
514 |
+index 42b8c57795cb..c6ce7503a329 100644 |
515 |
+--- a/fs/udf/truncate.c |
516 |
++++ b/fs/udf/truncate.c |
517 |
+@@ -260,6 +260,9 @@ void udf_truncate_extents(struct inode *inode) |
518 |
+ epos.block = eloc; |
519 |
+ epos.bh = udf_tread(sb, |
520 |
+ udf_get_lb_pblock(sb, &eloc, 0)); |
521 |
++ /* Error reading indirect block? */ |
522 |
++ if (!epos.bh) |
523 |
++ return; |
524 |
+ if (elen) |
525 |
+ indirect_ext_len = |
526 |
+ (elen + sb->s_blocksize - 1) >> |
527 |
+diff --git a/include/linux/ceph/libceph.h b/include/linux/ceph/libceph.h |
528 |
+index a8a574897d3c..fe757514feb1 100644 |
529 |
+--- a/include/linux/ceph/libceph.h |
530 |
++++ b/include/linux/ceph/libceph.h |
531 |
+@@ -276,6 +276,8 @@ extern void ceph_destroy_client(struct ceph_client *client); |
532 |
+ extern int __ceph_open_session(struct ceph_client *client, |
533 |
+ unsigned long started); |
534 |
+ extern int ceph_open_session(struct ceph_client *client); |
535 |
++int ceph_wait_for_latest_osdmap(struct ceph_client *client, |
536 |
++ unsigned long timeout); |
537 |
+ |
538 |
+ /* pagevec.c */ |
539 |
+ extern void ceph_release_page_vector(struct page **pages, int num_pages); |
540 |
+diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h |
541 |
+index 197a30d221e9..146054ceea8e 100644 |
542 |
+--- a/include/net/inet_connection_sock.h |
543 |
++++ b/include/net/inet_connection_sock.h |
544 |
+@@ -289,11 +289,6 @@ static inline int inet_csk_reqsk_queue_len(const struct sock *sk) |
545 |
+ return reqsk_queue_len(&inet_csk(sk)->icsk_accept_queue); |
546 |
+ } |
547 |
+ |
548 |
+-static inline int inet_csk_reqsk_queue_young(const struct sock *sk) |
549 |
+-{ |
550 |
+- return reqsk_queue_len_young(&inet_csk(sk)->icsk_accept_queue); |
551 |
+-} |
552 |
+- |
553 |
+ static inline int inet_csk_reqsk_queue_is_full(const struct sock *sk) |
554 |
+ { |
555 |
+ return inet_csk_reqsk_queue_len(sk) >= sk->sk_max_ack_backlog; |
556 |
+diff --git a/kernel/futex.c b/kernel/futex.c |
557 |
+index 30fe0432c46d..2e766ffff2cb 100644 |
558 |
+--- a/kernel/futex.c |
559 |
++++ b/kernel/futex.c |
560 |
+@@ -3110,6 +3110,10 @@ int handle_futex_death(u32 __user *uaddr, struct task_struct *curr, int pi) |
561 |
+ { |
562 |
+ u32 uval, uninitialized_var(nval), mval; |
563 |
+ |
564 |
++ /* Futex address must be 32bit aligned */ |
565 |
++ if ((((unsigned long)uaddr) % sizeof(*uaddr)) != 0) |
566 |
++ return -1; |
567 |
++ |
568 |
+ retry: |
569 |
+ if (get_user(uval, uaddr)) |
570 |
+ return -1; |
571 |
+diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c |
572 |
+index 26fc428476b9..d5b779d7e79f 100644 |
573 |
+--- a/kernel/locking/lockdep.c |
574 |
++++ b/kernel/locking/lockdep.c |
575 |
+@@ -3446,6 +3446,9 @@ __lock_set_class(struct lockdep_map *lock, const char *name, |
576 |
+ unsigned int depth; |
577 |
+ int i; |
578 |
+ |
579 |
++ if (unlikely(!debug_locks)) |
580 |
++ return 0; |
581 |
++ |
582 |
+ depth = curr->lockdep_depth; |
583 |
+ /* |
584 |
+ * This function is about (re)setting the class of a held lock, |
585 |
+diff --git a/lib/int_sqrt.c b/lib/int_sqrt.c |
586 |
+index 1ef4cc344977..1afb545a37c5 100644 |
587 |
+--- a/lib/int_sqrt.c |
588 |
++++ b/lib/int_sqrt.c |
589 |
+@@ -22,6 +22,9 @@ unsigned long int_sqrt(unsigned long x) |
590 |
+ return x; |
591 |
+ |
592 |
+ m = 1UL << (BITS_PER_LONG - 2); |
593 |
++ while (m > x) |
594 |
++ m >>= 2; |
595 |
++ |
596 |
+ while (m != 0) { |
597 |
+ b = y + m; |
598 |
+ y >>= 1; |
599 |
+diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c |
600 |
+index c88a6007e643..ca1836941f3c 100644 |
601 |
+--- a/net/bluetooth/hci_sock.c |
602 |
++++ b/net/bluetooth/hci_sock.c |
603 |
+@@ -826,8 +826,6 @@ static int hci_sock_release(struct socket *sock) |
604 |
+ if (!sk) |
605 |
+ return 0; |
606 |
+ |
607 |
+- hdev = hci_pi(sk)->hdev; |
608 |
+- |
609 |
+ switch (hci_pi(sk)->channel) { |
610 |
+ case HCI_CHANNEL_MONITOR: |
611 |
+ atomic_dec(&monitor_promisc); |
612 |
+@@ -849,6 +847,7 @@ static int hci_sock_release(struct socket *sock) |
613 |
+ |
614 |
+ bt_sock_unlink(&hci_sk_list, sk); |
615 |
+ |
616 |
++ hdev = hci_pi(sk)->hdev; |
617 |
+ if (hdev) { |
618 |
+ if (hci_pi(sk)->channel == HCI_CHANNEL_USER) { |
619 |
+ /* When releasing an user channel exclusive access, |
620 |
+diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c |
621 |
+index 464e88599b9d..bf0294cf4d22 100644 |
622 |
+--- a/net/ceph/ceph_common.c |
623 |
++++ b/net/ceph/ceph_common.c |
624 |
+@@ -699,7 +699,6 @@ int __ceph_open_session(struct ceph_client *client, unsigned long started) |
625 |
+ } |
626 |
+ EXPORT_SYMBOL(__ceph_open_session); |
627 |
+ |
628 |
+- |
629 |
+ int ceph_open_session(struct ceph_client *client) |
630 |
+ { |
631 |
+ int ret; |
632 |
+@@ -715,6 +714,23 @@ int ceph_open_session(struct ceph_client *client) |
633 |
+ } |
634 |
+ EXPORT_SYMBOL(ceph_open_session); |
635 |
+ |
636 |
++int ceph_wait_for_latest_osdmap(struct ceph_client *client, |
637 |
++ unsigned long timeout) |
638 |
++{ |
639 |
++ u64 newest_epoch; |
640 |
++ int ret; |
641 |
++ |
642 |
++ ret = ceph_monc_get_version(&client->monc, "osdmap", &newest_epoch); |
643 |
++ if (ret) |
644 |
++ return ret; |
645 |
++ |
646 |
++ if (client->osdc.osdmap->epoch >= newest_epoch) |
647 |
++ return 0; |
648 |
++ |
649 |
++ ceph_osdc_maybe_request_map(&client->osdc); |
650 |
++ return ceph_monc_wait_osdmap(&client->monc, newest_epoch, timeout); |
651 |
++} |
652 |
++EXPORT_SYMBOL(ceph_wait_for_latest_osdmap); |
653 |
+ |
654 |
+ static int __init init_ceph_lib(void) |
655 |
+ { |
656 |
+diff --git a/net/ceph/mon_client.c b/net/ceph/mon_client.c |
657 |
+index 500481003de4..288c1fcbcdf6 100644 |
658 |
+--- a/net/ceph/mon_client.c |
659 |
++++ b/net/ceph/mon_client.c |
660 |
+@@ -914,6 +914,15 @@ int ceph_monc_blacklist_add(struct ceph_mon_client *monc, |
661 |
+ mutex_unlock(&monc->mutex); |
662 |
+ |
663 |
+ ret = wait_generic_request(req); |
664 |
++ if (!ret) |
665 |
++ /* |
666 |
++ * Make sure we have the osdmap that includes the blacklist |
667 |
++ * entry. This is needed to ensure that the OSDs pick up the |
668 |
++ * new blacklist before processing any future requests from |
669 |
++ * this client. |
670 |
++ */ |
671 |
++ ret = ceph_wait_for_latest_osdmap(monc->client, 0); |
672 |
++ |
673 |
+ out: |
674 |
+ put_generic_request(req); |
675 |
+ return ret; |
676 |
+diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c |
677 |
+index 28ad6f187e19..1d6d3aaa8c3d 100644 |
678 |
+--- a/net/dccp/ipv4.c |
679 |
++++ b/net/dccp/ipv4.c |
680 |
+@@ -596,13 +596,7 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb) |
681 |
+ if (inet_csk_reqsk_queue_is_full(sk)) |
682 |
+ goto drop; |
683 |
+ |
684 |
+- /* |
685 |
+- * Accept backlog is full. If we have already queued enough |
686 |
+- * of warm entries in syn queue, drop request. It is better than |
687 |
+- * clogging syn queue with openreqs with exponentially increasing |
688 |
+- * timeout. |
689 |
+- */ |
690 |
+- if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1) |
691 |
++ if (sk_acceptq_is_full(sk)) |
692 |
+ goto drop; |
693 |
+ |
694 |
+ req = inet_reqsk_alloc(&dccp_request_sock_ops, sk, true); |
695 |
+diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c |
696 |
+index 6cbcf399d22b..93c706172f40 100644 |
697 |
+--- a/net/dccp/ipv6.c |
698 |
++++ b/net/dccp/ipv6.c |
699 |
+@@ -328,7 +328,7 @@ static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb) |
700 |
+ if (inet_csk_reqsk_queue_is_full(sk)) |
701 |
+ goto drop; |
702 |
+ |
703 |
+- if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1) |
704 |
++ if (sk_acceptq_is_full(sk)) |
705 |
+ goto drop; |
706 |
+ |
707 |
+ req = inet_reqsk_alloc(&dccp6_request_sock_ops, sk, true); |
708 |
+diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c |
709 |
+index 48fe63c4fe24..cd4f13dda49e 100644 |
710 |
+--- a/net/ipv4/tcp_input.c |
711 |
++++ b/net/ipv4/tcp_input.c |
712 |
+@@ -6374,13 +6374,7 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops, |
713 |
+ goto drop; |
714 |
+ } |
715 |
+ |
716 |
+- |
717 |
+- /* Accept backlog is full. If we have already queued enough |
718 |
+- * of warm entries in syn queue, drop request. It is better than |
719 |
+- * clogging syn queue with openreqs with exponentially increasing |
720 |
+- * timeout. |
721 |
+- */ |
722 |
+- if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1) { |
723 |
++ if (sk_acceptq_is_full(sk)) { |
724 |
+ NET_INC_STATS(sock_net(sk), LINUX_MIB_LISTENOVERFLOWS); |
725 |
+ goto drop; |
726 |
+ } |
727 |
+diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c |
728 |
+index c6b046ddefdd..1b5e217d1bb2 100644 |
729 |
+--- a/sound/pci/hda/hda_codec.c |
730 |
++++ b/sound/pci/hda/hda_codec.c |
731 |
+@@ -3004,6 +3004,7 @@ static void hda_call_codec_resume(struct hda_codec *codec) |
732 |
+ hda_jackpoll_work(&codec->jackpoll_work.work); |
733 |
+ else |
734 |
+ snd_hda_jack_report_sync(codec); |
735 |
++ codec->core.dev.power.power_state = PMSG_ON; |
736 |
+ atomic_dec(&codec->core.in_pm); |
737 |
+ } |
738 |
+ |
739 |
+@@ -3036,10 +3037,62 @@ static int hda_codec_runtime_resume(struct device *dev) |
740 |
+ } |
741 |
+ #endif /* CONFIG_PM */ |
742 |
+ |
743 |
++#ifdef CONFIG_PM_SLEEP |
744 |
++static int hda_codec_force_resume(struct device *dev) |
745 |
++{ |
746 |
++ int ret; |
747 |
++ |
748 |
++ /* The get/put pair below enforces the runtime resume even if the |
749 |
++ * device hasn't been used at suspend time. This trick is needed to |
750 |
++ * update the jack state change during the sleep. |
751 |
++ */ |
752 |
++ pm_runtime_get_noresume(dev); |
753 |
++ ret = pm_runtime_force_resume(dev); |
754 |
++ pm_runtime_put(dev); |
755 |
++ return ret; |
756 |
++} |
757 |
++ |
758 |
++static int hda_codec_pm_suspend(struct device *dev) |
759 |
++{ |
760 |
++ dev->power.power_state = PMSG_SUSPEND; |
761 |
++ return pm_runtime_force_suspend(dev); |
762 |
++} |
763 |
++ |
764 |
++static int hda_codec_pm_resume(struct device *dev) |
765 |
++{ |
766 |
++ dev->power.power_state = PMSG_RESUME; |
767 |
++ return hda_codec_force_resume(dev); |
768 |
++} |
769 |
++ |
770 |
++static int hda_codec_pm_freeze(struct device *dev) |
771 |
++{ |
772 |
++ dev->power.power_state = PMSG_FREEZE; |
773 |
++ return pm_runtime_force_suspend(dev); |
774 |
++} |
775 |
++ |
776 |
++static int hda_codec_pm_thaw(struct device *dev) |
777 |
++{ |
778 |
++ dev->power.power_state = PMSG_THAW; |
779 |
++ return hda_codec_force_resume(dev); |
780 |
++} |
781 |
++ |
782 |
++static int hda_codec_pm_restore(struct device *dev) |
783 |
++{ |
784 |
++ dev->power.power_state = PMSG_RESTORE; |
785 |
++ return hda_codec_force_resume(dev); |
786 |
++} |
787 |
++#endif /* CONFIG_PM_SLEEP */ |
788 |
++ |
789 |
+ /* referred in hda_bind.c */ |
790 |
+ const struct dev_pm_ops hda_codec_driver_pm = { |
791 |
+- SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, |
792 |
+- pm_runtime_force_resume) |
793 |
++#ifdef CONFIG_PM_SLEEP |
794 |
++ .suspend = hda_codec_pm_suspend, |
795 |
++ .resume = hda_codec_pm_resume, |
796 |
++ .freeze = hda_codec_pm_freeze, |
797 |
++ .thaw = hda_codec_pm_thaw, |
798 |
++ .poweroff = hda_codec_pm_suspend, |
799 |
++ .restore = hda_codec_pm_restore, |
800 |
++#endif /* CONFIG_PM_SLEEP */ |
801 |
+ SET_RUNTIME_PM_OPS(hda_codec_runtime_suspend, hda_codec_runtime_resume, |
802 |
+ NULL) |
803 |
+ }; |
804 |
+diff --git a/tools/objtool/check.c b/tools/objtool/check.c |
805 |
+index e128d1c71c30..3ff025b64527 100644 |
806 |
+--- a/tools/objtool/check.c |
807 |
++++ b/tools/objtool/check.c |
808 |
+@@ -2132,9 +2132,10 @@ static void cleanup(struct objtool_file *file) |
809 |
+ elf_close(file->elf); |
810 |
+ } |
811 |
+ |
812 |
++static struct objtool_file file; |
813 |
++ |
814 |
+ int check(const char *_objname, bool orc) |
815 |
+ { |
816 |
+- struct objtool_file file; |
817 |
+ int ret, warnings = 0; |
818 |
+ |
819 |
+ objname = _objname; |