Gentoo Archives: gentoo-commits

From: Alice Ferrazzi <alicef@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:5.14 commit in: /
Date: Wed, 08 Sep 2021 12:40:05
Message-Id: 1631104776.7b32dce1b780090fed085118f338b12b31e4ea8f.alicef@gentoo
1 commit: 7b32dce1b780090fed085118f338b12b31e4ea8f
2 Author: Alice Ferrazzi <alicef <AT> gentoo <DOT> org>
3 AuthorDate: Wed Sep 8 12:37:04 2021 +0000
4 Commit: Alice Ferrazzi <alicef <AT> gentoo <DOT> org>
5 CommitDate: Wed Sep 8 12:39:36 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=7b32dce1
7
8 Linux patch 5.14.2
9
10 Signed-off-by: Alice Ferrazzi <alicef <AT> gentoo.org>
11
12 0000_README | 4 +
13 1001_linux-5.14.2.patch | 336 ++++++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 340 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index dc9ab2d..d1db2c0 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -47,6 +47,10 @@ Patch: 1000_linux-5.14.1.patch
21 From: http://www.kernel.org
22 Desc: Linux 5.14.1
23
24 +Patch: 1001_linux-5.14.2.patch
25 +From: http://www.kernel.org
26 +Desc: Linux 5.14.2
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/1001_linux-5.14.2.patch b/1001_linux-5.14.2.patch
33 new file mode 100644
34 index 0000000..be5d674
35 --- /dev/null
36 +++ b/1001_linux-5.14.2.patch
37 @@ -0,0 +1,336 @@
38 +diff --git a/Makefile b/Makefile
39 +index 83d1f7c1fd304..9a2b00ecc6af4 100644
40 +--- a/Makefile
41 ++++ b/Makefile
42 +@@ -1,7 +1,7 @@
43 + # SPDX-License-Identifier: GPL-2.0
44 + VERSION = 5
45 + PATCHLEVEL = 14
46 +-SUBLEVEL = 1
47 ++SUBLEVEL = 2
48 + EXTRAVERSION =
49 + NAME = Opossums on Parade
50 +
51 +diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig
52 +index 3878880469d10..b843902ad9fd7 100644
53 +--- a/arch/xtensa/Kconfig
54 ++++ b/arch/xtensa/Kconfig
55 +@@ -30,7 +30,7 @@ config XTENSA
56 + select HAVE_DMA_CONTIGUOUS
57 + select HAVE_EXIT_THREAD
58 + select HAVE_FUNCTION_TRACER
59 +- select HAVE_FUTEX_CMPXCHG if !MMU
60 ++ select HAVE_FUTEX_CMPXCHG if !MMU && FUTEX
61 + select HAVE_HW_BREAKPOINT if PERF_EVENTS
62 + select HAVE_IRQ_TIME_ACCOUNTING
63 + select HAVE_PCI
64 +diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
65 +index 06130dc431a04..b234958f883a4 100644
66 +--- a/drivers/hid/usbhid/hid-core.c
67 ++++ b/drivers/hid/usbhid/hid-core.c
68 +@@ -377,27 +377,27 @@ static int hid_submit_ctrl(struct hid_device *hid)
69 + len = hid_report_len(report);
70 + if (dir == USB_DIR_OUT) {
71 + usbhid->urbctrl->pipe = usb_sndctrlpipe(hid_to_usb_dev(hid), 0);
72 +- usbhid->urbctrl->transfer_buffer_length = len;
73 + if (raw_report) {
74 + memcpy(usbhid->ctrlbuf, raw_report, len);
75 + kfree(raw_report);
76 + usbhid->ctrl[usbhid->ctrltail].raw_report = NULL;
77 + }
78 + } else {
79 +- int maxpacket, padlen;
80 ++ int maxpacket;
81 +
82 + usbhid->urbctrl->pipe = usb_rcvctrlpipe(hid_to_usb_dev(hid), 0);
83 + maxpacket = usb_maxpacket(hid_to_usb_dev(hid),
84 + usbhid->urbctrl->pipe, 0);
85 + if (maxpacket > 0) {
86 +- padlen = DIV_ROUND_UP(len, maxpacket);
87 +- padlen *= maxpacket;
88 +- if (padlen > usbhid->bufsize)
89 +- padlen = usbhid->bufsize;
90 ++ len += (len == 0); /* Don't allow 0-length reports */
91 ++ len = DIV_ROUND_UP(len, maxpacket);
92 ++ len *= maxpacket;
93 ++ if (len > usbhid->bufsize)
94 ++ len = usbhid->bufsize;
95 + } else
96 +- padlen = 0;
97 +- usbhid->urbctrl->transfer_buffer_length = padlen;
98 ++ len = 0;
99 + }
100 ++ usbhid->urbctrl->transfer_buffer_length = len;
101 + usbhid->urbctrl->dev = hid_to_usb_dev(hid);
102 +
103 + usbhid->cr->bRequestType = USB_TYPE_CLASS | USB_RECIP_INTERFACE | dir;
104 +diff --git a/drivers/media/usb/stkwebcam/stk-webcam.c b/drivers/media/usb/stkwebcam/stk-webcam.c
105 +index a45d464427c4c..0e231e576dc3d 100644
106 +--- a/drivers/media/usb/stkwebcam/stk-webcam.c
107 ++++ b/drivers/media/usb/stkwebcam/stk-webcam.c
108 +@@ -1346,7 +1346,7 @@ static int stk_camera_probe(struct usb_interface *interface,
109 + if (!dev->isoc_ep) {
110 + pr_err("Could not find isoc-in endpoint\n");
111 + err = -ENODEV;
112 +- goto error;
113 ++ goto error_put;
114 + }
115 + dev->vsettings.palette = V4L2_PIX_FMT_RGB565;
116 + dev->vsettings.mode = MODE_VGA;
117 +@@ -1359,10 +1359,12 @@ static int stk_camera_probe(struct usb_interface *interface,
118 +
119 + err = stk_register_video_device(dev);
120 + if (err)
121 +- goto error;
122 ++ goto error_put;
123 +
124 + return 0;
125 +
126 ++error_put:
127 ++ usb_put_intf(interface);
128 + error:
129 + v4l2_ctrl_handler_free(hdl);
130 + v4l2_device_unregister(&dev->v4l2_dev);
131 +diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
132 +index 3c80bfbf3bec9..d48bed5782a5c 100644
133 +--- a/drivers/usb/serial/cp210x.c
134 ++++ b/drivers/usb/serial/cp210x.c
135 +@@ -1164,10 +1164,8 @@ static int cp210x_set_chars(struct usb_serial_port *port,
136 +
137 + kfree(dmabuf);
138 +
139 +- if (result < 0) {
140 +- dev_err(&port->dev, "failed to set special chars: %d\n", result);
141 ++ if (result < 0)
142 + return result;
143 +- }
144 +
145 + return 0;
146 + }
147 +@@ -1192,6 +1190,7 @@ static void cp210x_set_flow_control(struct tty_struct *tty,
148 + struct cp210x_flow_ctl flow_ctl;
149 + u32 flow_repl;
150 + u32 ctl_hs;
151 ++ bool crtscts;
152 + int ret;
153 +
154 + /*
155 +@@ -1219,8 +1218,10 @@ static void cp210x_set_flow_control(struct tty_struct *tty,
156 + chars.bXoffChar = STOP_CHAR(tty);
157 +
158 + ret = cp210x_set_chars(port, &chars);
159 +- if (ret)
160 +- return;
161 ++ if (ret) {
162 ++ dev_err(&port->dev, "failed to set special chars: %d\n",
163 ++ ret);
164 ++ }
165 + }
166 +
167 + mutex_lock(&port_priv->mutex);
168 +@@ -1249,14 +1250,14 @@ static void cp210x_set_flow_control(struct tty_struct *tty,
169 + flow_repl |= CP210X_SERIAL_RTS_FLOW_CTL;
170 + else
171 + flow_repl |= CP210X_SERIAL_RTS_INACTIVE;
172 +- port_priv->crtscts = true;
173 ++ crtscts = true;
174 + } else {
175 + ctl_hs &= ~CP210X_SERIAL_CTS_HANDSHAKE;
176 + if (port_priv->rts)
177 + flow_repl |= CP210X_SERIAL_RTS_ACTIVE;
178 + else
179 + flow_repl |= CP210X_SERIAL_RTS_INACTIVE;
180 +- port_priv->crtscts = false;
181 ++ crtscts = false;
182 + }
183 +
184 + if (I_IXOFF(tty)) {
185 +@@ -1279,8 +1280,12 @@ static void cp210x_set_flow_control(struct tty_struct *tty,
186 + flow_ctl.ulControlHandshake = cpu_to_le32(ctl_hs);
187 + flow_ctl.ulFlowReplace = cpu_to_le32(flow_repl);
188 +
189 +- cp210x_write_reg_block(port, CP210X_SET_FLOW, &flow_ctl,
190 ++ ret = cp210x_write_reg_block(port, CP210X_SET_FLOW, &flow_ctl,
191 + sizeof(flow_ctl));
192 ++ if (ret)
193 ++ goto out_unlock;
194 ++
195 ++ port_priv->crtscts = crtscts;
196 + out_unlock:
197 + mutex_unlock(&port_priv->mutex);
198 + }
199 +diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
200 +index 930b3d50a3308..f45ca7ddf78ea 100644
201 +--- a/drivers/usb/serial/pl2303.c
202 ++++ b/drivers/usb/serial/pl2303.c
203 +@@ -433,6 +433,7 @@ static int pl2303_detect_type(struct usb_serial *serial)
204 + switch (bcdDevice) {
205 + case 0x100:
206 + case 0x305:
207 ++ case 0x405:
208 + /*
209 + * Assume it's an HXN-type if the device doesn't
210 + * support the old read request value.
211 +diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
212 +index 70cb64db33f73..24e994e75f5ca 100644
213 +--- a/fs/ext4/inline.c
214 ++++ b/fs/ext4/inline.c
215 +@@ -750,6 +750,12 @@ int ext4_write_inline_data_end(struct inode *inode, loff_t pos, unsigned len,
216 + ext4_write_lock_xattr(inode, &no_expand);
217 + BUG_ON(!ext4_has_inline_data(inode));
218 +
219 ++ /*
220 ++ * ei->i_inline_off may have changed since ext4_write_begin()
221 ++ * called ext4_try_to_write_inline_data()
222 ++ */
223 ++ (void) ext4_find_inline_data_nolock(inode);
224 ++
225 + kaddr = kmap_atomic(page);
226 + ext4_write_inline_data(inode, &iloc, kaddr, pos, len);
227 + kunmap_atomic(kaddr);
228 +diff --git a/fs/ext4/super.c b/fs/ext4/super.c
229 +index dfa09a277b56f..970013c93d3ea 100644
230 +--- a/fs/ext4/super.c
231 ++++ b/fs/ext4/super.c
232 +@@ -5032,6 +5032,14 @@ no_journal:
233 + err = percpu_counter_init(&sbi->s_freeinodes_counter, freei,
234 + GFP_KERNEL);
235 + }
236 ++ /*
237 ++ * Update the checksum after updating free space/inode
238 ++ * counters. Otherwise the superblock can have an incorrect
239 ++ * checksum in the buffer cache until it is written out and
240 ++ * e2fsprogs programs trying to open a file system immediately
241 ++ * after it is mounted can fail.
242 ++ */
243 ++ ext4_superblock_csum_set(sb);
244 + if (!err)
245 + err = percpu_counter_init(&sbi->s_dirs_counter,
246 + ext4_count_dirs(sb), GFP_KERNEL);
247 +diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
248 +index 7d5883432085a..a144a3f68e9eb 100644
249 +--- a/sound/core/pcm_lib.c
250 ++++ b/sound/core/pcm_lib.c
251 +@@ -1746,7 +1746,7 @@ static int snd_pcm_lib_ioctl_fifo_size(struct snd_pcm_substream *substream,
252 + channels = params_channels(params);
253 + frame_size = snd_pcm_format_size(format, channels);
254 + if (frame_size > 0)
255 +- params->fifo_size /= (unsigned)frame_size;
256 ++ params->fifo_size /= frame_size;
257 + }
258 + return 0;
259 + }
260 +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
261 +index 7ad689f991e7e..70516527ebce3 100644
262 +--- a/sound/pci/hda/patch_realtek.c
263 ++++ b/sound/pci/hda/patch_realtek.c
264 +@@ -8438,6 +8438,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
265 + SND_PCI_QUIRK(0x103c, 0x87f2, "HP ProBook 640 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
266 + SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED),
267 + SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),
268 ++ SND_PCI_QUIRK(0x103c, 0x87f6, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
269 + SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
270 + SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
271 + SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
272 +@@ -9521,6 +9522,16 @@ static int patch_alc269(struct hda_codec *codec)
273 +
274 + snd_hda_pick_fixup(codec, alc269_fixup_models,
275 + alc269_fixup_tbl, alc269_fixups);
276 ++ /* FIXME: both TX300 and ROG Strix G17 have the same SSID, and
277 ++ * the quirk breaks the latter (bko#214101).
278 ++ * Clear the wrong entry.
279 ++ */
280 ++ if (codec->fixup_id == ALC282_FIXUP_ASUS_TX300 &&
281 ++ codec->core.vendor_id == 0x10ec0294) {
282 ++ codec_dbg(codec, "Clear wrong fixup for ASUS ROG Strix G17\n");
283 ++ codec->fixup_id = HDA_FIXUP_ID_NOT_SET;
284 ++ }
285 ++
286 + snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true);
287 + snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false);
288 + snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl,
289 +diff --git a/sound/usb/card.h b/sound/usb/card.h
290 +index 6c0a052a28f99..5b19901f305a3 100644
291 +--- a/sound/usb/card.h
292 ++++ b/sound/usb/card.h
293 +@@ -94,6 +94,7 @@ struct snd_usb_endpoint {
294 + struct list_head ready_playback_urbs; /* playback URB FIFO for implicit fb */
295 +
296 + unsigned int nurbs; /* # urbs */
297 ++ unsigned int nominal_queue_size; /* total buffer sizes in URBs */
298 + unsigned long active_mask; /* bitmask of active urbs */
299 + unsigned long unlink_mask; /* bitmask of unlinked urbs */
300 + char *syncbuf; /* sync buffer for all sync URBs */
301 +@@ -187,6 +188,7 @@ struct snd_usb_substream {
302 + } dsd_dop;
303 +
304 + bool trigger_tstamp_pending_update; /* trigger timestamp being updated from initial estimate */
305 ++ bool early_playback_start; /* early start needed for playback? */
306 + struct media_ctl *media_ctl;
307 + };
308 +
309 +diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c
310 +index 4f856771216b4..bf26c04cf4716 100644
311 +--- a/sound/usb/endpoint.c
312 ++++ b/sound/usb/endpoint.c
313 +@@ -1126,6 +1126,10 @@ static int data_ep_set_params(struct snd_usb_endpoint *ep)
314 + INIT_LIST_HEAD(&u->ready_list);
315 + }
316 +
317 ++ /* total buffer bytes of all URBs plus the next queue;
318 ++ * referred in pcm.c
319 ++ */
320 ++ ep->nominal_queue_size = maxsize * urb_packs * (ep->nurbs + 1);
321 + return 0;
322 +
323 + out_of_memory:
324 +@@ -1287,6 +1291,11 @@ int snd_usb_endpoint_configure(struct snd_usb_audio *chip,
325 + * to be set up before parameter setups
326 + */
327 + iface_first = ep->cur_audiofmt->protocol == UAC_VERSION_1;
328 ++ /* Workaround for Sony WALKMAN NW-A45 DAC;
329 ++ * it requires the interface setup at first like UAC1
330 ++ */
331 ++ if (chip->usb_id == USB_ID(0x054c, 0x0b8c))
332 ++ iface_first = true;
333 + if (iface_first) {
334 + err = endpoint_set_interface(chip, ep, true);
335 + if (err < 0)
336 +diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
337 +index 4e5031a680647..f5cbf61ac366e 100644
338 +--- a/sound/usb/pcm.c
339 ++++ b/sound/usb/pcm.c
340 +@@ -614,6 +614,14 @@ static int snd_usb_pcm_prepare(struct snd_pcm_substream *substream)
341 + subs->period_elapsed_pending = 0;
342 + runtime->delay = 0;
343 +
344 ++ /* check whether early start is needed for playback stream */
345 ++ subs->early_playback_start =
346 ++ subs->direction == SNDRV_PCM_STREAM_PLAYBACK &&
347 ++ subs->data_endpoint->nominal_queue_size >= subs->buffer_bytes;
348 ++
349 ++ if (subs->early_playback_start)
350 ++ ret = start_endpoints(subs);
351 ++
352 + unlock:
353 + snd_usb_unlock_shutdown(chip);
354 + return ret;
355 +@@ -1394,7 +1402,7 @@ static void prepare_playback_urb(struct snd_usb_substream *subs,
356 + subs->trigger_tstamp_pending_update = false;
357 + }
358 +
359 +- if (period_elapsed && !subs->running) {
360 ++ if (period_elapsed && !subs->running && !subs->early_playback_start) {
361 + subs->period_elapsed_pending = 1;
362 + period_elapsed = 0;
363 + }
364 +@@ -1448,7 +1456,8 @@ static int snd_usb_substream_playback_trigger(struct snd_pcm_substream *substrea
365 + prepare_playback_urb,
366 + retire_playback_urb,
367 + subs);
368 +- if (cmd == SNDRV_PCM_TRIGGER_START) {
369 ++ if (!subs->early_playback_start &&
370 ++ cmd == SNDRV_PCM_TRIGGER_START) {
371 + err = start_endpoints(subs);
372 + if (err < 0) {
373 + snd_usb_endpoint_set_callback(subs->data_endpoint,