From patchwork Tue May 29 18:06:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 10436627 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 3CF9E602BF for ; Tue, 29 May 2018 18:06:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2418128A13 for ; Tue, 29 May 2018 18:06:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 18B2B28A2E; Tue, 29 May 2018 18:06:29 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 7242628A6A for ; Tue, 29 May 2018 18:06:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965843AbeE2SG0 (ORCPT ); Tue, 29 May 2018 14:06:26 -0400 Received: from muru.com ([72.249.23.125]:45028 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965391AbeE2SGU (ORCPT ); Tue, 29 May 2018 14:06:20 -0400 Received: from hillo.muru.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id F26028087; Tue, 29 May 2018 18:08:40 +0000 (UTC) From: Tony Lindgren To: Kalle Valo Cc: Eyal Reizer , Kishon Vijay Abraham I , Guy Mishol , Luca Coelho , Maital Hahn , Maxim Altshul , Shahar Patury , linux-wireless@vger.kernel.org, linux-omap@vger.kernel.org Subject: [RFT 4/6] wlcore: Fix misplaced PM call for scan_complete_work() Date: Tue, 29 May 2018 11:06:03 -0700 Message-Id: <20180529180605.73622-5-tony@atomide.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180529180605.73622-1-tony@atomide.com> References: <20180529180605.73622-1-tony@atomide.com> 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 With runtime PM enabled, we now need to have wlcore enabled longer until after we're done calling wlcore_cmd_regdomain_config_locked(): scan_complete_work() wlcore_cmd_regdomain_config_locked() wlcore_cmd_send_failsafe() wl12xx_sdio_raw_read() Note that this is not needed before runtime PM support as the custom PM code had it's own timer. We have not yet enabled runtime PM autosuspend for wlcore and this is why this issue now shows up. Let's fix the issues first before we enable runtime PM autosuspend. Signed-off-by: Tony Lindgren --- drivers/net/wireless/ti/wlcore/scan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ti/wlcore/scan.c b/drivers/net/wireless/ti/wlcore/scan.c --- a/drivers/net/wireless/ti/wlcore/scan.c +++ b/drivers/net/wireless/ti/wlcore/scan.c @@ -78,8 +78,6 @@ void wl1271_scan_complete_work(struct work_struct *work) wl1271_cmd_build_ap_probe_req(wl, wlvif, wlvif->probereq); } - pm_runtime_put(wl->dev); - if (wl->scan.failed) { wl1271_info("Scan completed due to error."); wl12xx_queue_recovery_work(wl); @@ -87,6 +85,8 @@ void wl1271_scan_complete_work(struct work_struct *work) wlcore_cmd_regdomain_config_locked(wl); + pm_runtime_put(wl->dev); + ieee80211_scan_completed(wl->hw, &info); out: