Commit 332fe51
committed
ice: make writes to /dev/gnssX synchronous
jira LE-1907
Rebuild_History Non-Buildable kernel-rt-5.14.0-284.30.1.rt14.315.el9_2
commit-author Michal Schmidt <mschmidt@redhat.com>
commit bf15bb3
The current ice driver's GNSS write implementation buffers writes and
works through them asynchronously in a kthread. That's bad because:
- The GNSS write_raw operation is supposed to be synchronous[1][2].
- There is no upper bound on the number of pending writes.
Userspace can submit writes much faster than the driver can process,
consuming unlimited amounts of kernel memory.
A patch that's currently on review[3] ("[v3,net] ice: Write all GNSS
buffers instead of first one") would add one more problem:
- The possibility of waiting for a very long time to flush the write
work when doing rmmod, softlockups.
To fix these issues, simplify the implementation: Drop the buffering,
the write_work, and make the writes synchronous.
I tested this with gpsd and ubxtool.
[1] https://events19.linuxfoundation.org/wp-content/uploads/2017/12/The-GNSS-Subsystem-Johan-Hovold-Hovold-Consulting-AB.pdf
"User interface" slide.
[2] A comment in drivers/gnss/core.c:gnss_write():
/* Ignoring O_NONBLOCK, write_raw() is synchronous. */
[3] https://patchwork.ozlabs.org/project/intel-wired-lan/patch/20230217120541.16745-1-karol.kolacinski@intel.com/
Fixes: d6b98c8 ("ice: add write functionality for GNSS TTY")
Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Tested-by: Sunitha Mekala <sunithax.d.mekala@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit bf15bb3)
Signed-off-by: Jonathan Maple <jmaple@ciq.com>1 parent f2b3f6a commit 332fe51
File tree
4 files changed
+6
-72
lines changed- drivers/net/ethernet/intel/ice
4 files changed
+6
-72
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4979 | 4979 | | |
4980 | 4980 | | |
4981 | 4981 | | |
4982 | | - | |
| 4982 | + | |
4983 | 4983 | | |
4984 | 4984 | | |
4985 | 4985 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
| 228 | + | |
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
| 19 | + | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
| 75 | + | |
108 | 76 | | |
109 | 77 | | |
110 | 78 | | |
| |||
220 | 188 | | |
221 | 189 | | |
222 | 190 | | |
223 | | - | |
224 | | - | |
225 | 191 | | |
226 | 192 | | |
227 | 193 | | |
| |||
281 | 247 | | |
282 | 248 | | |
283 | 249 | | |
284 | | - | |
285 | 250 | | |
286 | 251 | | |
287 | 252 | | |
| |||
300 | 265 | | |
301 | 266 | | |
302 | 267 | | |
303 | | - | |
304 | 268 | | |
305 | | - | |
306 | | - | |
307 | 269 | | |
308 | 270 | | |
309 | 271 | | |
| |||
319 | 281 | | |
320 | 282 | | |
321 | 283 | | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
| 284 | + | |
340 | 285 | | |
341 | 286 | | |
342 | 287 | | |
| |||
432 | 377 | | |
433 | 378 | | |
434 | 379 | | |
435 | | - | |
436 | 380 | | |
437 | 381 | | |
438 | 382 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | 25 | | |
32 | 26 | | |
33 | 27 | | |
34 | 28 | | |
35 | 29 | | |
36 | | - | |
37 | | - | |
38 | 30 | | |
39 | 31 | | |
40 | 32 | | |
41 | 33 | | |
42 | 34 | | |
43 | | - | |
44 | | - | |
45 | 35 | | |
46 | 36 | | |
47 | 37 | | |
| |||
0 commit comments