From: Binoy Jayan <binoy.jayan@linaro.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Larry Finger <Larry.Finger@lwfinger.net>,
Florian Schilhabel <florian.c.schilhabel@googlemail.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
driverdev-devel@linuxdriverproject.org,
linux-kernel@vger.kernel.org,
Binoy Jayan <binoy.jayan@linaro.org>
Subject: [PATCH v2 2/4] rtl8712: Replace semaphore terminate_cmdthread_sema with completion
Date: Thu, 2 Jun 2016 09:54:08 +0530 [thread overview]
Message-ID: <1464841450-24772-3-git-send-email-binoy.jayan@linaro.org> (raw)
In-Reply-To: <1464841450-24772-1-git-send-email-binoy.jayan@linaro.org>
The semaphore 'terminate_cmdthread_sema' is used as completion,
so convert it to a struct completion type.
Signed-off-by: Binoy Jayan <binoy.jayan@linaro.org>
---
This patch depends on the following patch:
rtl8712: Replace semaphore cmd_queue_sema with completion
drivers/staging/rtl8712/os_intfs.c | 2 +-
drivers/staging/rtl8712/rtl8712_cmd.c | 2 +-
drivers/staging/rtl8712/rtl871x_cmd.c | 2 +-
drivers/staging/rtl8712/rtl871x_cmd.h | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/rtl8712/os_intfs.c b/drivers/staging/rtl8712/os_intfs.c
index c07bcd0..2396bac 100644
--- a/drivers/staging/rtl8712/os_intfs.c
+++ b/drivers/staging/rtl8712/os_intfs.c
@@ -245,7 +245,7 @@ void r8712_stop_drv_threads(struct _adapter *padapter)
/*Below is to terminate r8712_cmd_thread & event_thread...*/
complete(&padapter->cmdpriv.cmd_queue_comp);
if (padapter->cmdThread)
- _down_sema(&padapter->cmdpriv.terminate_cmdthread_sema);
+ wait_for_completion_interruptible(&padapter->cmdpriv.terminate_cmdthread_comp);
padapter->cmdpriv.cmd_seq = 1;
}
diff --git a/drivers/staging/rtl8712/rtl8712_cmd.c b/drivers/staging/rtl8712/rtl8712_cmd.c
index 172f51f..1badc6c 100644
--- a/drivers/staging/rtl8712/rtl8712_cmd.c
+++ b/drivers/staging/rtl8712/rtl8712_cmd.c
@@ -420,7 +420,7 @@ _next:
break;
r8712_free_cmd_obj(pcmd);
} while (1);
- up(&pcmdpriv->terminate_cmdthread_sema);
+ complete(&pcmdpriv->terminate_cmdthread_comp);
thread_exit();
}
diff --git a/drivers/staging/rtl8712/rtl871x_cmd.c b/drivers/staging/rtl8712/rtl871x_cmd.c
index 69e650b..74fd928 100644
--- a/drivers/staging/rtl8712/rtl871x_cmd.c
+++ b/drivers/staging/rtl8712/rtl871x_cmd.c
@@ -58,7 +58,7 @@ No irqsave is necessary.
static sint _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);
_init_queue(&(pcmdpriv->cmd_queue));
diff --git a/drivers/staging/rtl8712/rtl871x_cmd.h b/drivers/staging/rtl8712/rtl871x_cmd.h
index 1907bc9..ebd2e1d 100644
--- a/drivers/staging/rtl8712/rtl871x_cmd.h
+++ b/drivers/staging/rtl8712/rtl871x_cmd.h
@@ -51,7 +51,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 cmd_seq;
u8 *cmd_buf; /*shall be non-paged, and 4 bytes aligned*/
--
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-02 4:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-02 4:24 [PATCH v2 0/4] *** rtl8712: Replace semaphores with mutex / completions *** Binoy Jayan
2016-06-02 4:24 ` [PATCH v2 1/4] rtl8712: Replace semaphore cmd_queue_sema with completion Binoy Jayan
2016-06-02 4:24 ` Binoy Jayan [this message]
2016-06-02 4:24 ` [PATCH v2 3/4] rtl8712: intf_priv: Replace semaphore lock " Binoy Jayan
2016-06-02 4:24 ` [PATCH v2 4/4] rtl8712: pwrctrl_priv: Replace semaphore lock with mutex Binoy Jayan
2016-08-21 16:26 ` Greg Kroah-Hartman
2016-06-02 7:43 ` [PATCH v2 0/4] *** rtl8712: Replace semaphores with mutex / completions *** Arnd Bergmann
2016-06-02 15:15 ` Larry Finger
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=1464841450-24772-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=florian.c.schilhabel@googlemail.com \
--cc=gregkh@linuxfoundation.org \
--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