From: Madalin Bucur <madalin.bucur@nxp.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
camelia.groza@nxp.com, leoyang.li@nxp.com,
linuxppc-dev@lists.ozlabs.org,
linux-arm-kernel@lists.infradead.org,
Madalin Bucur <madalin.bucur@nxp.com>,
Roy Pledge <roy.pledge@nxp.com>
Subject: [PATCH 1/5] soc/fsl/qbman: fix issue in qman_delete_cgr_safe()
Date: Wed, 14 Mar 2018 08:37:28 -0500 [thread overview]
Message-ID: <20180314133732.24068-2-madalin.bucur@nxp.com> (raw)
In-Reply-To: <20180314133732.24068-1-madalin.bucur@nxp.com>
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 <madalin.bucur@nxp.com>
Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
---
drivers/soc/fsl/qbman/qman.c | 28 +++++-----------------------
1 file changed, 5 insertions(+), 23 deletions(-)
diff --git a/drivers/soc/fsl/qbman/qman.c b/drivers/soc/fsl/qbman/qman.c
index e4f5bb0..ba3cfa8 100644
--- a/drivers/soc/fsl/qbman/qman.c
+++ b/drivers/soc/fsl/qbman/qman.c
@@ -2443,39 +2443,21 @@ struct cgr_comp {
struct completion completion;
};
-static int qman_delete_cgr_thread(void *p)
+static void qman_delete_cgr_smp_call(void *p)
{
- struct cgr_comp *cgr_comp = (struct cgr_comp *)p;
- int ret;
-
- ret = qman_delete_cgr(cgr_comp->cgr);
- complete(&cgr_comp->completion);
-
- return ret;
+ qman_delete_cgr((struct qman_cgr *)p);
}
void qman_delete_cgr_safe(struct qman_cgr *cgr)
{
- struct task_struct *thread;
- struct cgr_comp cgr_comp;
-
preempt_disable();
if (qman_cgr_cpus[cgr->cgrid] != smp_processor_id()) {
- init_completion(&cgr_comp.completion);
- cgr_comp.cgr = cgr;
- thread = kthread_create(qman_delete_cgr_thread, &cgr_comp,
- "cgr_del");
-
- if (IS_ERR(thread))
- goto out;
-
- kthread_bind(thread, qman_cgr_cpus[cgr->cgrid]);
- wake_up_process(thread);
- wait_for_completion(&cgr_comp.completion);
+ smp_call_function_single(qman_cgr_cpus[cgr->cgrid],
+ qman_delete_cgr_smp_call, cgr, true);
preempt_enable();
return;
}
-out:
+
qman_delete_cgr(cgr);
preempt_enable();
}
--
2.1.0
next prev parent reply other threads:[~2018-03-14 13:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-14 13:37 [PATCH 0/5] DPAA Ethernet fixes Madalin Bucur
2018-03-14 13:37 ` Madalin Bucur [this message]
2018-03-14 13:37 ` [PATCH 2/5] dpaa_eth: fix error in dpaa_remove() Madalin Bucur
2018-03-14 13:37 ` [PATCH 3/5] dpaa_eth: remove duplicate initialization Madalin Bucur
2018-03-14 13:37 ` [PATCH 4/5] dpaa_eth: increment the RX dropped counter when needed Madalin Bucur
2018-03-14 13:37 ` [PATCH 5/5] dpaa_eth: remove duplicate increment of the tx_errors counter Madalin Bucur
2018-03-14 17:17 ` [PATCH 0/5] DPAA Ethernet fixes David Miller
2018-03-14 18:43 ` Joakim Tjernlund
2018-03-15 9:32 ` Madalin-cristian Bucur
2018-03-15 15:15 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180314133732.24068-2-madalin.bucur@nxp.com \
--to=madalin.bucur@nxp.com \
--cc=camelia.groza@nxp.com \
--cc=davem@davemloft.net \
--cc=leoyang.li@nxp.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=netdev@vger.kernel.org \
--cc=roy.pledge@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®