From patchwork Thu Mar 30 13:30:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 9654219 X-Patchwork-Delegate: bhelgaas@google.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 6045260113 for ; Thu, 30 Mar 2017 13:32:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53A6527D5E for ; Thu, 30 Mar 2017 13:32:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4872E28433; Thu, 30 Mar 2017 13:32:17 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable 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 D66B927D5E for ; Thu, 30 Mar 2017 13:32:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933894AbdC3Nav (ORCPT ); Thu, 30 Mar 2017 09:30:51 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:49942 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933866AbdC3Nat (ORCPT ); Thu, 30 Mar 2017 09:30:49 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id A7DE560DB4; Thu, 30 Mar 2017 13:30:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1490880647; bh=ZlKhcemafWR+XD1KyplpId4fik8pInxNUvtGWK71lWQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kNfsd8fgkRs4JUM4j3AxAdXunrIbvdw0zmFhuOZ9p/3S4qaxkTZ+zcT2axKvnyR6f 5d+Epi1QQhUu9zSW/QcF1WjK+NmW87K9U0aBHZRXZsPN0IqxPDT7ydKkX/08S/ViKm 4zEaQqAZJVvf4EA/E/HCybJhTYWPeMeTRxLei8jE= Received: from drakthul.qualcomm.com (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: okaya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 06C7960DAA; Thu, 30 Mar 2017 13:30:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1490880647; bh=ZlKhcemafWR+XD1KyplpId4fik8pInxNUvtGWK71lWQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kNfsd8fgkRs4JUM4j3AxAdXunrIbvdw0zmFhuOZ9p/3S4qaxkTZ+zcT2axKvnyR6f 5d+Epi1QQhUu9zSW/QcF1WjK+NmW87K9U0aBHZRXZsPN0IqxPDT7ydKkX/08S/ViKm 4zEaQqAZJVvf4EA/E/HCybJhTYWPeMeTRxLei8jE= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 06C7960DAA Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=okaya@codeaurora.org From: Sinan Kaya To: linux-pci@vger.kernel.org, timur@codeaurora.org Cc: mayurkumar.patel@intel.com, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sinan Kaya , Bjorn Helgaas , Rajat Jain , Shawn Lin , David Daney , Julia Lawall , linux-kernel@vger.kernel.org Subject: [PATCH V7 2/5] PCI/ASPM: split pci_aspm_init() into two Date: Thu, 30 Mar 2017 09:30:33 -0400 Message-Id: <1490880636-30542-3-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1490880636-30542-1-git-send-email-okaya@codeaurora.org> References: <1490880636-30542-1-git-send-email-okaya@codeaurora.org> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Split pci_aspm_init() body into pci_aspm_init_upstream() and pci_aspm_init_downstream() for bridge and endpoint specific code behavior. Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=194895 Signed-off-by: Sinan Kaya --- drivers/pci/pcie/aspm.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c index dc36717..a80d64b 100644 --- a/drivers/pci/pcie/aspm.c +++ b/drivers/pci/pcie/aspm.c @@ -826,6 +826,16 @@ static struct pcie_link_state *alloc_pcie_link_state(struct pci_dev *pdev) return link; } +static int pci_aspm_init_downstream(struct pci_dev *pdev) +{ + return 0; +} + +static int pci_aspm_init_upstream(struct pci_dev *pdev) +{ + return 0; +} + /* * pci_aspm_init: Initiate PCI express link state. * It is called from device_add for every single pci device. @@ -833,7 +843,10 @@ static struct pcie_link_state *alloc_pcie_link_state(struct pci_dev *pdev) */ int pci_aspm_init(struct pci_dev *pdev) { - return 0; + if (!pdev->has_secondary_link) + return pci_aspm_init_downstream(pdev); + + return pci_aspm_init_upstream(pdev); } /*