From patchwork Thu Jun 2 04:24:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Binoy Jayan X-Patchwork-Id: 69120 Delivered-To: patch@linaro.org Received: by 10.140.23.41 with SMTP id 38csp134766qgo; Wed, 1 Jun 2016 21:25:24 -0700 (PDT) X-Received: by 10.98.70.76 with SMTP id t73mr669204pfa.123.1464841524227; Wed, 01 Jun 2016 21:25:24 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q1si14799601pas.148.2016.06.01.21.25.23; Wed, 01 Jun 2016 21:25:24 -0700 (PDT) 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; dkim=pass header.i=@linaro.org; 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; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751543AbcFBEZU (ORCPT + 30 others); Thu, 2 Jun 2016 00:25:20 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:34310 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750958AbcFBEYc (ORCPT ); Thu, 2 Jun 2016 00:24:32 -0400 Received: by mail-pa0-f46.google.com with SMTP id bz2so2443465pad.1 for ; Wed, 01 Jun 2016 21:24:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rvbML0yOcFMB2+GNdReHCk25eEvHsTcSIRtZ+nvNn3g=; b=Fzh8TTAqsYQR8gf6f0dQPukJsDh6HGDy5xAfMt/cRKha4NSZvLOwi0qx2g4VYcRwX+ Kzcw8RWHMonSu9UcGx4MtoVjLX64rJevL0xvVxClUnaHYdasxIIBzBtPMgYjAirVV1jp Dp6EwnQcKg6D6YQ4lNBXxQZQnJ/luwxAYcejc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rvbML0yOcFMB2+GNdReHCk25eEvHsTcSIRtZ+nvNn3g=; b=WXTB8Mq9AgTCLEmbY5eM3kX5i0xcZk2X8Z3sqGzQGzFGNz4oZPjv/nDoTdvJXEI4Ni LwJrb7IooXnbuxKONg0YHXjg828PvQVtTNGHoAUOEESW0JnG8qRpg+OqMI3Cx/wqaoA9 T3A09vYupc8RwSTo9b/mdCPqMQrIYV1jsaOfviZFNpRgiJLvr+7zRtqz73Vxr3mEztZn HrkEFG+e7uAmRZMnzzdO01TnZgKUqV10x0/MQKNDX+GZn6W9RZtDrM6nFwKyGywMZi+W xuK/u5bdLb9dYwn/iIFe19FQ1UijtooTLPWG7J27UVhRoSpejxBohDJZF2A+pqSSrir6 2eng== X-Gm-Message-State: ALyK8tICM52AEl0D0Dw52KR5BL96CSL+o82Be5VJHGMxFwEz7uJyMMZE4vFXGL3Unc4+G4nJ X-Received: by 10.66.139.133 with SMTP id qy5mr2729123pab.4.1464841472257; Wed, 01 Jun 2016 21:24:32 -0700 (PDT) Received: from blr-ubuntu-59.ap.qualcomm.com ([202.46.23.61]) by smtp.gmail.com with ESMTPSA id s86sm36652609pfi.69.2016.06.01.21.24.29 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Jun 2016 21:24:31 -0700 (PDT) From: Binoy Jayan To: Greg Kroah-Hartman , Larry Finger , Florian Schilhabel Cc: Arnd Bergmann , driverdev-devel@linuxdriverproject.org, linux-kernel@vger.kernel.org, Binoy Jayan Subject: [PATCH v2 2/4] rtl8712: Replace semaphore terminate_cmdthread_sema with completion Date: Thu, 2 Jun 2016 09:54:08 +0530 Message-Id: <1464841450-24772-3-git-send-email-binoy.jayan@linaro.org> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1464841450-24772-1-git-send-email-binoy.jayan@linaro.org> References: <1464841450-24772-1-git-send-email-binoy.jayan@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The semaphore 'terminate_cmdthread_sema' is used as completion, so convert it to a struct completion type. Signed-off-by: Binoy Jayan --- 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(-) -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project 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*/