Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp979831pxb; Tue, 26 Oct 2021 00:03:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEPRFqkjbOzZbYRuIme3nFZjUtCH/kLp4S5QTAn65ZGUw6aMt+sfw5CJQCD7bMtrTZtR/9 X-Received: by 2002:a05:6402:1390:: with SMTP id b16mr32557527edv.166.1635231809212; Tue, 26 Oct 2021 00:03:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635231809; cv=none; d=google.com; s=arc-20160816; b=KcQ4saZzeFig1/JhAXyAIMXUtpPjgUTBtwedOv08ZxKu/X03nuLK+1a9eLB35gzfLb TFY9rVTuXsE+hvqDshqZAs9l9ba1ZiMP+6ZTMy/INx+rR1V/yu+1+KichdT0BpthHYOS Esy6Pm0ROW4LPffPSTaY6rHndTFIuvoQ8FowhZZMoqfxEwPyARaa95g4E6DFbaiSdVsk mSTlD1+c675pIcBfAbfEanKO8bYSGtAK3To82xrxJ2siMEgPhB/iAzvjry10ljdeP/MD zn9AIkZSlN0nhfAkKBtYX6sKCGKsWJ9QpKBv7lcZt8JdsCRbgWz9BEC0/eIzkKEBScV/ VwaA== 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:cc:to:from:dmarc-filter:sender :dkim-signature; bh=jEEIgUVrINI0IucnhBKSg0qksHoIt+oGv9TeC+tnQHU=; b=RHfMfUuLDUT0zFy1EYj06o2p/dF3Iq7PFkOafg1TpFNoQBti/eKIIo+tnt70qwvuoC GaUHTstfaOD2a+LV6EBiXzuaalKaX9n6sUZbeuwV66X8b1I5XWFoZUYCbedOklRQh7vs y/6vPCJKteGE8iL7uKezoW3jiEFlnvh9Ypvr4MTLfyq9w7WY1p9HRGAs3k77xxXisZUy 0yp3+6SBdc7sT4VA0A/XONJwE+EARbTfvaVQAyGittflnDo9Pl7G4gSiQfumi2R7Lhus bKSH6xw/ScPQ2UGuJ/S4xsu3csUb5LnPZqjmpBodY2v2ChW0VFuL/Ehcahdz8gqBxOSF 7fUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=vg44jYST; 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 s12si15119071edw.156.2021.10.26.00.03.13; Tue, 26 Oct 2021 00:03:29 -0700 (PDT) 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; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=vg44jYST; 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 S231225AbhJZEUI (ORCPT + 67 others); Tue, 26 Oct 2021 00:20:08 -0400 Received: from so254-9.mailgun.net ([198.61.254.9]:57628 "EHLO so254-9.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231224AbhJZEUG (ORCPT ); Tue, 26 Oct 2021 00:20:06 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1635221863; h=Content-Transfer-Encoding: MIME-Version: Message-Id: Date: Subject: Cc: To: From: Sender; bh=jEEIgUVrINI0IucnhBKSg0qksHoIt+oGv9TeC+tnQHU=; b=vg44jYSTJmKRNduPm5+BNjEprbOpwk4pT2E6QG5sPN6a9WtIoWQnVv91gmaaqEeViMG6KFHh oKzwYNVQ56dqAcsfvWcHGQQWNpAXaE1iClXIKF6mhvTtxuWAFs6tb+IpNuBki5Vhn2Z1Ka3s kOLp+EpDhIEeltXgIGXMi5uTYTk= X-Mailgun-Sending-Ip: 198.61.254.9 X-Mailgun-Sid: WyI3YTAwOSIsICJsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n06.prod.us-west-2.postgun.com with SMTP id 617781585baa84c77be2fbb4 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 26 Oct 2021 04:17:28 GMT Sender: bqiang=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id E9630C4360D; Tue, 26 Oct 2021 04:17:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from bqiang-Celadon-RN.qca.qualcomm.com (unknown [180.166.53.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: bqiang) by smtp.codeaurora.org (Postfix) with ESMTPSA id ECC69C43460; Tue, 26 Oct 2021 04:17:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 smtp.codeaurora.org ECC69C43460 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=codeaurora.org From: Baochen Qiang To: ath11k@lists.infradead.org Cc: linux-wireless@vger.kernel.org Subject: [PATCH 6/7] ath11k: do not restore ASPM in case of single MSI vector Date: Tue, 26 Oct 2021 12:17:22 +0800 Message-Id: <20211026041722.5271-1-bqiang@codeaurora.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Carl Huang Current code enables ASPM by default, it allows MHI to enter M2 state. In case of one MSI vector, system hang is observed if ath11k does MHI register reading in this state. The issue was reported on Dell XPS 13 9310 but is seen also on XPS 15 and XPS 17 laptops. The workaround here is to prevent MHI from entering M2 state, this can be done by disabling ASPM if only one MSI vector is used. When using 32 vectors ASPM is enabled as before. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Carl Huang Signed-off-by: Kalle Valo Signed-off-by: Baochen Qiang --- drivers/net/wireless/ath/ath11k/pci.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath11k/pci.c b/drivers/net/wireless/ath/ath11k/pci.c index 0a87d00a3a23..b450b4ed35d1 100644 --- a/drivers/net/wireless/ath/ath11k/pci.c +++ b/drivers/net/wireless/ath/ath11k/pci.c @@ -1220,7 +1220,13 @@ static int ath11k_pci_start(struct ath11k_base *ab) set_bit(ATH11K_PCI_FLAG_INIT_DONE, &ab_pci->flags); - ath11k_pci_aspm_restore(ab_pci); + /* TODO: for now don't restore ASPM in case of single MSI + * vector as MHI register reading in M2 causes system hang. + */ + if (test_bit(ATH11K_PCI_FLAG_MULTI_MSI_VECTORS, &ab_pci->flags)) + ath11k_pci_aspm_restore(ab_pci); + else + ath11k_info(ab, "leaving PCI ASPM disabled to avoid MHI M2 problems\n"); ath11k_pci_ce_irqs_enable(ab); ath11k_ce_rx_post_buf(ab); -- 2.25.1