Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1411825 > unrolled thread

[PATCH 4/4] rtl8192u: Replace semaphore rf_sem with mutex

Started byBinoy Jayan <binoy.jayan@linaro.org>
First post2016-06-02 07:00 +0200
Last post2016-06-02 09:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4/4] rtl8192u: Replace semaphore rf_sem with mutex Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-02 07:00 +0200
    Re: [PATCH 4/4] rtl8192u: Replace semaphore rf_sem with mutex Arnd Bergmann <arnd@arndb.de> - 2016-06-02 09:50 +0200

#1411825 — [PATCH 4/4] rtl8192u: Replace semaphore rf_sem with mutex

FromBinoy Jayan <binoy.jayan@linaro.org>
Date2016-06-02 07:00 +0200
Subject[PATCH 4/4] rtl8192u: Replace semaphore rf_sem with mutex
Message-ID<rFsTE-1nj-19@gated-at.bofh.it>
The semaphore 'rf_sem' in rtl8192u is a simple mutex, so it should
be written as one. Semaphores are going away in the future.

Signed-off-by: Binoy Jayan <binoy.jayan@linaro.org>
---
This patch depends on the following patch:
rtl8192u: Replace semaphore scan_sem with mutex

 drivers/staging/rtl8192u/r8192U.h      | 2 +-
 drivers/staging/rtl8192u/r8192U_core.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U.h b/drivers/staging/rtl8192u/r8192U.h
index 2780838..7b921d4 100644
--- a/drivers/staging/rtl8192u/r8192U.h
+++ b/drivers/staging/rtl8192u/r8192U.h
@@ -880,7 +880,7 @@ typedef struct r8192_priv {
 	short crcmon;
 
 	struct mutex wx_mutex;
-	struct semaphore rf_sem;	/* Used to lock rf write operation */
+	struct mutex rf_mutex;	/* Used to lock rf write operation */
 
 	u8 rf_type;			/* 0: 1T2R, 1: 2T4R */
 	RT_RF_TYPE_819xU rf_chip;
diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
index c6d3119..46d613a 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -2374,7 +2374,7 @@ static void rtl8192_init_priv_lock(struct r8192_priv *priv)
 	spin_lock_init(&priv->tx_lock);
 	spin_lock_init(&priv->irq_lock);
 	mutex_init(&priv->wx_mutex);
-	sema_init(&priv->rf_sem, 1);
+	mutex_init(&priv->rf_mutex);
 	mutex_init(&priv->mutex);
 }
 
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

[toc] | [next] | [standalone]


#1411958

FromArnd Bergmann <arnd@arndb.de>
Date2016-06-02 09:50 +0200
Message-ID<rFvya-32D-9@gated-at.bofh.it>
In reply to#1411825
On Thursday, June 2, 2016 10:27:55 AM CEST Binoy Jayan wrote:
> diff --git a/drivers/staging/rtl8192u/r8192U.h b/drivers/staging/rtl8192u/r8192U.h
> index 2780838..7b921d4 100644
> --- a/drivers/staging/rtl8192u/r8192U.h
> +++ b/drivers/staging/rtl8192u/r8192U.h
> @@ -880,7 +880,7 @@ typedef struct r8192_priv {
>         short crcmon;
>  
>         struct mutex wx_mutex;
> -       struct semaphore rf_sem;        /* Used to lock rf write operation */
> +       struct mutex rf_mutex;  /* Used to lock rf write operation */
>  
>         u8 rf_type;                     /* 0: 1T2R, 1: 2T4R */
>         RT_RF_TYPE_819xU rf_chip;
> diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
> index c6d3119..46d613a 100644
> --- a/drivers/staging/rtl8192u/r8192U_core.c
> +++ b/drivers/staging/rtl8192u/r8192U_core.c
> @@ -2374,7 +2374,7 @@ static void rtl8192_init_priv_lock(struct r8192_priv *priv)
>         spin_lock_init(&priv->tx_lock);
>         spin_lock_init(&priv->irq_lock);
>         mutex_init(&priv->wx_mutex);
> -       sema_init(&priv->rf_sem, 1);
> +       mutex_init(&priv->rf_mutex);
>         mutex_init(&priv->mutex);
>  }

I think this one should be done differently: as there are obviously no users of
this semaphore, there is no need to replace it with a mutex, it should just be
removed entirely.

	Arnd

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web