From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Cai Huoqing <caihuoqing@baidu.com>
Cc: Nicolas Saenz Julienne <nsaenz@kernel.org>,
bcm-kernel-feedback-list@broadcom.com,
linux-rpi-kernel@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: vchiq_arm: Make use of the helper macro kthread_run()
Date: Fri, 22 Oct 2021 11:03:45 +0200 [thread overview]
Message-ID: <YXJ+cfWj6NBIuUS5@kroah.com> (raw)
In-Reply-To: <20211021084328.2395-1-caihuoqing@baidu.com>
On Thu, Oct 21, 2021 at 04:43:27PM +0800, Cai Huoqing wrote:
> Repalce kthread_create/wake_up_process() with kthread_run()
> to simplify the code.
>
> Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
> ---
> .../staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> index a5e33da74726..6130b95aaca3 100644
> --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> @@ -1717,15 +1717,12 @@ void vchiq_platform_conn_state_changed(struct vchiq_state *state,
> write_unlock_bh(&arm_state->susp_res_lock);
> snprintf(threadname, sizeof(threadname), "vchiq-keep/%d",
> state->id);
> - arm_state->ka_thread = kthread_create(&vchiq_keepalive_thread_func,
> - (void *)state,
> - threadname);
> + arm_state->ka_thread = kthread_run(&vchiq_keepalive_thread_func,
> + (void *)state, threadname);
> if (IS_ERR(arm_state->ka_thread)) {
> vchiq_log_error(vchiq_susp_log_level,
> "vchiq: FATAL: couldn't create thread %s",
> threadname);
> - } else {
> - wake_up_process(arm_state->ka_thread);
> }
> }
>
As others have pointed out for other busses where you sent this patch,
this is _VERY_ racy and probably wrong. Be more careful when sending
changes like this that can modify functionality without testing the
code.
thanks,
greg k-h
prev parent reply other threads:[~2021-10-22 9:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-21 8:43 [PATCH] staging: vchiq_arm: Make use of the helper macro kthread_run() Cai Huoqing
2021-10-22 9:03 ` Greg Kroah-Hartman [this message]
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=YXJ+cfWj6NBIuUS5@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=caihuoqing@baidu.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=linux-staging@lists.linux.dev \
--cc=nsaenz@kernel.org \
/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