From patchwork Fri Jan 18 18:23:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Lawrence X-Patchwork-Id: 2004031 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 01FF03FED4 for ; Fri, 18 Jan 2013 19:08:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752567Ab3ARTIM (ORCPT ); Fri, 18 Jan 2013 14:08:12 -0500 Received: from mailhub5.stratus.com ([134.111.1.18]:58603 "EHLO mailhub5.stratus.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751915Ab3ARTIL (ORCPT ); Fri, 18 Jan 2013 14:08:11 -0500 X-Greylist: delayed 2535 seconds by postgrey-1.27 at vger.kernel.org; Fri, 18 Jan 2013 14:08:11 EST Received: from EXHQ.corp.stratus.com (exhq.corp.stratus.com [134.111.201.100]) by mailhub5.stratus.com (8.12.11/8.12.11) with ESMTP id r0IIQM4f030523; Fri, 18 Jan 2013 13:26:22 -0500 Received: from jlaw-desktop.mno.stratus.com ([134.111.199.152]) by EXHQ.corp.stratus.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 18 Jan 2013 13:27:14 -0500 Date: Fri, 18 Jan 2013 13:23:55 -0500 (EST) From: Joe Lawrence X-X-Sender: jlaw@jlaw-desktop.mno.stratus.com To: Joe Lawrence cc: linux-pci@vger.kernel.org, Matthew Garrett , Myron Stowe , David Bulkow Subject: [PATCH 1/2] PCI: ASPM exit link state code could skip devices In-Reply-To: Message-ID: References: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 X-OriginalArrivalTime: 18 Jan 2013 18:27:14.0771 (UTC) FILETIME=[70675230:01CDF5A9] Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org From 3a51bbad5555ba6c6e144aa5176c8112eb449325 Mon Sep 17 00:00:00 2001 From: Joe Lawrence Date: Tue, 15 Jan 2013 14:51:57 -0500 Subject: [PATCH 1/2] PCI: ASPM exit link state code could skip devices On PCI bus hotplug removal, pcie_aspm_exit_link_state could potentially skip parent devices that have link_state allocated. Instead of exiting early if a given device is not PCIe, check that the device's parent is PCIe. This enables pcie_aspm_exit_link_state to properly clean up parent link_state when the last function in a slot might not be PCIe. Reviewed-by: David Bulkow Signed-off-by: Joe Lawrence --- drivers/pci/pcie/aspm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c index b52630b..6122447 100644 --- a/drivers/pci/pcie/aspm.c +++ b/drivers/pci/pcie/aspm.c @@ -634,7 +634,7 @@ void pcie_aspm_exit_link_state(struct pci_dev *pdev) struct pci_dev *parent = pdev->bus->self; struct pcie_link_state *link, *root, *parent_link; - if (!pci_is_pcie(pdev) || !parent || !parent->link_state) + if (!parent || !pci_is_pcie(parent) || !parent->link_state) return; if ((pci_pcie_type(parent) != PCI_EXP_TYPE_ROOT_PORT) && (pci_pcie_type(parent) != PCI_EXP_TYPE_DOWNSTREAM))