Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1413021
| From | Binoy Jayan <binoy.jayan@linaro.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 1/4] irtl8188eu: Replace semaphore cmd_queue_sema with completion |
| Date | 2016-06-03 12:10 +0200 |
| Message-ID | <rFUdc-1OZ-41@gated-at.bofh.it> (permalink) |
| References | <rFU3w-1wB-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
The semaphore 'cmd_queue_sema' is used as completion,
so convert it to struct completion.
Signed-off-by: Binoy Jayan <binoy.jayan@linaro.org>
---
drivers/staging/rtl8188eu/core/rtw_cmd.c | 6 +++---
drivers/staging/rtl8188eu/include/rtw_cmd.h | 2 +-
drivers/staging/rtl8188eu/os_dep/os_intfs.c | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c
index 7748523..a2937e7 100644
--- a/drivers/staging/rtl8188eu/core/rtw_cmd.c
+++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c
@@ -27,7 +27,7 @@ No irqsave is necessary.
int rtw_init_cmd_priv(struct cmd_priv *pcmdpriv)
{
- sema_init(&(pcmdpriv->cmd_queue_sema), 0);
+ init_completion(&pcmdpriv->cmd_queue_comp);
sema_init(&(pcmdpriv->terminate_cmdthread_sema), 0);
_rtw_init_queue(&(pcmdpriv->cmd_queue));
@@ -122,7 +122,7 @@ u32 rtw_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
res = _rtw_enqueue_cmd(&pcmdpriv->cmd_queue, cmd_obj);
if (res == _SUCCESS)
- up(&pcmdpriv->cmd_queue_sema);
+ complete(&pcmdpriv->cmd_queue_comp);
exit:
@@ -167,7 +167,7 @@ int rtw_cmd_thread(void *context)
RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("start r871x rtw_cmd_thread !!!!\n"));
while (1) {
- if (_rtw_down_sema(&pcmdpriv->cmd_queue_sema) == _FAIL)
+ if (wait_for_completion_interruptible(&pcmdpriv->cmd_queue_comp))
break;
if (padapter->bDriverStopped ||
diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h
index 08ca592..3532dd1 100644
--- a/drivers/staging/rtl8188eu/include/rtw_cmd.h
+++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h
@@ -39,7 +39,7 @@ struct cmd_obj {
};
struct cmd_priv {
- struct semaphore cmd_queue_sema;
+ struct completion cmd_queue_comp;
struct semaphore terminate_cmdthread_sema;
struct __queue cmd_queue;
u8 cmdthd_running;
diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
index ae2caff..a696d2b 100644
--- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
@@ -772,7 +772,7 @@ void rtw_stop_drv_threads(struct adapter *padapter)
RT_TRACE(_module_os_intfs_c_, _drv_info_, ("+rtw_stop_drv_threads\n"));
/* Below is to terminate rtw_cmd_thread & event_thread... */
- up(&padapter->cmdpriv.cmd_queue_sema);
+ complete(&padapter->cmdpriv.cmd_queue_comp);
if (padapter->cmdThread)
_rtw_down_sema(&padapter->cmdpriv.terminate_cmdthread_sema);
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/4] *** rtl8188eu: Replace semaphores with mutexes or completions *** Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-03 12:00 +0200
[PATCH 3/4] rtl8188eu: pwrctrl_priv: Replace semaphore 'lock' with mutex Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-03 12:10 +0200
[PATCH 2/4] rtl8188eu: Replace semaphore terminate_cmdthread_sema with completion Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-03 12:10 +0200
[PATCH 4/4] rtl8188eu: Remove unused semaphores Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-03 12:10 +0200
[PATCH 1/4] irtl8188eu: Replace semaphore cmd_queue_sema with completion Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-03 12:10 +0200
Re: [PATCH 1/4] irtl8188eu: Replace semaphore cmd_queue_sema with completion Larry Finger <Larry.Finger@lwfinger.net> - 2016-06-05 18:40 +0200
Re: [PATCH 0/4] *** rtl8188eu: Replace semaphores with mutexes or completions *** Arnd Bergmann <arnd@arndb.de> - 2016-06-04 12:50 +0200
[PATCH v2 1/4] irtl8188eu: Replace semaphore cmd_queue_sema with completion Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-06 06:40 +0200
[PATCH v2 0/4] *** rtl8188eu: Replace semaphores with mutexes or completions *** Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-06 06:40 +0200
[PATCH v2 2/4] rtl8188eu: Replace semaphore terminate_cmdthread_sema with completion Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-06 06:40 +0200
[PATCH v2 4/4] rtl8188eu: Remove unused semaphores Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-06 06:40 +0200
[PATCH v2 3/4] rtl8188eu: pwrctrl_priv: Replace semaphore 'lock' with mutex Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-06 06:40 +0200
[PATCH v3 0/4] *** staging: r8188eu: Replace semaphores with mutexes or completions *** Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-06 07:20 +0200
[PATCH v3 1/4] staging: r8188eu: Replace semaphore cmd_queue_sema with completion Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-06 07:20 +0200
[PATCH v3 3/4] staging: r8188eu: pwrctrl_priv: Replace semaphore 'lock' with mutex Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-06 07:20 +0200
[PATCH v3 4/4] staging: r8188eu: Remove unused semaphores Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-06 07:20 +0200
[PATCH v3 2/4] staging: r8188eu: Replace semaphore terminate_cmdthread_sema with completion Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-06 07:20 +0200
csiph-web