From patchwork Wed Jun 10 18:48:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 6584271 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6CEAE9F326 for ; Wed, 10 Jun 2015 18:48:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AC02A204AD for ; Wed, 10 Jun 2015 18:48:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7715A202E6 for ; Wed, 10 Jun 2015 18:48:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751749AbbFJSsP (ORCPT ); Wed, 10 Jun 2015 14:48:15 -0400 Received: from mail-ie0-f170.google.com ([209.85.223.170]:35232 "EHLO mail-ie0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751305AbbFJSsO (ORCPT ); Wed, 10 Jun 2015 14:48:14 -0400 Received: by iesa3 with SMTP id a3so40575737ies.2 for ; Wed, 10 Jun 2015 11:48:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:to:from:cc:date:message-id:user-agent:mime-version :content-type:content-transfer-encoding; bh=spSwY9reoJWzZEo1yFapEQjz3hYmiiGT5GMQTpIbIwo=; b=ZWTtYRnlZ694hpGqqD5vPh8ArIb57eWmSk3WmFExxyKsoXZ8BZzKiQ8/0kD8nsACBS WuPLyW2TJ/rDsdRafwMF6rupwZTdive2Mxrj8Wf3Pifmiw9bDj28sbLYGE+jbc2yaUFz QUj5wTLxPHULPXlKcMH95p5PJyCtbneJ6m5inHMM8qseZd+E6UqLsta7ssXabaF6FEK1 riWt3Xbap7cJf19DetXtNFV7Z0+SU6JNe2H0i8q46wxZ+wExIKcSVH4rEo9pfYgxIYDQ qDM6uZQmlau51ugIHCP3U5FOOQna9uUrDJJJ/DDkC91j7WCASLIkrk1vdBau1cehwcRx kQ9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:from:cc:date:message-id:user-agent :mime-version:content-type:content-transfer-encoding; bh=spSwY9reoJWzZEo1yFapEQjz3hYmiiGT5GMQTpIbIwo=; b=CY0g/2Pew+T+OEAuc4YiK0Gj9BpkQhelo9vy0pxKsqz/aCsfbnDHHlLwCdGCYlBAq7 nAwrJ4ipBRtRw/U0ndLUUfUbdsSwTUuU7q2pnhJ0au478dTxHM72HpSd5iI2OIH4IOfs KEcAj5+CmPxwrTKOf450vzeTFlGjTd0Ro6eomCOZLAxFW0nr7UWgh+wWtB6RVWdnLqls O9NF8OCW03LdoTumsN+p0pQYpm7+zc6rvRcwh6ott760xAvy6cKIaqZRviL3p9ei0/uE gRYk08eTiDmBWD/yNHHBdd1A8cAzsdJgB/tns/M4FpAvuivggPz7liDdFdHUQyazI4pq xZgw== X-Gm-Message-State: ALoCoQmvhh/Cev3v19QXNpYoP2PDcFsTQ0DG25eVpi9gWaUkhDaDp1bI3t/nDoIq03Lwa2FA9iDy X-Received: by 10.43.171.202 with SMTP id nv10mr6526453icc.30.1433962094106; Wed, 10 Jun 2015 11:48:14 -0700 (PDT) Received: from localhost ([69.71.1.1]) by mx.google.com with ESMTPSA id d77sm6531978ioj.6.2015.06.10.11.48.12 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 10 Jun 2015 11:48:12 -0700 (PDT) Subject: [PATCH] PCI/ASPM: Simplify Clock Power Management setting To: linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: Joe Lawrence , Matthew Garrett , Myron Stowe , Chris J Arges Date: Wed, 10 Jun 2015 13:48:11 -0500 Message-ID: <20150610184811.9459.82796.stgit@bhelgaas-glaptop2.roam.corp.google.com> User-Agent: StGit/0.16 MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Update the Link Control Enable Clock Power Management bit the same way we update the ASPM Control bits, with a single call of pcie_capability_clear_and_set_word(). No functional change; this just makes both paths use the same style. Signed-off-by: Bjorn Helgaas --- drivers/pci/pcie/aspm.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c index 7d4fcdc..29ab40c 100644 --- a/drivers/pci/pcie/aspm.c +++ b/drivers/pci/pcie/aspm.c @@ -127,15 +127,12 @@ static void pcie_set_clkpm_nocheck(struct pcie_link_state *link, int enable) { struct pci_dev *child; struct pci_bus *linkbus = link->pdev->subordinate; + u32 val = enable ? PCI_EXP_LNKCTL_CLKREQ_EN : 0; - list_for_each_entry(child, &linkbus->devices, bus_list) { - if (enable) - pcie_capability_set_word(child, PCI_EXP_LNKCTL, - PCI_EXP_LNKCTL_CLKREQ_EN); - else - pcie_capability_clear_word(child, PCI_EXP_LNKCTL, - PCI_EXP_LNKCTL_CLKREQ_EN); - } + list_for_each_entry(child, &linkbus->devices, bus_list) + pcie_capability_clear_and_set_word(child, PCI_EXP_LNKCTL, + PCI_EXP_LNKCTL_CLKREQ_EN, + val); link->clkpm_enabled = !!enable; }