Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2424286pxb; Tue, 23 Feb 2021 06:50:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJzRI+1H4BLU/OxhY7NviMhMd6qnrgtbUW7YmBrSPlGtaIVX3TgKvJraD3bbDJym/CAhqWMy X-Received: by 2002:a05:6402:1855:: with SMTP id v21mr5427658edy.229.1614091821291; Tue, 23 Feb 2021 06:50:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614091821; cv=none; d=google.com; s=arc-20160816; b=y8LHRP9hhOe2DSSq9rq5eSRsNekNCF1NG0vU4oOJoMQQJL8A8ICIRVM4oHjv94jC71 rtjHoj5V+WQvRObrFIQ9vzZpNFFseZY4XyQo9NmFaLarEdOqtYzY9v1S3oiyNzH58DeS 1srxYle3uUxZDAoZw9QKJwqzeMBRHbYi+Nt6VBErowKjPTEQwl7h9ttyb1RGSa4yup5m 90FdMcAEgk50DcROQed1B/QgYaFUmVc0tvRN28++OLYeoDc4uJtp0RDoudmoSw6DRSd9 miYRlq+f6NtJbQO9OppEqxXoz/yq2Bt0jdI1GSwacyAwQFcnu1aaGA/DmcPauweIyNBs Af0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from:cc; bh=FmIWEXlbyvB8ABd7F2ZLvXoPLdpu2F2d/ghfQR55CGA=; b=tTUvJbaIDHgesQHZRBEDYAh8/uKTOUVQbvkttA/nuYnFx2M5VhO6lw1jeubypVQ7g8 4XGcv3BABg0xfg2CkYavOLZrcr/2mZna3CNNCGs6AxEpRWcG9kIPyCx0lIPAo+QdN4Nn jgUxgz4c8/cCpnx+r5bNJWcMakyBJdIQfccmHh9l++Y3rRAU3LJZGuMSb/QgDvkqh39d LAyX1ZYyLJg2JbFUOHvmQGvaXFzmm9VSI9Ggnsvk3i6sCihA9fiED4WBa3OGqfZEBMEd 6uJX/7TbxSiamU7upXjLMvblw46XFW/wuWPXtw3JloU2Dh2uIbJtxZM5MlY7pD4gtEfU RZCw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u23si878539ejb.524.2021.02.23.06.49.56; Tue, 23 Feb 2021 06:50:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233046AbhBWOah (ORCPT + 99 others); Tue, 23 Feb 2021 09:30:37 -0500 Received: from alexa-out.qualcomm.com ([129.46.98.28]:52087 "EHLO alexa-out.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233056AbhBWOaZ (ORCPT ); Tue, 23 Feb 2021 09:30:25 -0500 Received: from ironmsg-lv-alpha.qualcomm.com ([10.47.202.13]) by alexa-out.qualcomm.com with ESMTP; 23 Feb 2021 06:29:44 -0800 X-QCInternal: smtphost Received: from ironmsg02-blr.qualcomm.com ([10.86.208.131]) by ironmsg-lv-alpha.qualcomm.com with ESMTP/TLS/AES256-SHA; 23 Feb 2021 06:29:42 -0800 Cc: ath10k-review.external@qti.qualcomm.com, kvalo@codeaurora.org, davem@davemloft.net, kuba@kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kuabhs@chromium.org, dianders@chromium.org, briannorris@chromium.org, Youghandhar Chintala X-QCInternal: smtphost Received: from youghand-linux.qualcomm.com ([10.206.66.115]) by ironmsg02-blr.qualcomm.com with ESMTP; 23 Feb 2021 19:59:10 +0530 Received: by youghand-linux.qualcomm.com (Postfix, from userid 2370257) id E27EB215EC; Tue, 23 Feb 2021 19:59:10 +0530 (IST) From: Youghandhar Chintala To: ath10k@lists.infradead.org Subject: [PATCH v3] ath10k: skip the wait for completion to recovery in shutdown path Date: Tue, 23 Feb 2021 19:59:08 +0530 Message-Id: <20210223142908.23374-1-youghand@codeaurora.org> X-Mailer: git-send-email 2.29.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Currently in the shutdown callback we wait for recovery to complete before freeing up the resources. This results in additional two seconds delay during the shutdown and thereby increase the shutdown time. As an attempt to take less time during shutdown, remove the wait for recovery completion in the shutdown callback and added an API to freeing the reosurces in which they were common for shutdown and removing the module. Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.3.1-01040-QCAHLSWMTPLZ-1 Signed-off-by: Youghandhar Chintala Change-Id: I65bc27b5adae1fedc7f7b367ef13aafbd01f8c0c --- Changes from v2: -Corrected commit text and added common API for freeing the resources for shutdown and unloading the module --- drivers/net/wireless/ath/ath10k/snoc.c | 29 ++++++++++++++++++-------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/snoc.c b/drivers/net/wireless/ath/ath10k/snoc.c index 84666f72bdfa..70b3f2bd1c81 100644 --- a/drivers/net/wireless/ath/ath10k/snoc.c +++ b/drivers/net/wireless/ath/ath10k/snoc.c @@ -1781,17 +1781,11 @@ static int ath10k_snoc_probe(struct platform_device *pdev) return ret; } -static int ath10k_snoc_remove(struct platform_device *pdev) +static int ath10k_snoc_free_resources(struct ath10k *ar) { - struct ath10k *ar = platform_get_drvdata(pdev); struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); - ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc remove\n"); - - reinit_completion(&ar->driver_recovery); - - if (test_bit(ATH10K_SNOC_FLAG_RECOVERY, &ar_snoc->flags)) - wait_for_completion_timeout(&ar->driver_recovery, 3 * HZ); + ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc free resources\n"); set_bit(ATH10K_SNOC_FLAG_UNREGISTERING, &ar_snoc->flags); @@ -1805,12 +1799,29 @@ static int ath10k_snoc_remove(struct platform_device *pdev) return 0; } +static int ath10k_snoc_remove(struct platform_device *pdev) +{ + struct ath10k *ar = platform_get_drvdata(pdev); + struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); + + ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc remove\n"); + + reinit_completion(&ar->driver_recovery); + + if (test_bit(ATH10K_SNOC_FLAG_RECOVERY, &ar_snoc->flags)) + wait_for_completion_timeout(&ar->driver_recovery, 3 * HZ); + + ath10k_snoc_free_resources(ar); + + return 0; +} + static void ath10k_snoc_shutdown(struct platform_device *pdev) { struct ath10k *ar = platform_get_drvdata(pdev); ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc shutdown\n"); - ath10k_snoc_remove(pdev); + ath10k_snoc_free_resources(ar); } static struct platform_driver ath10k_snoc_driver = { -- 2.29.0