Magellan Linux

Contents of /trunk/kernel-alx/patches-5.4/0313-5.4.214-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3637 - (show annotations) (download)
Mon Oct 24 12:40:44 2022 UTC (18 months ago) by niro
File size: 13957 byte(s)
-add missing
1 diff --git a/Documentation/input/joydev/joystick.rst b/Documentation/input/joydev/joystick.rst
2 index 9746fd76cc581..f38c330c028e5 100644
3 --- a/Documentation/input/joydev/joystick.rst
4 +++ b/Documentation/input/joydev/joystick.rst
5 @@ -517,6 +517,7 @@ All I-Force devices are supported by the iforce module. This includes:
6 * AVB Mag Turbo Force
7 * AVB Top Shot Pegasus
8 * AVB Top Shot Force Feedback Racing Wheel
9 +* Boeder Force Feedback Wheel
10 * Logitech WingMan Force
11 * Logitech WingMan Force Wheel
12 * Guillemot Race Leader Force Feedback
13 diff --git a/Makefile b/Makefile
14 index 4a4c83d2b3f7c..59f34d7f6f3b2 100644
15 --- a/Makefile
16 +++ b/Makefile
17 @@ -1,7 +1,7 @@
18 # SPDX-License-Identifier: GPL-2.0
19 VERSION = 5
20 PATCHLEVEL = 4
21 -SUBLEVEL = 213
22 +SUBLEVEL = 214
23 EXTRAVERSION =
24 NAME = Kleptomaniac Octopus
25
26 diff --git a/drivers/gpu/drm/msm/msm_rd.c b/drivers/gpu/drm/msm/msm_rd.c
27 index c7832a951039f..a6b024b06b363 100644
28 --- a/drivers/gpu/drm/msm/msm_rd.c
29 +++ b/drivers/gpu/drm/msm/msm_rd.c
30 @@ -191,6 +191,9 @@ static int rd_open(struct inode *inode, struct file *file)
31 file->private_data = rd;
32 rd->open = true;
33
34 + /* Reset fifo to clear any previously unread data: */
35 + rd->fifo.head = rd->fifo.tail = 0;
36 +
37 /* the parsing tools need to know gpu-id to know which
38 * register database to load.
39 */
40 diff --git a/drivers/hid/intel-ish-hid/ishtp-hid.h b/drivers/hid/intel-ish-hid/ishtp-hid.h
41 index 5ffd0da3cf1fa..65af0ebef79f6 100644
42 --- a/drivers/hid/intel-ish-hid/ishtp-hid.h
43 +++ b/drivers/hid/intel-ish-hid/ishtp-hid.h
44 @@ -110,7 +110,7 @@ struct report_list {
45 * @multi_packet_cnt: Count of fragmented packet count
46 *
47 * This structure is used to store completion flags and per client data like
48 - * like report description, number of HID devices etc.
49 + * report description, number of HID devices etc.
50 */
51 struct ishtp_cl_data {
52 /* completion flags */
53 diff --git a/drivers/hid/intel-ish-hid/ishtp/client.c b/drivers/hid/intel-ish-hid/ishtp/client.c
54 index 1cc157126fce7..c0d69303e3b09 100644
55 --- a/drivers/hid/intel-ish-hid/ishtp/client.c
56 +++ b/drivers/hid/intel-ish-hid/ishtp/client.c
57 @@ -626,13 +626,14 @@ static void ishtp_cl_read_complete(struct ishtp_cl_rb *rb)
58 }
59
60 /**
61 - * ipc_tx_callback() - IPC tx callback function
62 + * ipc_tx_send() - IPC tx send function
63 * @prm: Pointer to client device instance
64 *
65 - * Send message over IPC either first time or on callback on previous message
66 - * completion
67 + * Send message over IPC. Message will be split into fragments
68 + * if message size is bigger than IPC FIFO size, and all
69 + * fragments will be sent one by one.
70 */
71 -static void ipc_tx_callback(void *prm)
72 +static void ipc_tx_send(void *prm)
73 {
74 struct ishtp_cl *cl = prm;
75 struct ishtp_cl_tx_ring *cl_msg;
76 @@ -677,32 +678,41 @@ static void ipc_tx_callback(void *prm)
77 list);
78 rem = cl_msg->send_buf.size - cl->tx_offs;
79
80 - ishtp_hdr.host_addr = cl->host_client_id;
81 - ishtp_hdr.fw_addr = cl->fw_client_id;
82 - ishtp_hdr.reserved = 0;
83 - pmsg = cl_msg->send_buf.data + cl->tx_offs;
84 + while (rem > 0) {
85 + ishtp_hdr.host_addr = cl->host_client_id;
86 + ishtp_hdr.fw_addr = cl->fw_client_id;
87 + ishtp_hdr.reserved = 0;
88 + pmsg = cl_msg->send_buf.data + cl->tx_offs;
89 +
90 + if (rem <= dev->mtu) {
91 + /* Last fragment or only one packet */
92 + ishtp_hdr.length = rem;
93 + ishtp_hdr.msg_complete = 1;
94 + /* Submit to IPC queue with no callback */
95 + ishtp_write_message(dev, &ishtp_hdr, pmsg);
96 + cl->tx_offs = 0;
97 + cl->sending = 0;
98
99 - if (rem <= dev->mtu) {
100 - ishtp_hdr.length = rem;
101 - ishtp_hdr.msg_complete = 1;
102 - cl->sending = 0;
103 - list_del_init(&cl_msg->list); /* Must be before write */
104 - spin_unlock_irqrestore(&cl->tx_list_spinlock, tx_flags);
105 - /* Submit to IPC queue with no callback */
106 - ishtp_write_message(dev, &ishtp_hdr, pmsg);
107 - spin_lock_irqsave(&cl->tx_free_list_spinlock, tx_free_flags);
108 - list_add_tail(&cl_msg->list, &cl->tx_free_list.list);
109 - ++cl->tx_ring_free_size;
110 - spin_unlock_irqrestore(&cl->tx_free_list_spinlock,
111 - tx_free_flags);
112 - } else {
113 - /* Send IPC fragment */
114 - spin_unlock_irqrestore(&cl->tx_list_spinlock, tx_flags);
115 - cl->tx_offs += dev->mtu;
116 - ishtp_hdr.length = dev->mtu;
117 - ishtp_hdr.msg_complete = 0;
118 - ishtp_send_msg(dev, &ishtp_hdr, pmsg, ipc_tx_callback, cl);
119 + break;
120 + } else {
121 + /* Send ipc fragment */
122 + ishtp_hdr.length = dev->mtu;
123 + ishtp_hdr.msg_complete = 0;
124 + /* All fregments submitted to IPC queue with no callback */
125 + ishtp_write_message(dev, &ishtp_hdr, pmsg);
126 + cl->tx_offs += dev->mtu;
127 + rem = cl_msg->send_buf.size - cl->tx_offs;
128 + }
129 }
130 +
131 + list_del_init(&cl_msg->list);
132 + spin_unlock_irqrestore(&cl->tx_list_spinlock, tx_flags);
133 +
134 + spin_lock_irqsave(&cl->tx_free_list_spinlock, tx_free_flags);
135 + list_add_tail(&cl_msg->list, &cl->tx_free_list.list);
136 + ++cl->tx_ring_free_size;
137 + spin_unlock_irqrestore(&cl->tx_free_list_spinlock,
138 + tx_free_flags);
139 }
140
141 /**
142 @@ -720,7 +730,7 @@ static void ishtp_cl_send_msg_ipc(struct ishtp_device *dev,
143 return;
144
145 cl->tx_offs = 0;
146 - ipc_tx_callback(cl);
147 + ipc_tx_send(cl);
148 ++cl->send_msg_cnt_ipc;
149 }
150
151 diff --git a/drivers/input/joystick/iforce/iforce-main.c b/drivers/input/joystick/iforce/iforce-main.c
152 index b2a68bc9f0b4d..b86de1312512b 100644
153 --- a/drivers/input/joystick/iforce/iforce-main.c
154 +++ b/drivers/input/joystick/iforce/iforce-main.c
155 @@ -50,6 +50,7 @@ static struct iforce_device iforce_device[] = {
156 { 0x046d, 0xc291, "Logitech WingMan Formula Force", btn_wheel, abs_wheel, ff_iforce },
157 { 0x05ef, 0x020a, "AVB Top Shot Pegasus", btn_joystick_avb, abs_avb_pegasus, ff_iforce },
158 { 0x05ef, 0x8884, "AVB Mag Turbo Force", btn_wheel, abs_wheel, ff_iforce },
159 + { 0x05ef, 0x8886, "Boeder Force Feedback Wheel", btn_wheel, abs_wheel, ff_iforce },
160 { 0x05ef, 0x8888, "AVB Top Shot Force Feedback Racing Wheel", btn_wheel, abs_wheel, ff_iforce }, //?
161 { 0x061c, 0xc0a4, "ACT LABS Force RS", btn_wheel, abs_wheel, ff_iforce }, //?
162 { 0x061c, 0xc084, "ACT LABS Force RS", btn_wheel, abs_wheel, ff_iforce },
163 diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
164 index 70bd79dc43f2e..a9962474d551d 100644
165 --- a/drivers/net/ethernet/broadcom/tg3.c
166 +++ b/drivers/net/ethernet/broadcom/tg3.c
167 @@ -18154,16 +18154,20 @@ static void tg3_shutdown(struct pci_dev *pdev)
168 struct net_device *dev = pci_get_drvdata(pdev);
169 struct tg3 *tp = netdev_priv(dev);
170
171 + tg3_reset_task_cancel(tp);
172 +
173 rtnl_lock();
174 +
175 netif_device_detach(dev);
176
177 if (netif_running(dev))
178 dev_close(dev);
179
180 - if (system_state == SYSTEM_POWER_OFF)
181 - tg3_power_down(tp);
182 + tg3_power_down(tp);
183
184 rtnl_unlock();
185 +
186 + pci_disable_device(pdev);
187 }
188
189 /**
190 diff --git a/drivers/net/ieee802154/cc2520.c b/drivers/net/ieee802154/cc2520.c
191 index 43506948e444d..0432a4f829a98 100644
192 --- a/drivers/net/ieee802154/cc2520.c
193 +++ b/drivers/net/ieee802154/cc2520.c
194 @@ -507,6 +507,7 @@ cc2520_tx(struct ieee802154_hw *hw, struct sk_buff *skb)
195 goto err_tx;
196
197 if (status & CC2520_STATUS_TX_UNDERFLOW) {
198 + rc = -EINVAL;
199 dev_err(&priv->spi->dev, "cc2520 tx underflow exception\n");
200 goto err_tx;
201 }
202 diff --git a/drivers/net/phy/dp83822.c b/drivers/net/phy/dp83822.c
203 index cc1522550f2c4..da3983352dd44 100644
204 --- a/drivers/net/phy/dp83822.c
205 +++ b/drivers/net/phy/dp83822.c
206 @@ -197,8 +197,7 @@ static int dp83822_config_intr(struct phy_device *phydev)
207 if (misr_status < 0)
208 return misr_status;
209
210 - misr_status |= (DP83822_RX_ERR_HF_INT_EN |
211 - DP83822_ANEG_COMPLETE_INT_EN |
212 + misr_status |= (DP83822_ANEG_COMPLETE_INT_EN |
213 DP83822_DUP_MODE_CHANGE_INT_EN |
214 DP83822_SPEED_CHANGED_INT_EN |
215 DP83822_LINK_STAT_INT_EN |
216 diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c
217 index e9512d077b8a8..eb5b39c2bba84 100644
218 --- a/drivers/nvme/target/tcp.c
219 +++ b/drivers/nvme/target/tcp.c
220 @@ -1416,6 +1416,9 @@ static void nvmet_tcp_state_change(struct sock *sk)
221 goto done;
222
223 switch (sk->sk_state) {
224 + case TCP_FIN_WAIT2:
225 + case TCP_LAST_ACK:
226 + break;
227 case TCP_FIN_WAIT1:
228 case TCP_CLOSE_WAIT:
229 case TCP_CLOSE:
230 diff --git a/drivers/perf/arm_pmu_platform.c b/drivers/perf/arm_pmu_platform.c
231 index e35cb76c8d104..6eb077db7384d 100644
232 --- a/drivers/perf/arm_pmu_platform.c
233 +++ b/drivers/perf/arm_pmu_platform.c
234 @@ -118,7 +118,7 @@ static int pmu_parse_irqs(struct arm_pmu *pmu)
235
236 if (num_irqs == 1) {
237 int irq = platform_get_irq(pdev, 0);
238 - if (irq && irq_is_percpu_devid(irq))
239 + if ((irq > 0) && irq_is_percpu_devid(irq))
240 return pmu_parse_percpu_irq(pmu, irq);
241 }
242
243 diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
244 index d27a564389a47..e88bd54ff8bd6 100644
245 --- a/drivers/platform/x86/acer-wmi.c
246 +++ b/drivers/platform/x86/acer-wmi.c
247 @@ -93,6 +93,7 @@ static const struct key_entry acer_wmi_keymap[] __initconst = {
248 {KE_KEY, 0x22, {KEY_PROG2} }, /* Arcade */
249 {KE_KEY, 0x23, {KEY_PROG3} }, /* P_Key */
250 {KE_KEY, 0x24, {KEY_PROG4} }, /* Social networking_Key */
251 + {KE_KEY, 0x27, {KEY_HELP} },
252 {KE_KEY, 0x29, {KEY_PROG3} }, /* P_Key for TM8372 */
253 {KE_IGNORE, 0x41, {KEY_MUTE} },
254 {KE_IGNORE, 0x42, {KEY_PREVIOUSSONG} },
255 @@ -106,7 +107,13 @@ static const struct key_entry acer_wmi_keymap[] __initconst = {
256 {KE_IGNORE, 0x48, {KEY_VOLUMEUP} },
257 {KE_IGNORE, 0x49, {KEY_VOLUMEDOWN} },
258 {KE_IGNORE, 0x4a, {KEY_VOLUMEDOWN} },
259 - {KE_IGNORE, 0x61, {KEY_SWITCHVIDEOMODE} },
260 + /*
261 + * 0x61 is KEY_SWITCHVIDEOMODE. Usually this is a duplicate input event
262 + * with the "Video Bus" input device events. But sometimes it is not
263 + * a dup. Map it to KEY_UNKNOWN instead of using KE_IGNORE so that
264 + * udev/hwdb can override it on systems where it is not a dup.
265 + */
266 + {KE_KEY, 0x61, {KEY_UNKNOWN} },
267 {KE_IGNORE, 0x62, {KEY_BRIGHTNESSUP} },
268 {KE_IGNORE, 0x63, {KEY_BRIGHTNESSDOWN} },
269 {KE_KEY, 0x64, {KEY_SWITCHVIDEOMODE} }, /* Display Switch */
270 diff --git a/drivers/soc/fsl/Kconfig b/drivers/soc/fsl/Kconfig
271 index f9ad8ad54a7d6..df062477dab05 100644
272 --- a/drivers/soc/fsl/Kconfig
273 +++ b/drivers/soc/fsl/Kconfig
274 @@ -24,6 +24,7 @@ config FSL_MC_DPIO
275 tristate "QorIQ DPAA2 DPIO driver"
276 depends on FSL_MC_BUS
277 select SOC_BUS
278 + select FSL_GUTS
279 help
280 Driver for the DPAA2 DPIO object. A DPIO provides queue and
281 buffer management facilities for software to interact with
282 diff --git a/drivers/usb/storage/unusual_uas.h b/drivers/usb/storage/unusual_uas.h
283 index 2f72753c3e225..0b37c8e550e7d 100644
284 --- a/drivers/usb/storage/unusual_uas.h
285 +++ b/drivers/usb/storage/unusual_uas.h
286 @@ -62,6 +62,13 @@ UNUSUAL_DEV(0x0984, 0x0301, 0x0128, 0x0128,
287 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
288 US_FL_IGNORE_UAS),
289
290 +/* Reported-by: Tom Hu <huxiaoying@kylinos.cn> */
291 +UNUSUAL_DEV(0x0b05, 0x1932, 0x0000, 0x9999,
292 + "ASUS",
293 + "External HDD",
294 + USB_SC_DEVICE, USB_PR_DEVICE, NULL,
295 + US_FL_IGNORE_UAS),
296 +
297 /* Reported-by: David Webb <djw@noc.ac.uk> */
298 UNUSUAL_DEV(0x0bc2, 0x331a, 0x0000, 0x9999,
299 "Seagate",
300 diff --git a/fs/tracefs/inode.c b/fs/tracefs/inode.c
301 index 7878f145bf1bf..8fbf8658644f0 100644
302 --- a/fs/tracefs/inode.c
303 +++ b/fs/tracefs/inode.c
304 @@ -139,6 +139,8 @@ struct tracefs_mount_opts {
305 kuid_t uid;
306 kgid_t gid;
307 umode_t mode;
308 + /* Opt_* bitfield. */
309 + unsigned int opts;
310 };
311
312 enum {
313 @@ -239,6 +241,7 @@ static int tracefs_parse_options(char *data, struct tracefs_mount_opts *opts)
314 kgid_t gid;
315 char *p;
316
317 + opts->opts = 0;
318 opts->mode = TRACEFS_DEFAULT_MODE;
319
320 while ((p = strsep(&data, ",")) != NULL) {
321 @@ -273,24 +276,36 @@ static int tracefs_parse_options(char *data, struct tracefs_mount_opts *opts)
322 * but traditionally tracefs has ignored all mount options
323 */
324 }
325 +
326 + opts->opts |= BIT(token);
327 }
328
329 return 0;
330 }
331
332 -static int tracefs_apply_options(struct super_block *sb)
333 +static int tracefs_apply_options(struct super_block *sb, bool remount)
334 {
335 struct tracefs_fs_info *fsi = sb->s_fs_info;
336 struct inode *inode = sb->s_root->d_inode;
337 struct tracefs_mount_opts *opts = &fsi->mount_opts;
338
339 - inode->i_mode &= ~S_IALLUGO;
340 - inode->i_mode |= opts->mode;
341 + /*
342 + * On remount, only reset mode/uid/gid if they were provided as mount
343 + * options.
344 + */
345 +
346 + if (!remount || opts->opts & BIT(Opt_mode)) {
347 + inode->i_mode &= ~S_IALLUGO;
348 + inode->i_mode |= opts->mode;
349 + }
350
351 - inode->i_uid = opts->uid;
352 + if (!remount || opts->opts & BIT(Opt_uid))
353 + inode->i_uid = opts->uid;
354
355 - /* Set all the group ids to the mount option */
356 - set_gid(sb->s_root, opts->gid);
357 + if (!remount || opts->opts & BIT(Opt_gid)) {
358 + /* Set all the group ids to the mount option */
359 + set_gid(sb->s_root, opts->gid);
360 + }
361
362 return 0;
363 }
364 @@ -305,7 +320,7 @@ static int tracefs_remount(struct super_block *sb, int *flags, char *data)
365 if (err)
366 goto fail;
367
368 - tracefs_apply_options(sb);
369 + tracefs_apply_options(sb, true);
370
371 fail:
372 return err;
373 @@ -357,7 +372,7 @@ static int trace_fill_super(struct super_block *sb, void *data, int silent)
374
375 sb->s_op = &tracefs_super_operations;
376
377 - tracefs_apply_options(sb);
378 + tracefs_apply_options(sb, false);
379
380 return 0;
381
382 diff --git a/mm/mmap.c b/mm/mmap.c
383 index e8cf6f88933c3..eeebbb20accfe 100644
384 --- a/mm/mmap.c
385 +++ b/mm/mmap.c
386 @@ -2605,6 +2605,7 @@ static void unmap_region(struct mm_struct *mm,
387 {
388 struct vm_area_struct *next = prev ? prev->vm_next : mm->mmap;
389 struct mmu_gather tlb;
390 + struct vm_area_struct *cur_vma;
391
392 lru_add_drain();
393 tlb_gather_mmu(&tlb, mm, start, end);
394 @@ -2619,8 +2620,12 @@ static void unmap_region(struct mm_struct *mm,
395 * concurrent flush in this region has to be coming through the rmap,
396 * and we synchronize against that using the rmap lock.
397 */
398 - if ((vma->vm_flags & (VM_PFNMAP|VM_MIXEDMAP)) != 0)
399 - tlb_flush_mmu(&tlb);
400 + for (cur_vma = vma; cur_vma; cur_vma = cur_vma->vm_next) {
401 + if ((cur_vma->vm_flags & (VM_PFNMAP|VM_MIXEDMAP)) != 0) {
402 + tlb_flush_mmu(&tlb);
403 + break;
404 + }
405 + }
406
407 free_pgtables(&tlb, vma, prev ? prev->vm_end : FIRST_USER_ADDRESS,
408 next ? next->vm_start : USER_PGTABLES_CEILING);