From patchwork Thu Jul 14 21:29:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Franky Lin X-Patchwork-Id: 976102 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6ELURYv007807 for ; Thu, 14 Jul 2011 21:30:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932356Ab1GNVaR (ORCPT ); Thu, 14 Jul 2011 17:30:17 -0400 Received: from mms1.broadcom.com ([216.31.210.17]:4281 "EHLO mms1.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932419Ab1GNVaC (ORCPT ); Thu, 14 Jul 2011 17:30:02 -0400 Received: from [10.9.200.131] by mms1.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.3.2)); Thu, 14 Jul 2011 14:34:51 -0700 X-Server-Uuid: 02CED230-5797-4B57-9875-D5D2FEE4708A Received: from mail-irva-13.broadcom.com (10.11.16.103) by IRVEXCHHUB01.corp.ad.broadcom.com (10.9.200.131) with Microsoft SMTP Server id 8.2.247.2; Thu, 14 Jul 2011 14:29:39 -0700 Received: from mail-sj1-12.sj.broadcom.com (mail-sj1-12.sj.broadcom.com [10.17.16.106]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id F179C74D06; Thu, 14 Jul 2011 14:29:38 -0700 (PDT) Received: from lc-sj1-3560.broadcom.com (lc-sj1-3560.sj.broadcom.com [10.17.194.250]) by mail-sj1-12.sj.broadcom.com (Postfix) with ESMTP id 85EE920515; Thu, 14 Jul 2011 14:29:33 -0700 (PDT) Received: by lc-sj1-3560.broadcom.com (Postfix, from userid 25250) id 63FA02C19D1D; Thu, 14 Jul 2011 14:29:31 -0700 (PDT) From: "Franky Lin" To: gregkh@suse.de cc: devel@linuxdriverproject.org, linux-wireless@vger.kernel.org Subject: [PATCH 18/35] staging: brcm80211: use mutex instead of semaphore in dhd_linux.c Date: Thu, 14 Jul 2011 14:29:14 -0700 Message-ID: <1310678971-28952-19-git-send-email-frankyl@broadcom.com> X-Mailer: git-send-email 1.7.3.2 In-Reply-To: <1310678971-28952-1-git-send-email-frankyl@broadcom.com> References: <1310678971-28952-1-git-send-email-frankyl@broadcom.com> MIME-Version: 1.0 X-WSS-ID: 6201BF733B420695918-12-01 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 14 Jul 2011 21:30:28 +0000 (UTC) From: Arend van Spriel The semaphore proto_sem has been replaced with mutex proto_block which lock certain code paths for one thread. Signed-off-by: Arend van Spriel Reviewed-by: Roland Vossen Reviewed-by: Franky Lin --- drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c index 6c8599c..310a96f 100644 --- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c +++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -73,7 +74,7 @@ struct brcmf_info { /* OS/stack specifics */ struct brcmf_if *iflist[BRCMF_MAX_IFS]; - struct semaphore proto_sem; + struct mutex proto_block; wait_queue_head_t ioctl_resp_wait; /* Thread to issue ioctl for multicast */ @@ -1312,7 +1313,7 @@ struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus, uint bus_hdrlen) goto fail; net->netdev_ops = NULL; - sema_init(&drvr_priv->proto_sem, 1); + mutex_init(&drvr_priv->proto_block); /* Initialize other structure content */ init_waitqueue_head(&drvr_priv->ioctl_resp_wait); @@ -1582,7 +1583,7 @@ int brcmf_os_proto_block(struct brcmf_pub *drvr) struct brcmf_info *drvr_priv = drvr->info; if (drvr_priv) { - down(&drvr_priv->proto_sem); + mutex_lock(&drvr_priv->proto_block); return 1; } return 0; @@ -1593,7 +1594,7 @@ int brcmf_os_proto_unblock(struct brcmf_pub *drvr) struct brcmf_info *drvr_priv = drvr->info; if (drvr_priv) { - up(&drvr_priv->proto_sem); + mutex_unlock(&drvr_priv->proto_block); return 1; }