From patchwork Mon Dec 10 21:40:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 153365 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp4043952ljp; Mon, 10 Dec 2018 13:40:54 -0800 (PST) X-Google-Smtp-Source: AFSGD/VLh/yBMOKxVJqXvlsdNt/AGZfzlsiiTZKndT5/dkWHTJqd3ICS4WGEhlnTCokv/eeIeBKw X-Received: by 2002:a17:902:9b93:: with SMTP id y19mr13776778plp.336.1544478054271; Mon, 10 Dec 2018 13:40:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544478054; cv=none; d=google.com; s=arc-20160816; b=iGG07C/0boP+YSb/J3j9bb7es52sJR4qQwz0FRAUIvWhQ3xardJXxj7zWalwHZJHL9 gHUQ3LKGEbSj48CPfuoFu9BxlFkpvkjXcdR66ZIr9JKvQ0LkRI6CNn2r4RzdY8z0Akdj 60xyLl6I/sB7Ff/XcvaYcQBkvxr397OvwuJCrQPFSbruO4gxA6hsnM/wwkdCeGlW6ABJ joV33wWHkEfs86HcUwo93U0J5VzYH5XipqDINujQNYE6dTnGA9pFRqZSDDuE62SnhJ+A GniEsYAC0LfIR+EGca/kfsdhjGkqTFTjY0Lc71dUI5K6PwwEaE2xUmXdRotl3yFaSvrE duOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=VgOXzcN+7NZtUlZvKJlXnDBhOc2RO+CXMWPt1gW2Khw=; b=UHhBVpT1nG7pBiedmgjtuEt4HeVsaaBIpgKJKYvyhx7nBvqPwucVgqu9h3BThNd1DT tmInU9S9AtF0HxGDk/80okgylDfxo+3YwWrn7/y1eR9JxfRZzKLsQMUtburcmGpyMOg/ IEBZGNSOYcMkDZBIzt+lQfLw80C1MHKaJlwZ+i4FORWPQbCX1dTy5yojUbnIe18GeJAH 4CjQgQNfVneQSXpP7ZcrSR/HDRx6CSDlbW+lE4vhT/v/Se288Yi5Xy0YAKUQ7eA6d5uz sYttiJAlE85T04h49DYfVhxfVdYAZROA8yc0mntHxM/YemfdrmJxr2Gr9WCucyHd/Mo9 YZrw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t11si10418411plo.293.2018.12.10.13.40.54; Mon, 10 Dec 2018 13:40:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730020AbeLJVkw (ORCPT + 31 others); Mon, 10 Dec 2018 16:40:52 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:55437 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728543AbeLJVkt (ORCPT ); Mon, 10 Dec 2018 16:40:49 -0500 Received: from wuerfel.lan ([109.192.41.194]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.145]) with ESMTPA (Nemesis) id 1Mi27T-1hABks0EYT-00e65A; Mon, 10 Dec 2018 22:40:39 +0100 From: Arnd Bergmann To: Greg Kroah-Hartman Cc: Bastien Nocera , Hans de Goede , Larry Finger , linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, Arnd Bergmann Subject: [PATCH 1/3] staging: rtl8723bs: change semaphores to completions Date: Mon, 10 Dec 2018 22:40:30 +0100 Message-Id: <20181210214032.1441224-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:kjfVQyWH7F45M24GMoFLGCOTz2rswo/CQ7iqCUAWe/1kUKpCTjM 372PTG9k7u8YTbqmXhtaDWMJcPkEf2YuO6pBd/dS/T95AgmBWojK/h6JLv+cdsQrAxoLqEa j8VaD11vKBqODISDFCDlHDtVhPONxW8KfpW/BTAvzS/TPTV2Ng1znlcRzM9kOKnuHeLP3xm MdgahDoTb/wJUkPmOzcnA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:ByPNwi82wDQ=:0K620ShxgxeqaV7knOTOf1 su9fsswlsi3LmdnOFy8ZZAKtHBBMc04yMDxcjQXTZIWi1fB90asFk5dyBly/opgU8KHNEBvT7 3H/9Bv8MOUXZFsj6V2g9aGuGgY89kzQHvBWlWQrKNzVPWyyBtWDRrlCb/B4RUyHSbZZ4bLGR/ t8VycBcqO1BiLzMoTjGWYPV+G1Y3NymlETus0IlRmGNMjdMhhutMSGNwmamUAobNMYgimn9Bj tG4kLQu1CI6LAELLNt2jxJkfvnIy19pe8QKKZerr7YgKVaar0sHX693jEHyTgU1+q/ANCcLqI oTMFgpss/rS0SRItMIpfQhmB8XiXGGp8kI2BGL9RB6HpdT8K8VF3WkhxjnMwsXMEcv9S5EY64 ZIVI54madLMWaGKJFXWBL2tyQp5V0RV6sycrHQflGt+5hsGAMajiCG3syjzqd6/Xh9Fpxd40t 1Mogv+DjEfZ2m6iyjx48m35x18Ml5z0+d38XDBhsHO2kUKrSEGY/FF1bLVxk+7/2Bkyq6QRj5 3nc2/beMLiNvBTbfB4Ix8hMeG9naJmfLmKsECOUHgXLqukQQ55BDG4+XFgEuBcvAY4K8A8nUI T5uwC9baOUTw/BlnSPlLz1Js7OrJoF+Ov87AXKTeNifLVO4Z4f2qm8TiEpB+v8/BOcUhX8GRw UCjG1rrL96eq1n9kcyzjPgnKKHUn40dUMOsasChxhC3Qg9+bpxKrbo7TdHoCTBVeBNmywFbg1 4DAvsISQk2ymXQO5jvyeOIveorDe29cQjJ9Gpw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This driver uses many semaphores, most of them are equivalent to completions. The other copies of this driver got moved over to completions a while ago, so do the same here. In this usage scenario, the two are equivalent, so the behavior should not change. Signed-off-by: Arnd Bergmann --- drivers/staging/rtl8723bs/core/rtw_cmd.c | 20 ++++++++--------- drivers/staging/rtl8723bs/core/rtw_mlme.c | 2 -- drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 4 ++-- drivers/staging/rtl8723bs/core/rtw_xmit.c | 8 +++---- .../staging/rtl8723bs/hal/rtl8723b_hal_init.c | 4 ++-- .../staging/rtl8723bs/hal/rtl8723bs_xmit.c | 22 ++++++++----------- drivers/staging/rtl8723bs/hal/sdio_ops.c | 2 +- drivers/staging/rtl8723bs/include/rtw_cmd.h | 7 +++--- drivers/staging/rtl8723bs/include/rtw_xmit.h | 9 ++++---- drivers/staging/rtl8723bs/os_dep/os_intfs.c | 6 ++--- drivers/staging/rtl8723bs/os_dep/xmit_linux.c | 2 +- 11 files changed, 39 insertions(+), 47 deletions(-) -- 2.20.0 Reviewed-by: Hans de Goede diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c index 830be63391b7..3d206c33eafa 100644 --- a/drivers/staging/rtl8723bs/core/rtw_cmd.c +++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c @@ -166,10 +166,8 @@ sint _rtw_init_cmd_priv(struct cmd_priv *pcmdpriv) { sint res = _SUCCESS; - sema_init(&(pcmdpriv->cmd_queue_sema), 0); - /* sema_init(&(pcmdpriv->cmd_done_sema), 0); */ - sema_init(&(pcmdpriv->terminate_cmdthread_sema), 0); - + init_completion(&pcmdpriv->cmd_queue_comp); + init_completion(&pcmdpriv->terminate_cmdthread_comp); _rtw_init_queue(&(pcmdpriv->cmd_queue)); @@ -369,7 +367,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: return res; @@ -410,8 +408,8 @@ void rtw_stop_cmd_thread(struct adapter *adapter) atomic_read(&(adapter->cmdpriv.cmdthd_running)) == true && adapter->cmdpriv.stop_req == 0) { adapter->cmdpriv.stop_req = 1; - up(&adapter->cmdpriv.cmd_queue_sema); - down(&adapter->cmdpriv.terminate_cmdthread_sema); + complete(&adapter->cmdpriv.cmd_queue_comp); + wait_for_completion(&adapter->cmdpriv.terminate_cmdthread_comp); } } @@ -435,13 +433,13 @@ int rtw_cmd_thread(void *context) pcmdpriv->stop_req = 0; atomic_set(&(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")); while (1) { - if (down_interruptible(&pcmdpriv->cmd_queue_sema)) { - DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" down_interruptible(&pcmdpriv->cmd_queue_sema) return != 0, break\n", FUNC_ADPT_ARG(padapter)); + if (wait_for_completion_interruptible(&pcmdpriv->cmd_queue_comp)) { + DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" wait_for_completion_interruptible(&pcmdpriv->cmd_queue_comp) return != 0, break\n", FUNC_ADPT_ARG(padapter)); break; } @@ -581,7 +579,7 @@ int rtw_cmd_thread(void *context) rtw_free_cmd_obj(pcmd); } while (1); - up(&pcmdpriv->terminate_cmdthread_sema); + complete(&pcmdpriv->terminate_cmdthread_comp); atomic_set(&(pcmdpriv->cmdthd_running), false); thread_exit(); diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c index 4c5d5cf9dfe0..81505f3bce8b 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c @@ -2373,8 +2373,6 @@ sint rtw_set_key(struct adapter *adapter, struct security_priv *psecuritypriv, s INIT_LIST_HEAD(&pcmd->list); - /* sema_init(&(pcmd->cmd_sem), 0); */ - res = rtw_enqueue_cmd(pcmdpriv, pcmd); } else{ setkey_hdl(adapter, (u8 *)psetkeyparm); diff --git a/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c b/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c index 59a667753266..a0d8fbeecf9b 100644 --- a/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c +++ b/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c @@ -745,10 +745,10 @@ void cpwm_int_hdl( if (pwrpriv->cpwm >= PS_STATE_S2) { if (pwrpriv->alives & CMD_ALIVE) - up(&padapter->cmdpriv.cmd_queue_sema); + complete(&padapter->cmdpriv.cmd_queue_comp); if (pwrpriv->alives & XMIT_ALIVE) - up(&padapter->xmitpriv.xmit_sema); + complete(&padapter->xmitpriv.xmit_comp); } up(&pwrpriv->lock); diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c index 729fd37f440b..fdfa4b3c4c10 100644 --- a/drivers/staging/rtl8723bs/core/rtw_xmit.c +++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c @@ -45,8 +45,8 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) spin_lock_init(&pxmitpriv->lock); spin_lock_init(&pxmitpriv->lock_sctx); - sema_init(&pxmitpriv->xmit_sema, 0); - sema_init(&pxmitpriv->terminate_xmitthread_sema, 0); + init_completion(&pxmitpriv->xmit_comp); + init_completion(&pxmitpriv->terminate_xmitthread_comp); /* Please insert all the queue initializaiton using _rtw_init_queue below @@ -2879,7 +2879,7 @@ void enqueue_pending_xmitbuf( list_add_tail(&pxmitbuf->list, get_list_head(pqueue)); spin_unlock_bh(&pqueue->lock); - up(&(pri_adapter->xmitpriv.xmit_sema)); + complete(&(pri_adapter->xmitpriv.xmit_comp)); } void enqueue_pending_xmitbuf_to_head( @@ -2998,7 +2998,7 @@ int rtw_xmit_thread(void *context) flush_signals_thread(); } while (_SUCCESS == err); - up(&padapter->xmitpriv.terminate_xmitthread_sema); + complete(&padapter->xmitpriv.terminate_xmitthread_comp); thread_exit(); } diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c index c7e55618b9a8..85fd12cca4ae 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c @@ -4502,8 +4502,8 @@ void rtl8723b_stop_thread(struct adapter *padapter) /* stop xmit_buf_thread */ if (xmitpriv->SdioXmitThread) { - up(&xmitpriv->SdioXmitSema); - down(&xmitpriv->SdioXmitTerminateSema); + complete(&xmitpriv->SdioXmitStart); + wait_for_completion(&xmitpriv->SdioXmitTerminate); xmitpriv->SdioXmitThread = NULL; } #endif diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c index 10b3f9733bad..69c4db5b5b0c 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c @@ -148,7 +148,7 @@ s32 rtl8723bs_xmit_buf_handler(struct adapter *padapter) pxmitpriv = &padapter->xmitpriv; - if (down_interruptible(&pxmitpriv->xmit_sema)) { + if (wait_for_completion_interruptible(&pxmitpriv->xmit_comp)) { DBG_871X_LEVEL(_drv_emerg_, "%s: down SdioXmitBufSema fail!\n", __func__); return _FAIL; } @@ -312,7 +312,7 @@ static s32 xmit_xmitframes(struct adapter *padapter, struct xmit_priv *pxmitpriv DBG_871X_LEVEL(_drv_err_, "%s: xmit_buf is not enough!\n", __func__); #endif err = -2; - up(&(pxmitpriv->xmit_sema)); + complete(&(pxmitpriv->xmit_comp)); break; } k = 0; @@ -420,8 +420,8 @@ static s32 rtl8723bs_xmit_handler(struct adapter *padapter) pxmitpriv = &padapter->xmitpriv; - if (down_interruptible(&pxmitpriv->SdioXmitSema)) { - DBG_871X_LEVEL(_drv_emerg_, "%s: down sema fail!\n", __func__); + if (wait_for_completion_interruptible(&pxmitpriv->SdioXmitStart)) { + DBG_871X_LEVEL(_drv_emerg_, "%s: SdioXmitStart fail!\n", __func__); return _FAIL; } @@ -490,10 +490,6 @@ int rtl8723bs_xmit_thread(void *context) DBG_871X("start "FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(padapter)); - /* For now, no one would down sema to check thread is running, */ - /* so mark this temporary, Lucas@20130820 */ -/* up(&pxmitpriv->SdioXmitTerminateSema); */ - do { ret = rtl8723bs_xmit_handler(padapter); if (signal_pending(current)) { @@ -501,7 +497,7 @@ int rtl8723bs_xmit_thread(void *context) } } while (_SUCCESS == ret); - up(&pxmitpriv->SdioXmitTerminateSema); + complete(&pxmitpriv->SdioXmitTerminate); RT_TRACE(_module_hal_xmit_c_, _drv_notice_, ("-%s\n", __func__)); @@ -590,7 +586,7 @@ s32 rtl8723bs_hal_xmit( return true; } - up(&pxmitpriv->SdioXmitSema); + complete(&pxmitpriv->SdioXmitStart); return false; } @@ -611,7 +607,7 @@ s32 rtl8723bs_hal_xmitframe_enqueue( #ifdef CONFIG_SDIO_TX_TASKLET tasklet_hi_schedule(&pxmitpriv->xmit_tasklet); #else - up(&pxmitpriv->SdioXmitSema); + complete(&pxmitpriv->SdioXmitStart); #endif } @@ -634,8 +630,8 @@ s32 rtl8723bs_init_xmit_priv(struct adapter *padapter) phal = GET_HAL_DATA(padapter); spin_lock_init(&phal->SdioTxFIFOFreePageLock); - sema_init(&xmitpriv->SdioXmitSema, 0); - sema_init(&xmitpriv->SdioXmitTerminateSema, 0); + init_completion(&xmitpriv->SdioXmitStart); + init_completion(&xmitpriv->SdioXmitTerminate); return _SUCCESS; } diff --git a/drivers/staging/rtl8723bs/hal/sdio_ops.c b/drivers/staging/rtl8723bs/hal/sdio_ops.c index d6b93e1f78d8..3fee34484577 100644 --- a/drivers/staging/rtl8723bs/hal/sdio_ops.c +++ b/drivers/staging/rtl8723bs/hal/sdio_ops.c @@ -1023,7 +1023,7 @@ void sd_int_dpc(struct adapter *adapter) u8 freepage[4]; _sdio_local_read(adapter, SDIO_REG_FREE_TXPG, 4, freepage); - up(&(adapter->xmitpriv.xmit_sema)); + complete(&(adapter->xmitpriv.xmit_comp)); } if (hal->sdio_hisr & SDIO_HISR_CPWM1) { diff --git a/drivers/staging/rtl8723bs/include/rtw_cmd.h b/drivers/staging/rtl8723bs/include/rtw_cmd.h index 7dc5bf050839..299b55538788 100644 --- a/drivers/staging/rtl8723bs/include/rtw_cmd.h +++ b/drivers/staging/rtl8723bs/include/rtw_cmd.h @@ -7,6 +7,7 @@ #ifndef __RTW_CMD_H_ #define __RTW_CMD_H_ +#include #define C2H_MEM_SZ (16*1024) @@ -27,7 +28,6 @@ u8 *rsp; u32 rspsz; struct submit_ctx *sctx; - /* _sema cmd_sem; */ struct list_head list; }; @@ -38,9 +38,8 @@ }; struct cmd_priv { - _sema cmd_queue_sema; - /* _sema cmd_done_sema; */ - _sema terminate_cmdthread_sema; + struct completion cmd_queue_comp; + struct completion terminate_cmdthread_comp; struct __queue cmd_queue; u8 cmd_seq; u8 *cmd_buf; /* shall be non-paged, and 4 bytes aligned */ diff --git a/drivers/staging/rtl8723bs/include/rtw_xmit.h b/drivers/staging/rtl8723bs/include/rtw_xmit.h index a75b668d09a6..1b38b9182b31 100644 --- a/drivers/staging/rtl8723bs/include/rtw_xmit.h +++ b/drivers/staging/rtl8723bs/include/rtw_xmit.h @@ -7,6 +7,7 @@ #ifndef _RTW_XMIT_H_ #define _RTW_XMIT_H_ +#include #define MAX_XMITBUF_SZ (20480) /* 20k */ @@ -364,8 +365,8 @@ struct xmit_priv { _lock lock; - _sema xmit_sema; - _sema terminate_xmitthread_sema; + struct completion xmit_comp; + struct completion terminate_xmitthread_comp; /* struct __queue blk_strms[MAX_NUMBLKS]; */ struct __queue be_pending; @@ -419,8 +420,8 @@ struct xmit_priv { struct tasklet_struct xmit_tasklet; #else void *SdioXmitThread; - _sema SdioXmitSema; - _sema SdioXmitTerminateSema; + struct completion SdioXmitStart; + struct completion SdioXmitTerminate; #endif /* CONFIG_SDIO_TX_TASKLET */ struct __queue free_xmitbuf_queue; diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c index 181642358e3f..143e3f9b31aa 100644 --- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c +++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c @@ -585,7 +585,7 @@ u32 rtw_start_drv_threads(struct adapter *padapter) if (IS_ERR(padapter->cmdThread)) _status = _FAIL; else - down(&padapter->cmdpriv.terminate_cmdthread_sema); /* wait for cmd_thread to run */ + wait_for_completion(&padapter->cmdpriv.terminate_cmdthread_comp); /* wait for cmd_thread to run */ rtw_hal_start_thread(padapter); return _status; @@ -598,8 +598,8 @@ void rtw_stop_drv_threads (struct adapter *padapter) rtw_stop_cmd_thread(padapter); /* Below is to termindate tx_thread... */ - up(&padapter->xmitpriv.xmit_sema); - down(&padapter->xmitpriv.terminate_xmitthread_sema); + complete(&padapter->xmitpriv.xmit_comp); + wait_for_completion(&padapter->xmitpriv.terminate_xmitthread_comp); RT_TRACE(_module_os_intfs_c_, _drv_info_, ("\n drv_halt: rtw_xmit_thread can be terminated !\n")); rtw_hal_stop_thread(padapter); diff --git a/drivers/staging/rtl8723bs/os_dep/xmit_linux.c b/drivers/staging/rtl8723bs/os_dep/xmit_linux.c index 2cf903c66854..4e4e565d991c 100644 --- a/drivers/staging/rtl8723bs/os_dep/xmit_linux.c +++ b/drivers/staging/rtl8723bs/os_dep/xmit_linux.c @@ -101,7 +101,7 @@ void rtw_os_xmit_schedule(struct adapter *padapter) return; if (!list_empty(&padapter->xmitpriv.pending_xmitbuf_queue.queue)) - up(&pri_adapter->xmitpriv.xmit_sema); + complete(&pri_adapter->xmitpriv.xmit_comp); } static void rtw_check_xmit_resource(struct adapter *padapter, _pkt *pkt) From patchwork Mon Dec 10 21:40:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 153366 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp4044987ljp; Mon, 10 Dec 2018 13:42:18 -0800 (PST) X-Google-Smtp-Source: AFSGD/XVc1/RANgc85GIA1VYCCx/HwtjdGgMRchI4ehQ6GBhVykEeS8gMAZTTsszWPaj7LANoivG X-Received: by 2002:a62:65c5:: with SMTP id z188mr14380541pfb.64.1544478138257; Mon, 10 Dec 2018 13:42:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544478138; cv=none; d=google.com; s=arc-20160816; b=FWRxQyvz+ofJRsxEtBR24LXHcZ2OVuEgYv/0fOteDGKWEmTVnCpcVyucCCVhRUjxzk 0gCY04sazmAufYYm5kzBRrDl373+zY53Ykfn1KX9KC/cpSpSZmPZIOLS7miojZ3rd2m6 RyBi+X9z9AxFBXrPONjw3DnqspNCiSijGWJD5McOC2QgPHbkW9wer97LJtXrIwJ1iyWx 17EPzGwAQAyv+P3AueaZruKtwE+K5vEvRdDXr0+8ZX4S641ClhLcs1Xjq24AoZqe0RIR UFPM6D5V/iahshinu8DwlcjyASYcGZZIB2sgwT9Fy9TB3NRnUrNcdWfAbN5wbQ3Ct2fI coAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ZpOhfRIBXkneCpQmlghdbsU21mi0kl4BnGqMVrXngjc=; b=lxSm6HACYrUCfh4cXnZDrDf93Sz3lB0k0+g+d+CWVlT1qN3HMi2kCrKvJ4AQVfnDY9 esLwYkoW2h4xeP4z1RMMtskUSSmTn46spOxO5dMeU4F4RhxSRQW7KIz2wAEOfthkInPr bWpyByo5rbgsovxOLBD7e8vIG2seWbNf1NEU/e0fJHNFov5Qd0/g65kfkTxBbHRNocQC fKif0ffRMnzHmT4GUu6Kp9X4AzMQmIpbAXKfipZF8hH1wnC9DvU/G0weVxUdYStYIcpq s1kIWGEp5zodDJOR9N8/r+r06icsYdtwknSlCQO+5WJQvviLr5R3Pqbm5MO4M3LTVm45 mzig== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h5si10145681pgc.237.2018.12.10.13.42.17; Mon, 10 Dec 2018 13:42:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730173AbeLJVmP (ORCPT + 31 others); Mon, 10 Dec 2018 16:42:15 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:45159 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726562AbeLJVmM (ORCPT ); Mon, 10 Dec 2018 16:42:12 -0500 Received: from wuerfel.lan ([109.192.41.194]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.145]) with ESMTPA (Nemesis) id 1MnqbU-1hFzaf1XY2-00pPgx; Mon, 10 Dec 2018 22:40:39 +0100 From: Arnd Bergmann To: Greg Kroah-Hartman Cc: Bastien Nocera , Hans de Goede , Larry Finger , linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, Arnd Bergmann Subject: [PATCH 2/3] staging: rtl8723bs: change pwrctrl lock to a mutex Date: Mon, 10 Dec 2018 22:40:31 +0100 Message-Id: <20181210214032.1441224-2-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181210214032.1441224-1-arnd@arndb.de> References: <20181210214032.1441224-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:kU1YSpPI7NDX/q8rJpemaYBk8HvXSD+Yp4i/IoNfBKOnI/YSig0 sX87HBIXAZ6sUVuoUpdNWswnQRxfouD8R/rR+vebZso1GB6Vngzi1qTw8D05IYhqzMCKEXj hoQ8d9vxGRt35fL1nZW4/dZdGS5MxiNcQ1SE3lQVjCGMTPNHeV2OLXK1nE/iegXTKH0Vp/h TcjYFiskyawWAuKryVRsw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:pIjIbR75Yyg=:0csEZgsHJx2zbI9ivV4MxV qjKn6rxG2i8nz+NvtHQg2+4M46HAM5RsA57hMosk5Qv17qFsgD4qI5my/yDlmQy+Ooj31F8bs 48R6olKfZ28JFivsXJjFL+cGuKdkTc8RvbiBNbcTV1QBTMQPLemtjepOUZHh/EjOCB60rZLuL YKn5oA6MJ7ThEVFrANiktXQj8XpK73JEqhVNLA4lZfJ0Kw3O/Efxn5bFzankJfXiHR8ErZSzo bsdhwT346Q10pShIV1fu5qWNFvSzVgtVdcRCXBtyzVgoDBMlHzZNGvmTBME9h5+cYBuv4FS8x Yov6/ZF2ExUphvcrPWXwQkiNhK0Dh3xqbzRzURUU4218wbbQXczMlAbR2LnyStr5+umnYoYcD n3kleGpdYiFgdxym8o5F3TSXeMK5002vZF9Q2/878DeUqzaffMOt+eO+ZsLYdZ+/ieo1Z8xYW YXGXm9OjbvEsDCBUpxB8c8uVMZjAtShyaKxSaqdEKvovb6dU5F844lM02q2+D3CbLiDbwHsnm kRIqThOEEjLdgxU/EKWQsqSKsGJX8bwKj1UbwhfG/2aOVdI75SyVGOjsrBQ5QStJkb7REQXtW Pk/62YTFjEO3Hp4wsp2iJpa37nVyzZ5JsWdUWaYcNrAgASP9Z/zZnfZH/VJW84Mh8k+P5utWb fP1yWjGfG+2ic0aeXL5y5cJSePV9dYAQlNK0XOORnrDOlxatPnPkIQg5SBI6XFxWC04ga1htx 0sJuoHRnPLcOKyOE3SFS6c2TTIdDjx1GmbgOWg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This semaphore is used like a mutex, so it should use the regular mutex API, as we do in the other copies of this driver. Signed-off-by: Arnd Bergmann --- drivers/staging/rtl8723bs/core/rtw_cmd.c | 4 +- drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 73 +++++++++---------- .../staging/rtl8723bs/include/rtw_pwrctrl.h | 3 +- 3 files changed, 40 insertions(+), 40 deletions(-) -- 2.20.0 diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c index 3d206c33eafa..984db6f2217c 100644 --- a/drivers/staging/rtl8723bs/core/rtw_cmd.c +++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c @@ -1621,7 +1621,7 @@ static void rtw_lps_change_dtim_hdl(struct adapter *padapter, u8 dtim) if (rtw_btcoex_IsBtControlLps(padapter) == true) return; - down(&pwrpriv->lock); + mutex_lock(&pwrpriv->lock); if (pwrpriv->dtim != dtim) { DBG_871X("change DTIM from %d to %d, bFwCurrentInPSMode =%d, ps_mode =%d\n", pwrpriv->dtim, dtim, @@ -1638,7 +1638,7 @@ static void rtw_lps_change_dtim_hdl(struct adapter *padapter, u8 dtim) rtw_hal_set_hwreg(padapter, HW_VAR_H2C_FW_PWRMODE, (u8 *)(&ps_mode)); } - up(&pwrpriv->lock); + mutex_unlock(&pwrpriv->lock); } static void rtw_dm_ra_mask_hdl(struct adapter *padapter, struct sta_info *psta) diff --git a/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c b/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c index a0d8fbeecf9b..b7dd5fec9b31 100644 --- a/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c +++ b/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c @@ -45,9 +45,9 @@ void ips_enter(struct adapter *padapter) rtw_btcoex_IpsNotify(padapter, pwrpriv->ips_mode_req); - down(&pwrpriv->lock); + mutex_lock(&pwrpriv->lock); _ips_enter(padapter); - up(&pwrpriv->lock); + mutex_unlock(&pwrpriv->lock); } int _ips_leave(struct adapter *padapter) @@ -85,9 +85,9 @@ int ips_leave(struct adapter *padapter) if (!is_primary_adapter(padapter)) return _SUCCESS; - down(&pwrpriv->lock); + mutex_lock(&pwrpriv->lock); ret = _ips_leave(padapter); - up(&pwrpriv->lock); + mutex_unlock(&pwrpriv->lock); if (_SUCCESS == ret) rtw_btcoex_IpsNotify(padapter, IPS_NONE); @@ -158,9 +158,9 @@ void rtw_ps_processor(struct adapter *padapter) struct debug_priv *pdbgpriv = &psdpriv->drv_dbg; u32 ps_deny = 0; - down(&adapter_to_pwrctl(padapter)->lock); + mutex_lock(&adapter_to_pwrctl(padapter)->lock); ps_deny = rtw_ps_deny_get(padapter); - up(&adapter_to_pwrctl(padapter)->lock); + mutex_unlock(&adapter_to_pwrctl(padapter)->lock); if (ps_deny != 0) { DBG_871X(FUNC_ADPT_FMT ": ps_deny = 0x%08X, skip power save!\n", FUNC_ADPT_ARG(padapter), ps_deny); @@ -413,7 +413,7 @@ void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode, u8 smart_ps, u8 bcn_a return; - down(&pwrpriv->lock); + mutex_lock(&pwrpriv->lock); /* if (pwrpriv->pwr_mode == PS_MODE_ACTIVE) */ if (ps_mode == PS_MODE_ACTIVE) { @@ -494,7 +494,7 @@ void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode, u8 smart_ps, u8 bcn_a } } - up(&pwrpriv->lock); + mutex_unlock(&pwrpriv->lock); } /* @@ -628,11 +628,11 @@ void LeaveAllPowerSaveModeDirect(struct adapter *Adapter) return; } - down(&pwrpriv->lock); + mutex_lock(&pwrpriv->lock); rtw_set_rpwm(Adapter, PS_STATE_S4); - up(&pwrpriv->lock); + mutex_unlock(&pwrpriv->lock); rtw_lps_ctrl_wk_cmd(pri_padapter, LPS_CTRL_LEAVE, 0); } else{ @@ -696,7 +696,7 @@ void LPS_Leave_check( cond_resched(); while (1) { - down(&pwrpriv->lock); + mutex_lock(&pwrpriv->lock); if ((padapter->bSurpriseRemoved == true) || (padapter->hw_init_completed == false) @@ -704,7 +704,7 @@ void LPS_Leave_check( ) bReady = true; - up(&pwrpriv->lock); + mutex_unlock(&pwrpriv->lock); if (true == bReady) break; @@ -732,11 +732,10 @@ void cpwm_int_hdl( pwrpriv = adapter_to_pwrctl(padapter); - down(&pwrpriv->lock); + mutex_lock(&pwrpriv->lock); if (pwrpriv->rpwm < PS_STATE_S2) { DBG_871X("%s: Redundant CPWM Int. RPWM = 0x%02X CPWM = 0x%02x\n", __func__, pwrpriv->rpwm, pwrpriv->cpwm); - up(&pwrpriv->lock); goto exit; } @@ -751,9 +750,9 @@ void cpwm_int_hdl( complete(&padapter->xmitpriv.xmit_comp); } - up(&pwrpriv->lock); - exit: + mutex_unlock(&pwrpriv->lock); + RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_notice_, ("cpwm_int_hdl: cpwm = 0x%02x\n", pwrpriv->cpwm)); } @@ -783,12 +782,12 @@ static void rpwmtimeout_workitem_callback(struct work_struct *work) padapter = dvobj->if1; /* DBG_871X("+%s: rpwm = 0x%02X cpwm = 0x%02X\n", __func__, pwrpriv->rpwm, pwrpriv->cpwm); */ - down(&pwrpriv->lock); + mutex_lock(&pwrpriv->lock); if ((pwrpriv->rpwm == pwrpriv->cpwm) || (pwrpriv->cpwm >= PS_STATE_S2)) { DBG_871X("%s: rpwm = 0x%02X cpwm = 0x%02X CPWM done!\n", __func__, pwrpriv->rpwm, pwrpriv->cpwm); goto exit; } - up(&pwrpriv->lock); + mutex_unlock(&pwrpriv->lock); if (rtw_read8(padapter, 0x100) != 0xEA) { struct reportpwrstate_parm report; @@ -800,7 +799,7 @@ static void rpwmtimeout_workitem_callback(struct work_struct *work) return; } - down(&pwrpriv->lock); + mutex_lock(&pwrpriv->lock); if ((pwrpriv->rpwm == pwrpriv->cpwm) || (pwrpriv->cpwm >= PS_STATE_S2)) { DBG_871X("%s: cpwm =%d, nothing to do!\n", __func__, pwrpriv->cpwm); @@ -811,7 +810,7 @@ static void rpwmtimeout_workitem_callback(struct work_struct *work) pwrpriv->brpwmtimeout = false; exit: - up(&pwrpriv->lock); + mutex_unlock(&pwrpriv->lock); } /* @@ -867,7 +866,7 @@ s32 rtw_register_task_alive(struct adapter *padapter, u32 task) pwrctrl = adapter_to_pwrctl(padapter); pslv = PS_STATE_S2; - down(&pwrctrl->lock); + mutex_lock(&pwrctrl->lock); register_task_alive(pwrctrl, task); @@ -884,7 +883,7 @@ s32 rtw_register_task_alive(struct adapter *padapter, u32 task) } } - up(&pwrctrl->lock); + mutex_unlock(&pwrctrl->lock); if (_FAIL == res) if (pwrctrl->cpwm >= PS_STATE_S2) @@ -920,7 +919,7 @@ void rtw_unregister_task_alive(struct adapter *padapter, u32 task) pslv = PS_STATE_S2; } - down(&pwrctrl->lock); + mutex_lock(&pwrctrl->lock); unregister_task_alive(pwrctrl, task); @@ -936,7 +935,7 @@ void rtw_unregister_task_alive(struct adapter *padapter, u32 task) } - up(&pwrctrl->lock); + mutex_unlock(&pwrctrl->lock); } /* @@ -962,7 +961,7 @@ s32 rtw_register_tx_alive(struct adapter *padapter) pwrctrl = adapter_to_pwrctl(padapter); pslv = PS_STATE_S2; - down(&pwrctrl->lock); + mutex_lock(&pwrctrl->lock); register_task_alive(pwrctrl, XMIT_ALIVE); @@ -979,7 +978,7 @@ s32 rtw_register_tx_alive(struct adapter *padapter) } } - up(&pwrctrl->lock); + mutex_unlock(&pwrctrl->lock); if (_FAIL == res) if (pwrctrl->cpwm >= PS_STATE_S2) @@ -1011,7 +1010,7 @@ s32 rtw_register_cmd_alive(struct adapter *padapter) pwrctrl = adapter_to_pwrctl(padapter); pslv = PS_STATE_S2; - down(&pwrctrl->lock); + mutex_lock(&pwrctrl->lock); register_task_alive(pwrctrl, CMD_ALIVE); @@ -1028,7 +1027,7 @@ s32 rtw_register_cmd_alive(struct adapter *padapter) } } - up(&pwrctrl->lock); + mutex_unlock(&pwrctrl->lock); if (_FAIL == res) if (pwrctrl->cpwm >= PS_STATE_S2) @@ -1061,7 +1060,7 @@ void rtw_unregister_tx_alive(struct adapter *padapter) pslv = PS_STATE_S2; } - down(&pwrctrl->lock); + mutex_lock(&pwrctrl->lock); unregister_task_alive(pwrctrl, XMIT_ALIVE); @@ -1076,7 +1075,7 @@ void rtw_unregister_tx_alive(struct adapter *padapter) rtw_set_rpwm(padapter, pslv); } - up(&pwrctrl->lock); + mutex_unlock(&pwrctrl->lock); } /* @@ -1103,7 +1102,7 @@ void rtw_unregister_cmd_alive(struct adapter *padapter) pslv = PS_STATE_S2; } - down(&pwrctrl->lock); + mutex_lock(&pwrctrl->lock); unregister_task_alive(pwrctrl, CMD_ALIVE); @@ -1119,14 +1118,14 @@ void rtw_unregister_cmd_alive(struct adapter *padapter) } } - up(&pwrctrl->lock); + mutex_unlock(&pwrctrl->lock); } void rtw_init_pwrctrl_priv(struct adapter *padapter) { struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(padapter); - sema_init(&pwrctrlpriv->lock, 1); + mutex_init(&pwrctrlpriv->lock); sema_init(&pwrctrlpriv->check_32k_lock, 1); pwrctrlpriv->rf_pwrstate = rf_on; pwrctrlpriv->ips_enter_cnts = 0; @@ -1357,13 +1356,13 @@ void rtw_ps_deny(struct adapter *padapter, enum PS_DENY_REASON reason) pwrpriv = adapter_to_pwrctl(padapter); - down(&pwrpriv->lock); + mutex_lock(&pwrpriv->lock); if (pwrpriv->ps_deny & BIT(reason)) { DBG_871X(FUNC_ADPT_FMT ": [WARNING] Reason %d had been set before!!\n", FUNC_ADPT_ARG(padapter), reason); } pwrpriv->ps_deny |= BIT(reason); - up(&pwrpriv->lock); + mutex_unlock(&pwrpriv->lock); /* DBG_871X("-" FUNC_ADPT_FMT ": Now PS deny for 0x%08X\n", */ /* FUNC_ADPT_ARG(padapter), pwrpriv->ps_deny); */ @@ -1383,13 +1382,13 @@ void rtw_ps_deny_cancel(struct adapter *padapter, enum PS_DENY_REASON reason) pwrpriv = adapter_to_pwrctl(padapter); - down(&pwrpriv->lock); + mutex_lock(&pwrpriv->lock); if ((pwrpriv->ps_deny & BIT(reason)) == 0) { DBG_871X(FUNC_ADPT_FMT ": [ERROR] Reason %d had been canceled before!!\n", FUNC_ADPT_ARG(padapter), reason); } pwrpriv->ps_deny &= ~BIT(reason); - up(&pwrpriv->lock); + mutex_unlock(&pwrpriv->lock); /* DBG_871X("-" FUNC_ADPT_FMT ": Now PS deny for 0x%08X\n", */ /* FUNC_ADPT_ARG(padapter), pwrpriv->ps_deny); */ diff --git a/drivers/staging/rtl8723bs/include/rtw_pwrctrl.h b/drivers/staging/rtl8723bs/include/rtw_pwrctrl.h index 72df6cffe62e..abf48ae01900 100644 --- a/drivers/staging/rtl8723bs/include/rtw_pwrctrl.h +++ b/drivers/staging/rtl8723bs/include/rtw_pwrctrl.h @@ -7,6 +7,7 @@ #ifndef __RTW_PWRCTRL_H_ #define __RTW_PWRCTRL_H_ +#include #define FW_PWR0 0 #define FW_PWR1 1 @@ -207,7 +208,7 @@ typedef struct pno_scan_info struct pwrctrl_priv { - _pwrlock lock; + struct mutex lock; _pwrlock check_32k_lock; volatile u8 rpwm; /* requested power state for fw */ volatile u8 cpwm; /* fw current power state. updated when 1. read from HCPWM 2. driver lowers power level */ From patchwork Mon Dec 10 21:40:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 153364 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp4043926ljp; Mon, 10 Dec 2018 13:40:51 -0800 (PST) X-Google-Smtp-Source: AFSGD/VgyL1EFD6hZwJXoZ3W0dGmVsEWVbmLHwvloLuq9qx9v7nb05ZIOQa2+FqmFbSsnND1//qq X-Received: by 2002:a17:902:6b83:: with SMTP id p3mr13532108plk.118.1544478051371; Mon, 10 Dec 2018 13:40:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544478051; cv=none; d=google.com; s=arc-20160816; b=igvlP7XDX1BgvOnltt5UcSr8cXpYZClHnkHTmHPCVTXaPz5CEVaTYLg8Qai6huTCNX efmzzIVki+jqm5xiXe06wUBM7YXWlumJ3lLnDcOY5hB+yjNyGlSQHc1eAYL3tufEIfxh XJubez4cEz2qprrwINZWv2N3u3XkvY/nM8o4N7YU+Mzjzmzl6DzIt1UcMYcOZKYZfcVI b+ENunUIP1tD/DWEUvihFEGpfVpIxbJ2WyCR9SrXDxPYHOsX5iAj82AtllXrM1KSD4fF D4xt/hDIjEsgEbbqcSSIzurMh0eVcWAMS+VlCXSfmbO1XIhj/85yTDOn/fBcbjtI0ur5 zVBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ZakXBNEldyrZlxSM2U5f4AAbqCQgYQIYURGpUN6iiag=; b=eMLwqIGUNQGTIhtflvs/AfZJ4e1Rz+Pfs9ei/mVx4sRFNfhl/INPmWyZk1+kjSpNay BeYbIxM2YstMGGR4f4CYlITPCgmtskCAR4/OyLyAElUP58XZIIxB8LGhlE/o9SOb15FA YKLuEsSvsVKmLxUEDAWb8TG4qQpaiOxnulVUWTA9ZPLsJFA/yoomMA3znKhu7g7o84sS OBb4X9P0WQMy64o2RFkiytV9H3cEOXk42kMi6kQ7qY0MjIw48T1623t/cg4LGFd+Q8sO wwN/TT3L5ZQ7RAtJQBhhNThlY4coWQTeORhZNQiz5L7cw5s/6CExOSa9z7OcINyFopir I9hg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t16si12226052pfk.139.2018.12.10.13.40.51; Mon, 10 Dec 2018 13:40:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729694AbeLJVks (ORCPT + 31 others); Mon, 10 Dec 2018 16:40:48 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:40459 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727225AbeLJVks (ORCPT ); Mon, 10 Dec 2018 16:40:48 -0500 Received: from wuerfel.lan ([109.192.41.194]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.145]) with ESMTPA (Nemesis) id 1MKt3r-1gkxju2shR-00LBkS; Mon, 10 Dec 2018 22:40:39 +0100 From: Arnd Bergmann To: Greg Kroah-Hartman Cc: Bastien Nocera , Hans de Goede , Larry Finger , linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, Arnd Bergmann Subject: [PATCH 3/3] staging: rtl8723bs: remove semaphore remnants Date: Mon, 10 Dec 2018 22:40:32 +0100 Message-Id: <20181210214032.1441224-3-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181210214032.1441224-1-arnd@arndb.de> References: <20181210214032.1441224-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:UIWJreOK1DoDOD+HihI3f0vtdhFbCYFZJ4q6s5/HZGs0VyhXOg9 3DrLSI6S6dV8t0UzJg5i11Cw9IymXEVLzrcCjTBAufK1SvWGUYBpevx78jxbpULuvtZSJGn Up6ZlPf/k2CMgVemonZTUnz0R05mj7Tivz7BrfuYi/CxTzS/ygj6XgGNBPiC59l/9G49Ee9 xNF9XKFRr2/AXvNQanpaw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:mThaKqYdTIY=:7vcTxszwHksxVdQ0ydQ3qZ qmgo7dTQG+kGnPApNf3PB9xs/rrZ+rgM8/+o9iV2Em7gB3LMzxUy2ZtN3MRWys4htioSdgCB5 TS39eKWyrrPmS62IpPgFlpoUmmQ/2dH+HmsVjTk6E0Jy8qfghJtEa7UDtlJ/Q1jhbNJeQUJ2G E5jppVR0rUVk5DFK9W93NpG7WEq9LecYpuUe7lp+OTIQrR6w/E4mWmkXnBbhiPyBOuC8vX6VK L9jJSpUiglzRkpNFJGmp0d221YsW1USW1RDC5clcNjDcan66IVjlnZj7Rq02HhD0TCF8EMmNJ dKb3B0pntqbj56fcJZbGgvjxHSWdX29hxOa+/4/uYhqwmpXjNqEvdGnEkCXj8AOPusyGmYQdX T2MxdOOx1xkMSJWhyXcgNxpw8dPx5VWf7l5qRULC/yDRRN0tgPJo4Ms8e8pwco6nymEysxTjC In9jMgvwxEemnqDDEiH9kRvrKSX0tdcQbxZJdDQ1lGTWe7sWotD66CNMGIcsITbiz1sIlZpbM mATxq/s6LksHH8WnjAOfy1MrBFkxsA7RC35K5XIVKSWHGdCB+UVYssHq8bhDsBkPndnMDlhyb nqnuEH7IfK4YgHKo0mMLVB41f66OxGWOneIDrkdxIkrHNGCzZFbxfMcYcra+BVeqCjLYfQq22 SYlAzhQFcDvWhbn5W9WZCJJBXG9ytBAKJ70t8r5KYW3P1kq5datz1llo31Rz7YUWYBiXMlCOS DqWSSGFR5z4NQLtDqpXHVWI9U6jeuqPTQQUjoA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Nothing uses the semaphores any more in this driver, so remove all references to that type. Signed-off-by: Arnd Bergmann --- drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 1 - drivers/staging/rtl8723bs/include/osdep_service_linux.h | 2 -- drivers/staging/rtl8723bs/include/rtw_io.h | 1 - drivers/staging/rtl8723bs/include/rtw_mp.h | 1 - drivers/staging/rtl8723bs/include/rtw_pwrctrl.h | 5 ----- 5 files changed, 10 deletions(-) -- 2.20.0 diff --git a/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c b/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c index b7dd5fec9b31..eb27522a5444 100644 --- a/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c +++ b/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c @@ -1126,7 +1126,6 @@ void rtw_init_pwrctrl_priv(struct adapter *padapter) struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(padapter); mutex_init(&pwrctrlpriv->lock); - sema_init(&pwrctrlpriv->check_32k_lock, 1); pwrctrlpriv->rf_pwrstate = rf_on; pwrctrlpriv->ips_enter_cnts = 0; pwrctrlpriv->ips_leave_cnts = 0; diff --git a/drivers/staging/rtl8723bs/include/osdep_service_linux.h b/drivers/staging/rtl8723bs/include/osdep_service_linux.h index 58d1e1019241..2f1b51e614fb 100644 --- a/drivers/staging/rtl8723bs/include/osdep_service_linux.h +++ b/drivers/staging/rtl8723bs/include/osdep_service_linux.h @@ -22,7 +22,6 @@ #include #include #include - #include #include #include #include @@ -41,7 +40,6 @@ #include #include - typedef struct semaphore _sema; typedef spinlock_t _lock; typedef struct mutex _mutex; typedef struct timer_list _timer; diff --git a/drivers/staging/rtl8723bs/include/rtw_io.h b/drivers/staging/rtl8723bs/include/rtw_io.h index 4f8be55da65d..99d104b3647a 100644 --- a/drivers/staging/rtl8723bs/include/rtw_io.h +++ b/drivers/staging/rtl8723bs/include/rtw_io.h @@ -115,7 +115,6 @@ struct io_req { u32 command; u32 status; u8 *pbuf; - _sema sema; void (*_async_io_callback)(struct adapter *padater, struct io_req *pio_req, u8 *cnxt); u8 *cnxt; diff --git a/drivers/staging/rtl8723bs/include/rtw_mp.h b/drivers/staging/rtl8723bs/include/rtw_mp.h index 839084733201..bb3970d58573 100644 --- a/drivers/staging/rtl8723bs/include/rtw_mp.h +++ b/drivers/staging/rtl8723bs/include/rtw_mp.h @@ -62,7 +62,6 @@ typedef struct _MPT_CONTEXT /* Indicate if the driver is unloading or unloaded. */ bool bMptDrvUnload; - _sema MPh2c_Sema; _timer MPh2c_timeout_timer; /* Event used to sync H2c for BT control */ diff --git a/drivers/staging/rtl8723bs/include/rtw_pwrctrl.h b/drivers/staging/rtl8723bs/include/rtw_pwrctrl.h index abf48ae01900..e2a4c680125f 100644 --- a/drivers/staging/rtl8723bs/include/rtw_pwrctrl.h +++ b/drivers/staging/rtl8723bs/include/rtw_pwrctrl.h @@ -94,10 +94,6 @@ struct reportpwrstate_parm { unsigned short rsvd; }; - -typedef _sema _pwrlock; - - #define LPS_DELAY_TIME 1*HZ /* 1 sec */ #define EXE_PWR_NONE 0x01 @@ -209,7 +205,6 @@ typedef struct pno_scan_info struct pwrctrl_priv { struct mutex lock; - _pwrlock check_32k_lock; volatile u8 rpwm; /* requested power state for fw */ volatile u8 cpwm; /* fw current power state. updated when 1. read from HCPWM 2. driver lowers power level */ volatile u8 tog; /* toggling */