From: Binoy Jayan <binoy.jayan@linaro.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Larry Finger <Larry.Finger@lwfinger.net>
Cc: Jakub Sitnicki <jsitnicki@gmail.com>,
Arnd Bergmann <arnd@arndb.de>,
driverdev-devel@linuxdriverproject.org,
linux-kernel@vger.kernel.org,
Binoy Jayan <binoy.jayan@linaro.org>
Subject: [PATCH v3 2/4] staging: r8188eu: Replace semaphore terminate_cmdthread_sema with completion
Date: Mon, 6 Jun 2016 10:43:53 +0530 [thread overview]
Message-ID: <1465190035-10359-3-git-send-email-binoy.jayan@linaro.org> (raw)
In-Reply-To: <1465190035-10359-1-git-send-email-binoy.jayan@linaro.org>
The semaphore 'terminate_cmdthread_sema' is used as completion,
so convert it to struct completion.
Signed-off-by: Binoy Jayan <binoy.jayan@linaro.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
---
drivers/staging/rtl8188eu/core/rtw_cmd.c | 6 +++---
drivers/staging/rtl8188eu/include/rtw_cmd.h | 2 +-
drivers/staging/rtl8188eu/os_dep/os_intfs.c | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c
index a2937e7..9e12588 100644
--- a/drivers/staging/rtl8188eu/core/rtw_cmd.c
+++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c
@@ -28,7 +28,7 @@ No irqsave is necessary.
int rtw_init_cmd_priv(struct cmd_priv *pcmdpriv)
{
init_completion(&pcmdpriv->cmd_queue_comp);
- sema_init(&(pcmdpriv->terminate_cmdthread_sema), 0);
+ init_completion(&pcmdpriv->terminate_cmdthread_comp);
_rtw_init_queue(&(pcmdpriv->cmd_queue));
return _SUCCESS;
@@ -162,7 +162,7 @@ int rtw_cmd_thread(void *context)
allow_signal(SIGTERM);
pcmdpriv->cmdthd_running = true;
- up(&pcmdpriv->terminate_cmdthread_sema);
+ complete(&pcmdpriv->terminate_cmdthread_comp);
RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("start r871x rtw_cmd_thread !!!!\n"));
@@ -234,7 +234,7 @@ _next:
rtw_free_cmd_obj(pcmd);
}
- up(&pcmdpriv->terminate_cmdthread_sema);
+ complete(&pcmdpriv->terminate_cmdthread_comp);
complete_and_exit(NULL, 0);
diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h
index 3532dd1..2b53f58 100644
--- a/drivers/staging/rtl8188eu/include/rtw_cmd.h
+++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h
@@ -40,7 +40,7 @@ struct cmd_obj {
struct cmd_priv {
struct completion cmd_queue_comp;
- struct semaphore terminate_cmdthread_sema;
+ struct completion terminate_cmdthread_comp;
struct __queue cmd_queue;
u8 cmdthd_running;
struct adapter *padapter;
diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
index a696d2b..c494845 100644
--- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
@@ -762,7 +762,7 @@ static int rtw_start_drv_threads(struct adapter *padapter)
err = PTR_ERR(padapter->cmdThread);
else
/* wait for cmd_thread to run */
- _rtw_down_sema(&padapter->cmdpriv.terminate_cmdthread_sema);
+ wait_for_completion_interruptible(&padapter->cmdpriv.terminate_cmdthread_comp);
return err;
}
@@ -774,7 +774,7 @@ void rtw_stop_drv_threads(struct adapter *padapter)
/* Below is to terminate rtw_cmd_thread & event_thread... */
complete(&padapter->cmdpriv.cmd_queue_comp);
if (padapter->cmdThread)
- _rtw_down_sema(&padapter->cmdpriv.terminate_cmdthread_sema);
+ wait_for_completion_interruptible(&padapter->cmdpriv.terminate_cmdthread_comp);
}
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2016-06-06 5:14 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-03 9:58 [PATCH 0/4] *** rtl8188eu: Replace semaphores with mutexes or completions *** Binoy Jayan
2016-06-03 9:59 ` [PATCH 1/4] irtl8188eu: Replace semaphore cmd_queue_sema with completion Binoy Jayan
2016-06-05 16:31 ` Larry Finger
2016-06-03 9:59 ` [PATCH 2/4] rtl8188eu: Replace semaphore terminate_cmdthread_sema " Binoy Jayan
2016-06-03 9:59 ` [PATCH 3/4] rtl8188eu: pwrctrl_priv: Replace semaphore 'lock' with mutex Binoy Jayan
2016-06-03 9:59 ` [PATCH 4/4] rtl8188eu: Remove unused semaphores Binoy Jayan
2016-06-03 10:06 ` [PATCH 0/4] *** rtl8188eu: Replace semaphores with mutexes or completions *** Arnd Bergmann
2016-06-06 4:38 ` [PATCH v2 " Binoy Jayan
2016-06-06 4:38 ` [PATCH v2 1/4] irtl8188eu: Replace semaphore cmd_queue_sema with completion Binoy Jayan
2016-06-06 4:38 ` [PATCH v2 2/4] rtl8188eu: Replace semaphore terminate_cmdthread_sema " Binoy Jayan
2016-06-06 4:38 ` [PATCH v2 3/4] rtl8188eu: pwrctrl_priv: Replace semaphore 'lock' with mutex Binoy Jayan
2016-06-06 4:38 ` [PATCH v2 4/4] rtl8188eu: Remove unused semaphores Binoy Jayan
2016-06-06 5:13 ` [PATCH v3 0/4] *** staging: r8188eu: Replace semaphores with mutexes or completions *** Binoy Jayan
2016-06-06 5:13 ` [PATCH v3 1/4] staging: r8188eu: Replace semaphore cmd_queue_sema with completion Binoy Jayan
2016-06-06 5:13 ` Binoy Jayan [this message]
2016-06-06 5:13 ` [PATCH v3 3/4] staging: r8188eu: pwrctrl_priv: Replace semaphore 'lock' with mutex Binoy Jayan
2016-06-06 5:13 ` [PATCH v3 4/4] staging: r8188eu: Remove unused semaphores Binoy Jayan
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=1465190035-10359-3-git-send-email-binoy.jayan@linaro.org \
--to=binoy.jayan@linaro.org \
--cc=Larry.Finger@lwfinger.net \
--cc=arnd@arndb.de \
--cc=driverdev-devel@linuxdriverproject.org \
--cc=gregkh@linuxfoundation.org \
--cc=jsitnicki@gmail.com \
--cc=linux-kernel@vger.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
all inboxes | Powered by JetHome®