Skip to content

Commit 96f413f

Browse files
madalinbucurdavem330
authored andcommitted
soc/fsl/qbman: fix issue in qman_delete_cgr_safe()
The wait_for_completion() call in qman_delete_cgr_safe() was triggering a scheduling while atomic bug, replacing the kthread with a smp_call_function_single() call to fix it. Signed-off-by: Madalin Bucur <[email protected]> Signed-off-by: Roy Pledge <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4dcb31d commit 96f413f

File tree

1 file changed

+5
-23
lines changed

1 file changed

+5
-23
lines changed

drivers/soc/fsl/qbman/qman.c

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2443,39 +2443,21 @@ struct cgr_comp {
24432443
struct completion completion;
24442444
};
24452445

2446-
static int qman_delete_cgr_thread(void *p)
2446+
static void qman_delete_cgr_smp_call(void *p)
24472447
{
2448-
struct cgr_comp *cgr_comp = (struct cgr_comp *)p;
2449-
int ret;
2450-
2451-
ret = qman_delete_cgr(cgr_comp->cgr);
2452-
complete(&cgr_comp->completion);
2453-
2454-
return ret;
2448+
qman_delete_cgr((struct qman_cgr *)p);
24552449
}
24562450

24572451
void qman_delete_cgr_safe(struct qman_cgr *cgr)
24582452
{
2459-
struct task_struct *thread;
2460-
struct cgr_comp cgr_comp;
2461-
24622453
preempt_disable();
24632454
if (qman_cgr_cpus[cgr->cgrid] != smp_processor_id()) {
2464-
init_completion(&cgr_comp.completion);
2465-
cgr_comp.cgr = cgr;
2466-
thread = kthread_create(qman_delete_cgr_thread, &cgr_comp,
2467-
"cgr_del");
2468-
2469-
if (IS_ERR(thread))
2470-
goto out;
2471-
2472-
kthread_bind(thread, qman_cgr_cpus[cgr->cgrid]);
2473-
wake_up_process(thread);
2474-
wait_for_completion(&cgr_comp.completion);
2455+
smp_call_function_single(qman_cgr_cpus[cgr->cgrid],
2456+
qman_delete_cgr_smp_call, cgr, true);
24752457
preempt_enable();
24762458
return;
24772459
}
2478-
out:
2460+
24792461
qman_delete_cgr(cgr);
24802462
preempt_enable();
24812463
}

0 commit comments

Comments
 (0)