From patchwork Tue Nov 15 06:06:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 9429023 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 466ED60471 for ; Tue, 15 Nov 2016 06:07:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2505228A9B for ; Tue, 15 Nov 2016 06:07:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 184F328B73; Tue, 15 Nov 2016 06:07:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A501528A9B for ; Tue, 15 Nov 2016 06:07:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966226AbcKOGHJ (ORCPT ); Tue, 15 Nov 2016 01:07:09 -0500 Received: from mail-pg0-f42.google.com ([74.125.83.42]:34030 "EHLO mail-pg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966199AbcKOGHF (ORCPT ); Tue, 15 Nov 2016 01:07:05 -0500 Received: by mail-pg0-f42.google.com with SMTP id x23so60152988pgx.1 for ; Mon, 14 Nov 2016 22:07:05 -0800 (PST) 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=RuMh318y+c0q4OEALzRbLucfLt5TnTvo/Y/ZAkBbNyU=; b=CNPpJ9wZqlaXjGcIAdg+J+8awjpu9pRu9TXELMllqrC9cC5RNWqTpJ7RQ27SYhrkQK NLyi8VgpvsKlHGxVcJhsE6DeXDVdwS4jy0oCPAWEj3SLRMeWPUlgrVu0SrROxr5Daq8K bGF/vbVEAOij+xvvRlbyXooq9uLQaXOf3zTqI= 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=RuMh318y+c0q4OEALzRbLucfLt5TnTvo/Y/ZAkBbNyU=; b=kQPK8wrKw7GO5I3i55HRNNJW5agsJnL0u2/TsbGqJSUsYiKPZwgEUAXTrW1ACCDtl6 g914xFSuFqwVDcF+b9XVPhbzjP5kDNclvbFyX5xocfo05wBvD0d3LkaG0P9HePFS4I83 BMTtIWUoUv5Ne8szzYF3h63wnMYKQ/dqMmknBh57zMUyFdOMnUHNRSSel/rUXxPBMXPG yHnT0UcwzILou50h/++0vEJmxEeHfXTZLdY5JMnTPyw+4E0Rc+GEurwz8vzf4sx9j+k8 meDIZrCAe8xihzxQU24btqygHBR87bCh5kFP4UOYpFDOFVqOILo0Npsre88U31ok9wHt IaZQ== X-Gm-Message-State: ABUngvevpao/z2T5iKotjKnChjKm65z14eomp9js6Ja0BERhZ+QNZWasSIYFnamUeINzV4Gh X-Received: by 10.98.44.212 with SMTP id s203mr43729611pfs.84.1479190024559; Mon, 14 Nov 2016 22:07:04 -0800 (PST) Received: from localhost.localdomain (ip68-111-223-48.sd.sd.cox.net. [68.111.223.48]) by smtp.gmail.com with ESMTPSA id zf9sm39563129pac.12.2016.11.14.22.07.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 Nov 2016 22:07:03 -0800 (PST) From: Bjorn Andersson To: Eugene Krasnikov , Kalle Valo Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Andy Gross Subject: [PATCH v5 5/5] wcn36xx: Don't use the destroyed hal_mutex Date: Mon, 14 Nov 2016 22:06:54 -0800 Message-Id: <1479190014-11297-5-git-send-email-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1479190014-11297-1-git-send-email-bjorn.andersson@linaro.org> References: <1479190014-11297-1-git-send-email-bjorn.andersson@linaro.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ieee80211_unregister_hw() might invoke operations to stop the interface, that uses the hal_mutex. So don't destroy it until after we're done using it. Signed-off-by: Bjorn Andersson --- With this patch I can successfully (although with a SMD send timeout in the shutdown path) start and stop the WCNSS PIL/remoteproc multiple times and the wlan0 interface will come and go accordingly. Will submit the necessary DT patches soon as well. Changes since v4: - New patch drivers/net/wireless/ath/wcn36xx/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index 96a9584edcbb..0002190c9041 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1241,7 +1241,6 @@ static int wcn36xx_remove(struct platform_device *pdev) wcn36xx_dbg(WCN36XX_DBG_MAC, "platform remove\n"); release_firmware(wcn->nv); - mutex_destroy(&wcn->hal_mutex); ieee80211_unregister_hw(hw); @@ -1250,6 +1249,8 @@ static int wcn36xx_remove(struct platform_device *pdev) iounmap(wcn->dxe_base); iounmap(wcn->ccu_base); + + mutex_destroy(&wcn->hal_mutex); ieee80211_free_hw(hw); return 0;