Contents of /trunk/kernel-alx/patches-5.4/0212-5.4.113-all-fixes.patch
Parent Directory | Revision Log
Revision 3635 -
(show annotations)
(download)
Mon Oct 24 12:34:12 2022 UTC (20 months ago) by niro
File size: 16475 byte(s)
Mon Oct 24 12:34:12 2022 UTC (20 months ago) by niro
File size: 16475 byte(s)
-sync kernel patches
1 | diff --git a/Makefile b/Makefile |
2 | index ba8ee5e806627..7fe00a93c870c 100644 |
3 | --- a/Makefile |
4 | +++ b/Makefile |
5 | @@ -1,7 +1,7 @@ |
6 | # SPDX-License-Identifier: GPL-2.0 |
7 | VERSION = 5 |
8 | PATCHLEVEL = 4 |
9 | -SUBLEVEL = 112 |
10 | +SUBLEVEL = 113 |
11 | EXTRAVERSION = |
12 | NAME = Kleptomaniac Octopus |
13 | |
14 | diff --git a/arch/arm64/include/asm/kvm_arm.h b/arch/arm64/include/asm/kvm_arm.h |
15 | index a4ffd9b55e72c..9be64c0ad31f6 100644 |
16 | --- a/arch/arm64/include/asm/kvm_arm.h |
17 | +++ b/arch/arm64/include/asm/kvm_arm.h |
18 | @@ -276,6 +276,7 @@ |
19 | #define CPTR_EL2_DEFAULT CPTR_EL2_RES1 |
20 | |
21 | /* Hyp Debug Configuration Register bits */ |
22 | +#define MDCR_EL2_TTRF (1 << 19) |
23 | #define MDCR_EL2_TPMS (1 << 14) |
24 | #define MDCR_EL2_E2PB_MASK (UL(0x3)) |
25 | #define MDCR_EL2_E2PB_SHIFT (UL(12)) |
26 | diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c |
27 | index 79caab15ccbf7..acdef8d76c64d 100644 |
28 | --- a/arch/arm64/kernel/cpufeature.c |
29 | +++ b/arch/arm64/kernel/cpufeature.c |
30 | @@ -277,7 +277,6 @@ static const struct arm64_ftr_bits ftr_id_aa64dfr0[] = { |
31 | * of support. |
32 | */ |
33 | S_ARM64_FTR_BITS(FTR_HIDDEN, FTR_NONSTRICT, FTR_EXACT, ID_AA64DFR0_PMUVER_SHIFT, 4, 0), |
34 | - ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_EXACT, ID_AA64DFR0_TRACEVER_SHIFT, 4, 0), |
35 | ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_EXACT, ID_AA64DFR0_DEBUGVER_SHIFT, 4, 0x6), |
36 | ARM64_FTR_END, |
37 | }; |
38 | diff --git a/arch/arm64/kvm/debug.c b/arch/arm64/kvm/debug.c |
39 | index 7a7e425616b54..dbc8905116311 100644 |
40 | --- a/arch/arm64/kvm/debug.c |
41 | +++ b/arch/arm64/kvm/debug.c |
42 | @@ -89,6 +89,7 @@ void kvm_arm_reset_debug_ptr(struct kvm_vcpu *vcpu) |
43 | * - Debug ROM Address (MDCR_EL2_TDRA) |
44 | * - OS related registers (MDCR_EL2_TDOSA) |
45 | * - Statistical profiler (MDCR_EL2_TPMS/MDCR_EL2_E2PB) |
46 | + * - Self-hosted Trace Filter controls (MDCR_EL2_TTRF) |
47 | * |
48 | * Additionally, KVM only traps guest accesses to the debug registers if |
49 | * the guest is not actively using them (see the KVM_ARM64_DEBUG_DIRTY |
50 | @@ -112,6 +113,7 @@ void kvm_arm_setup_debug(struct kvm_vcpu *vcpu) |
51 | vcpu->arch.mdcr_el2 = __this_cpu_read(mdcr_el2) & MDCR_EL2_HPMN_MASK; |
52 | vcpu->arch.mdcr_el2 |= (MDCR_EL2_TPM | |
53 | MDCR_EL2_TPMS | |
54 | + MDCR_EL2_TTRF | |
55 | MDCR_EL2_TPMCR | |
56 | MDCR_EL2_TDRA | |
57 | MDCR_EL2_TDOSA); |
58 | diff --git a/arch/riscv/kernel/entry.S b/arch/riscv/kernel/entry.S |
59 | index 8ca4798311429..9c87ae77ad5d3 100644 |
60 | --- a/arch/riscv/kernel/entry.S |
61 | +++ b/arch/riscv/kernel/entry.S |
62 | @@ -387,6 +387,7 @@ ENTRY(__switch_to) |
63 | ENDPROC(__switch_to) |
64 | |
65 | .section ".rodata" |
66 | + .align LGREG |
67 | /* Exception vector table */ |
68 | ENTRY(excp_vect_table) |
69 | RISCV_PTR do_trap_insn_misaligned |
70 | diff --git a/block/bio.c b/block/bio.c |
71 | index 24704bc2ad6f1..cb38d6f3acceb 100644 |
72 | --- a/block/bio.c |
73 | +++ b/block/bio.c |
74 | @@ -305,7 +305,7 @@ static struct bio *__bio_chain_endio(struct bio *bio) |
75 | { |
76 | struct bio *parent = bio->bi_private; |
77 | |
78 | - if (!parent->bi_status) |
79 | + if (bio->bi_status && !parent->bi_status) |
80 | parent->bi_status = bio->bi_status; |
81 | bio_put(bio); |
82 | return parent; |
83 | diff --git a/drivers/base/dd.c b/drivers/base/dd.c |
84 | index 32823f36cffd0..cf7e5b4afc1be 100644 |
85 | --- a/drivers/base/dd.c |
86 | +++ b/drivers/base/dd.c |
87 | @@ -300,14 +300,16 @@ int driver_deferred_probe_check_state_continue(struct device *dev) |
88 | |
89 | static void deferred_probe_timeout_work_func(struct work_struct *work) |
90 | { |
91 | - struct device_private *private, *p; |
92 | + struct device_private *p; |
93 | |
94 | deferred_probe_timeout = 0; |
95 | driver_deferred_probe_trigger(); |
96 | flush_work(&deferred_probe_work); |
97 | |
98 | - list_for_each_entry_safe(private, p, &deferred_probe_pending_list, deferred_probe) |
99 | - dev_info(private->device, "deferred probe pending"); |
100 | + mutex_lock(&deferred_probe_mutex); |
101 | + list_for_each_entry(p, &deferred_probe_pending_list, deferred_probe) |
102 | + dev_info(p->device, "deferred probe pending\n"); |
103 | + mutex_unlock(&deferred_probe_mutex); |
104 | } |
105 | static DECLARE_DELAYED_WORK(deferred_probe_timeout_work, deferred_probe_timeout_work_func); |
106 | |
107 | diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c |
108 | index d6629fc869f3f..116473c2360aa 100644 |
109 | --- a/drivers/gpu/drm/imx/imx-ldb.c |
110 | +++ b/drivers/gpu/drm/imx/imx-ldb.c |
111 | @@ -197,6 +197,11 @@ static void imx_ldb_encoder_enable(struct drm_encoder *encoder) |
112 | int dual = ldb->ldb_ctrl & LDB_SPLIT_MODE_EN; |
113 | int mux = drm_of_encoder_active_port_id(imx_ldb_ch->child, encoder); |
114 | |
115 | + if (mux < 0 || mux >= ARRAY_SIZE(ldb->clk_sel)) { |
116 | + dev_warn(ldb->dev, "%s: invalid mux %d\n", __func__, mux); |
117 | + return; |
118 | + } |
119 | + |
120 | drm_panel_prepare(imx_ldb_ch->panel); |
121 | |
122 | if (dual) { |
123 | @@ -255,6 +260,11 @@ imx_ldb_encoder_atomic_mode_set(struct drm_encoder *encoder, |
124 | int mux = drm_of_encoder_active_port_id(imx_ldb_ch->child, encoder); |
125 | u32 bus_format = imx_ldb_ch->bus_format; |
126 | |
127 | + if (mux < 0 || mux >= ARRAY_SIZE(ldb->clk_sel)) { |
128 | + dev_warn(ldb->dev, "%s: invalid mux %d\n", __func__, mux); |
129 | + return; |
130 | + } |
131 | + |
132 | if (mode->clock > 170000) { |
133 | dev_warn(ldb->dev, |
134 | "%s: mode exceeds 170 MHz pixel clock\n", __func__); |
135 | diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c |
136 | index fbf57bc3cdaba..617cbe468aec4 100644 |
137 | --- a/drivers/gpu/drm/tegra/dc.c |
138 | +++ b/drivers/gpu/drm/tegra/dc.c |
139 | @@ -1667,6 +1667,11 @@ static void tegra_dc_commit_state(struct tegra_dc *dc, |
140 | dev_err(dc->dev, |
141 | "failed to set clock rate to %lu Hz\n", |
142 | state->pclk); |
143 | + |
144 | + err = clk_set_rate(dc->clk, state->pclk); |
145 | + if (err < 0) |
146 | + dev_err(dc->dev, "failed to set clock %pC to %lu Hz: %d\n", |
147 | + dc->clk, state->pclk, err); |
148 | } |
149 | |
150 | DRM_DEBUG_KMS("rate: %lu, div: %u\n", clk_get_rate(dc->clk), |
151 | @@ -1677,11 +1682,6 @@ static void tegra_dc_commit_state(struct tegra_dc *dc, |
152 | value = SHIFT_CLK_DIVIDER(state->div) | PIXEL_CLK_DIVIDER_PCD1; |
153 | tegra_dc_writel(dc, value, DC_DISP_DISP_CLOCK_CONTROL); |
154 | } |
155 | - |
156 | - err = clk_set_rate(dc->clk, state->pclk); |
157 | - if (err < 0) |
158 | - dev_err(dc->dev, "failed to set clock %pC to %lu Hz: %d\n", |
159 | - dc->clk, state->pclk, err); |
160 | } |
161 | |
162 | static void tegra_dc_stop(struct tegra_dc *dc) |
163 | diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c |
164 | index c498796adc074..e579b3633a842 100644 |
165 | --- a/drivers/interconnect/core.c |
166 | +++ b/drivers/interconnect/core.c |
167 | @@ -704,6 +704,8 @@ int icc_link_destroy(struct icc_node *src, struct icc_node *dst) |
168 | GFP_KERNEL); |
169 | if (new) |
170 | src->links = new; |
171 | + else |
172 | + ret = -ENOMEM; |
173 | |
174 | out: |
175 | mutex_unlock(&icc_lock); |
176 | diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c |
177 | index 883abc46da6e2..9cc77f0397797 100644 |
178 | --- a/drivers/xen/events/events_base.c |
179 | +++ b/drivers/xen/events/events_base.c |
180 | @@ -1783,7 +1783,7 @@ static void lateeoi_ack_dynirq(struct irq_data *data) |
181 | |
182 | if (VALID_EVTCHN(evtchn)) { |
183 | do_mask(info, EVT_MASK_REASON_EOI_PENDING); |
184 | - event_handler_exit(info); |
185 | + ack_dynirq(data); |
186 | } |
187 | } |
188 | |
189 | @@ -1794,7 +1794,7 @@ static void lateeoi_mask_ack_dynirq(struct irq_data *data) |
190 | |
191 | if (VALID_EVTCHN(evtchn)) { |
192 | do_mask(info, EVT_MASK_REASON_EXPLICIT); |
193 | - event_handler_exit(info); |
194 | + ack_dynirq(data); |
195 | } |
196 | } |
197 | |
198 | diff --git a/fs/block_dev.c b/fs/block_dev.c |
199 | index 79272cdbe8277..bd93563477a43 100644 |
200 | --- a/fs/block_dev.c |
201 | +++ b/fs/block_dev.c |
202 | @@ -246,6 +246,8 @@ __blkdev_direct_IO_simple(struct kiocb *iocb, struct iov_iter *iter, |
203 | bio.bi_opf = dio_bio_write_op(iocb); |
204 | task_io_account_write(ret); |
205 | } |
206 | + if (iocb->ki_flags & IOCB_NOWAIT) |
207 | + bio.bi_opf |= REQ_NOWAIT; |
208 | if (iocb->ki_flags & IOCB_HIPRI) |
209 | bio_set_polled(&bio, iocb); |
210 | |
211 | @@ -399,6 +401,8 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages) |
212 | bio->bi_opf = dio_bio_write_op(iocb); |
213 | task_io_account_write(bio->bi_iter.bi_size); |
214 | } |
215 | + if (iocb->ki_flags & IOCB_NOWAIT) |
216 | + bio->bi_opf |= REQ_NOWAIT; |
217 | |
218 | dio->size += bio->bi_iter.bi_size; |
219 | pos += bio->bi_iter.bi_size; |
220 | diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c |
221 | index 50c925d9c6103..9c593fd50c6a5 100644 |
222 | --- a/fs/gfs2/super.c |
223 | +++ b/fs/gfs2/super.c |
224 | @@ -757,11 +757,13 @@ void gfs2_freeze_func(struct work_struct *work) |
225 | static int gfs2_freeze(struct super_block *sb) |
226 | { |
227 | struct gfs2_sbd *sdp = sb->s_fs_info; |
228 | - int error = 0; |
229 | + int error; |
230 | |
231 | mutex_lock(&sdp->sd_freeze_mutex); |
232 | - if (atomic_read(&sdp->sd_freeze_state) != SFS_UNFROZEN) |
233 | + if (atomic_read(&sdp->sd_freeze_state) != SFS_UNFROZEN) { |
234 | + error = -EBUSY; |
235 | goto out; |
236 | + } |
237 | |
238 | if (test_bit(SDF_WITHDRAWN, &sdp->sd_flags)) { |
239 | error = -EINVAL; |
240 | @@ -798,10 +800,10 @@ static int gfs2_unfreeze(struct super_block *sb) |
241 | struct gfs2_sbd *sdp = sb->s_fs_info; |
242 | |
243 | mutex_lock(&sdp->sd_freeze_mutex); |
244 | - if (atomic_read(&sdp->sd_freeze_state) != SFS_FROZEN || |
245 | + if (atomic_read(&sdp->sd_freeze_state) != SFS_FROZEN || |
246 | !gfs2_holder_initialized(&sdp->sd_freeze_gh)) { |
247 | mutex_unlock(&sdp->sd_freeze_mutex); |
248 | - return 0; |
249 | + return -EINVAL; |
250 | } |
251 | |
252 | gfs2_glock_dq_uninit(&sdp->sd_freeze_gh); |
253 | diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c |
254 | index f1f78a742b36a..dc7dac676415e 100644 |
255 | --- a/net/ipv4/netfilter/arp_tables.c |
256 | +++ b/net/ipv4/netfilter/arp_tables.c |
257 | @@ -1196,6 +1196,8 @@ static int translate_compat_table(struct net *net, |
258 | if (!newinfo) |
259 | goto out_unlock; |
260 | |
261 | + memset(newinfo->entries, 0, size); |
262 | + |
263 | newinfo->number = compatr->num_entries; |
264 | for (i = 0; i < NF_ARP_NUMHOOKS; i++) { |
265 | newinfo->hook_entry[i] = compatr->hook_entry[i]; |
266 | diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c |
267 | index 10b91ebdf2131..0076449eea355 100644 |
268 | --- a/net/ipv4/netfilter/ip_tables.c |
269 | +++ b/net/ipv4/netfilter/ip_tables.c |
270 | @@ -1430,6 +1430,8 @@ translate_compat_table(struct net *net, |
271 | if (!newinfo) |
272 | goto out_unlock; |
273 | |
274 | + memset(newinfo->entries, 0, size); |
275 | + |
276 | newinfo->number = compatr->num_entries; |
277 | for (i = 0; i < NF_INET_NUMHOOKS; i++) { |
278 | newinfo->hook_entry[i] = compatr->hook_entry[i]; |
279 | diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c |
280 | index c973ace208c51..8bb543b0e775e 100644 |
281 | --- a/net/ipv6/netfilter/ip6_tables.c |
282 | +++ b/net/ipv6/netfilter/ip6_tables.c |
283 | @@ -1445,6 +1445,8 @@ translate_compat_table(struct net *net, |
284 | if (!newinfo) |
285 | goto out_unlock; |
286 | |
287 | + memset(newinfo->entries, 0, size); |
288 | + |
289 | newinfo->number = compatr->num_entries; |
290 | for (i = 0; i < NF_INET_NUMHOOKS; i++) { |
291 | newinfo->hook_entry[i] = compatr->hook_entry[i]; |
292 | diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c |
293 | index 5c35d64d1f342..9cfee6664040f 100644 |
294 | --- a/net/netfilter/x_tables.c |
295 | +++ b/net/netfilter/x_tables.c |
296 | @@ -733,7 +733,7 @@ void xt_compat_match_from_user(struct xt_entry_match *m, void **dstptr, |
297 | { |
298 | const struct xt_match *match = m->u.kernel.match; |
299 | struct compat_xt_entry_match *cm = (struct compat_xt_entry_match *)m; |
300 | - int pad, off = xt_compat_match_offset(match); |
301 | + int off = xt_compat_match_offset(match); |
302 | u_int16_t msize = cm->u.user.match_size; |
303 | char name[sizeof(m->u.user.name)]; |
304 | |
305 | @@ -743,9 +743,6 @@ void xt_compat_match_from_user(struct xt_entry_match *m, void **dstptr, |
306 | match->compat_from_user(m->data, cm->data); |
307 | else |
308 | memcpy(m->data, cm->data, msize - sizeof(*cm)); |
309 | - pad = XT_ALIGN(match->matchsize) - match->matchsize; |
310 | - if (pad > 0) |
311 | - memset(m->data + match->matchsize, 0, pad); |
312 | |
313 | msize += off; |
314 | m->u.user.match_size = msize; |
315 | @@ -1116,7 +1113,7 @@ void xt_compat_target_from_user(struct xt_entry_target *t, void **dstptr, |
316 | { |
317 | const struct xt_target *target = t->u.kernel.target; |
318 | struct compat_xt_entry_target *ct = (struct compat_xt_entry_target *)t; |
319 | - int pad, off = xt_compat_target_offset(target); |
320 | + int off = xt_compat_target_offset(target); |
321 | u_int16_t tsize = ct->u.user.target_size; |
322 | char name[sizeof(t->u.user.name)]; |
323 | |
324 | @@ -1126,9 +1123,6 @@ void xt_compat_target_from_user(struct xt_entry_target *t, void **dstptr, |
325 | target->compat_from_user(t->data, ct->data); |
326 | else |
327 | memcpy(t->data, ct->data, tsize - sizeof(*ct)); |
328 | - pad = XT_ALIGN(target->targetsize) - target->targetsize; |
329 | - if (pad > 0) |
330 | - memset(t->data + target->targetsize, 0, pad); |
331 | |
332 | tsize += off; |
333 | t->u.user.target_size = tsize; |
334 | diff --git a/tools/perf/util/expr.y b/tools/perf/util/expr.y |
335 | index f9a20a39b64ad..7d226241f1d77 100644 |
336 | --- a/tools/perf/util/expr.y |
337 | +++ b/tools/perf/util/expr.y |
338 | @@ -12,7 +12,8 @@ |
339 | #define MAXIDLEN 256 |
340 | %} |
341 | |
342 | -%pure-parser |
343 | +%define api.pure full |
344 | + |
345 | %parse-param { double *final_val } |
346 | %parse-param { struct parse_ctx *ctx } |
347 | %parse-param { const char **pp } |
348 | diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c |
349 | index 4b07b1cc22dc8..571e99c908a0e 100644 |
350 | --- a/tools/perf/util/map.c |
351 | +++ b/tools/perf/util/map.c |
352 | @@ -93,8 +93,7 @@ static inline bool replace_android_lib(const char *filename, char *newfilename) |
353 | if (!strncmp(filename, "/system/lib/", 12)) { |
354 | char *ndk, *app; |
355 | const char *arch; |
356 | - size_t ndk_length; |
357 | - size_t app_length; |
358 | + int ndk_length, app_length; |
359 | |
360 | ndk = getenv("NDK_ROOT"); |
361 | app = getenv("APP_PLATFORM"); |
362 | @@ -122,8 +121,8 @@ static inline bool replace_android_lib(const char *filename, char *newfilename) |
363 | if (new_length > PATH_MAX) |
364 | return false; |
365 | snprintf(newfilename, new_length, |
366 | - "%s/platforms/%s/arch-%s/usr/lib/%s", |
367 | - ndk, app, arch, libname); |
368 | + "%.*s/platforms/%.*s/arch-%s/usr/lib/%s", |
369 | + ndk_length, ndk, app_length, app, arch, libname); |
370 | |
371 | return true; |
372 | } |
373 | diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y |
374 | index 48126ae4cd13f..776d77093a195 100644 |
375 | --- a/tools/perf/util/parse-events.y |
376 | +++ b/tools/perf/util/parse-events.y |
377 | @@ -1,4 +1,4 @@ |
378 | -%pure-parser |
379 | +%define api.pure full |
380 | %parse-param {void *_parse_state} |
381 | %parse-param {void *scanner} |
382 | %lex-param {void* scanner} |
383 | diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c |
384 | index b21a4b1918db5..56f3039fe2a71 100644 |
385 | --- a/tools/perf/util/session.c |
386 | +++ b/tools/perf/util/session.c |
387 | @@ -88,7 +88,7 @@ static int perf_session__process_compressed_event(struct perf_session *session, |
388 | session->decomp_last = decomp; |
389 | } |
390 | |
391 | - pr_debug("decomp (B): %ld to %ld\n", src_size, decomp_size); |
392 | + pr_debug("decomp (B): %zd to %zd\n", src_size, decomp_size); |
393 | |
394 | return 0; |
395 | } |
396 | diff --git a/tools/perf/util/zstd.c b/tools/perf/util/zstd.c |
397 | index d2202392ffdbb..48dd2b018c47a 100644 |
398 | --- a/tools/perf/util/zstd.c |
399 | +++ b/tools/perf/util/zstd.c |
400 | @@ -99,7 +99,7 @@ size_t zstd_decompress_stream(struct zstd_data *data, void *src, size_t src_size |
401 | while (input.pos < input.size) { |
402 | ret = ZSTD_decompressStream(data->dstream, &output, &input); |
403 | if (ZSTD_isError(ret)) { |
404 | - pr_err("failed to decompress (B): %ld -> %ld, dst_size %ld : %s\n", |
405 | + pr_err("failed to decompress (B): %zd -> %zd, dst_size %zd : %s\n", |
406 | src_size, output.size, dst_size, ZSTD_getErrorName(ret)); |
407 | break; |
408 | } |
409 | diff --git a/tools/testing/radix-tree/idr-test.c b/tools/testing/radix-tree/idr-test.c |
410 | index 3b796dd5e5772..6ce7460f3c7a9 100644 |
411 | --- a/tools/testing/radix-tree/idr-test.c |
412 | +++ b/tools/testing/radix-tree/idr-test.c |
413 | @@ -301,16 +301,20 @@ void idr_find_test_1(int anchor_id, int throbber_id) |
414 | pthread_t throbber; |
415 | time_t start = time(NULL); |
416 | |
417 | - pthread_create(&throbber, NULL, idr_throbber, &throbber_id); |
418 | - |
419 | BUG_ON(idr_alloc(&find_idr, xa_mk_value(anchor_id), anchor_id, |
420 | anchor_id + 1, GFP_KERNEL) != anchor_id); |
421 | |
422 | + pthread_create(&throbber, NULL, idr_throbber, &throbber_id); |
423 | + |
424 | + rcu_read_lock(); |
425 | do { |
426 | int id = 0; |
427 | void *entry = idr_get_next(&find_idr, &id); |
428 | + rcu_read_unlock(); |
429 | BUG_ON(entry != xa_mk_value(id)); |
430 | + rcu_read_lock(); |
431 | } while (time(NULL) < start + 11); |
432 | + rcu_read_unlock(); |
433 | |
434 | pthread_join(throbber, NULL); |
435 | |
436 | @@ -577,6 +581,7 @@ void ida_tests(void) |
437 | |
438 | int __weak main(void) |
439 | { |
440 | + rcu_register_thread(); |
441 | radix_tree_init(); |
442 | idr_checks(); |
443 | ida_tests(); |
444 | @@ -584,5 +589,6 @@ int __weak main(void) |
445 | rcu_barrier(); |
446 | if (nr_allocated) |
447 | printf("nr_allocated = %d\n", nr_allocated); |
448 | + rcu_unregister_thread(); |
449 | return 0; |
450 | } |
451 | diff --git a/tools/testing/radix-tree/multiorder.c b/tools/testing/radix-tree/multiorder.c |
452 | index 9eae0fb5a67d1..e00520cc63498 100644 |
453 | --- a/tools/testing/radix-tree/multiorder.c |
454 | +++ b/tools/testing/radix-tree/multiorder.c |
455 | @@ -224,7 +224,9 @@ void multiorder_checks(void) |
456 | |
457 | int __weak main(void) |
458 | { |
459 | + rcu_register_thread(); |
460 | radix_tree_init(); |
461 | multiorder_checks(); |
462 | + rcu_unregister_thread(); |
463 | return 0; |
464 | } |
465 | diff --git a/tools/testing/radix-tree/xarray.c b/tools/testing/radix-tree/xarray.c |
466 | index e61e43efe463c..f20e12cbbfd40 100644 |
467 | --- a/tools/testing/radix-tree/xarray.c |
468 | +++ b/tools/testing/radix-tree/xarray.c |
469 | @@ -25,11 +25,13 @@ void xarray_tests(void) |
470 | |
471 | int __weak main(void) |
472 | { |
473 | + rcu_register_thread(); |
474 | radix_tree_init(); |
475 | xarray_tests(); |
476 | radix_tree_cpu_dead(1); |
477 | rcu_barrier(); |
478 | if (nr_allocated) |
479 | printf("nr_allocated = %d\n", nr_allocated); |
480 | + rcu_unregister_thread(); |
481 | return 0; |
482 | } |