Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp265325rdb; Mon, 18 Sep 2023 14:33:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEXt6G1WjzJAkREvktWFRx7T/MoligYyG+KztVra/wkZSCLn4P36xs4td+xukcaMbeb1TLO X-Received: by 2002:a17:90b:4acc:b0:274:751a:3f3 with SMTP id mh12-20020a17090b4acc00b00274751a03f3mr943367pjb.7.1695072817351; Mon, 18 Sep 2023 14:33:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695072817; cv=none; d=google.com; s=arc-20160816; b=trvrvQ0HZl9+w9Epk8gTZF7yqnetvOjOr7C8d1AEOSY4740uzgdWWsdNI5CqZsTn1c /4JgSuwrNK04YpX32IhyU3uFSiZiKqQ/FYQSk2miXlg/9LKjgkMECDH4H7CYKyMY2tvz 2vQGz6ZJocuhmJSQCyD+NLy9HewMUldn0ZWxVpEhm/guvJXFQWuc2QyjhAQ6cIcJ4iA1 73vHcjAuhCL5CJNkAQUeOOa434C+3J6jUQhtgwjycpA4E+QZpF5ZvXuZ/dXnfPot7lTt kqdtEAOJwew1RSYOBGk8kJV9l8cZ95tubAdsJZlRul2fPrhiolp2q2RDGm2zK1DrrmLn nuGg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2zhdSzCh63cqyYevgFdjNtRFf3fnzFQ0lY4h4VWy3zs=; fh=DwV0dbg1evDUFBb0OZkIvpceGR2hltz0LUkG+Qg8PNA=; b=jKgaVN3YBs1p1/EFraz5zGzn68ooSJ6Iri1BzfryVJ9OZrFizd4lDlrOmXKefbt4k9 5uRE5edNorbKfLICYw2hHDm9H58IjawjW9clr3qdZV56LbCwVWg+ro7xCfGkodDX07u3 saCJ0glocdTXXcafKjXb7gFVcGa3xdxpRfFNMDos7A7NORtBz6jNX4ARtf93zcCOUlNF bZYFDFiRrr0H7ex5Ka+3gPfHG5VeCkJMKRxj74kAaGLzWYKLg92nJY2fw7CzawAZGbPA FEDB2Vls86F+Gi379VXo717TuN7bP61Jl9vQM8Qmgd1GWtiOm55q2wzBVhkQJ3dvFtno YVWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hAa1dTQq; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id ng8-20020a17090b1a8800b0025eeb3cc4b2si9139404pjb.9.2023.09.18.14.33.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 14:33:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hAa1dTQq; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 39CA7816EF4F; Mon, 18 Sep 2023 08:47:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229818AbjIRPrP (ORCPT + 99 others); Mon, 18 Sep 2023 11:47:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229826AbjIRPrM (ORCPT ); Mon, 18 Sep 2023 11:47:12 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7281D10F7; Mon, 18 Sep 2023 08:46:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695051962; x=1726587962; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1z4zU2kddqvhSnJhYzQ+kzmt/kJVDZXOqL2l9VfDNaA=; b=hAa1dTQqLYgVzYD8Rwhgp2v/JxO04glOp4D9FsxFIn/c1i5ze8o1iQQL qKovhXbgSNde7JvZrjo1tLZcFBtKHAv+zG8lvrNEPEr3nADZnCxMWhoVk wrIUVx9tP8mKASbNubyQBpA1Rk05Eg4vD+hXbXu/pXLchOox3jga+NNli 63MtcMQBUOLmgx9likXbr8cjrlSb7BzYCPHTgJjxvpIBtIoMSh5hhtJUJ YoC3BJ9clOKvuMrELzAlDqjQVh/t7LXaPX2u4tV7jMYm3/+tQLD2F/4nl XyVS2IZkqr/+3UpZhbSpks7s1e+AK++BpmJ/Vy3M5asQ7Tcpvu2h8cUvg w==; X-IronPort-AV: E=McAfee;i="6600,9927,10837"; a="446113501" X-IronPort-AV: E=Sophos;i="6.02,156,1688454000"; d="scan'208";a="446113501" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Sep 2023 06:13:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10837"; a="811342626" X-IronPort-AV: E=Sophos;i="6.02,156,1688454000"; d="scan'208";a="811342626" Received: from nprotaso-mobl1.ccr.corp.intel.com (HELO ijarvine-mobl2.ger.corp.intel.com) ([10.252.49.156]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Sep 2023 06:13:01 -0700 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= To: linux-pci@vger.kernel.org, Bjorn Helgaas , Lorenzo Pieralisi , Rob Herring , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Lukas Wunner , "Rafael J . Wysocki" , Heiner Kallweit , Emmanuel Grumbach , linux-kernel@vger.kernel.org, Kalle Valo , Jeff Johnson , ath10k@lists.infradead.org, linux-wireless@vger.kernel.org Cc: ath11k@lists.infradead.org, ath12k@lists.infradead.org, intel-wired-lan@lists.osuosl.org, linux-arm-kernel@lists.infradead.org, linux-bluetooth@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-rdma@vger.kernel.org, netdev@vger.kernel.org, =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Subject: [PATCH v2 09/13] wifi: ath10k: Use pci_disable/enable_link_state() Date: Mon, 18 Sep 2023 16:10:59 +0300 Message-Id: <20230918131103.24119-10-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230918131103.24119-1-ilpo.jarvinen@linux.intel.com> References: <20230918131103.24119-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 18 Sep 2023 08:47:49 -0700 (PDT) ath10k driver adjusts ASPM state itself which leaves ASPM service driver in PCI core unaware of the link state changes the driver implemented. Call pci_disable_link_state() and pci_enable_link_state() instead of adjusting ASPMC field in LNKCTL directly in the driver and let PCI core handle the ASPM state management. Signed-off-by: Ilpo Järvinen --- drivers/net/wireless/ath/ath10k/pci.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index 23f366221939..64f7133ce122 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c @@ -1963,9 +1963,8 @@ static int ath10k_pci_hif_start(struct ath10k *ar) ath10k_pci_irq_enable(ar); ath10k_pci_rx_post(ar); - pcie_capability_clear_and_set_word(ar_pci->pdev, PCI_EXP_LNKCTL, - PCI_EXP_LNKCTL_ASPMC, - ar_pci->link_ctl & PCI_EXP_LNKCTL_ASPMC); + pci_enable_link_state(ar_pci->pdev, ar_pci->link_ctl & + (PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1)); return 0; } @@ -2822,8 +2821,7 @@ static int ath10k_pci_hif_power_up(struct ath10k *ar, pcie_capability_read_word(ar_pci->pdev, PCI_EXP_LNKCTL, &ar_pci->link_ctl); - pcie_capability_clear_word(ar_pci->pdev, PCI_EXP_LNKCTL, - PCI_EXP_LNKCTL_ASPMC); + pci_disable_link_state(ar_pci->pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1); /* * Bring the target up cleanly. -- 2.30.2