From patchwork Wed Apr 7 07:29:20 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hidetoshi Seto X-Patchwork-Id: 90948 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o377TW8s013302 for ; Wed, 7 Apr 2010 07:29:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932532Ab0DGH3b (ORCPT ); Wed, 7 Apr 2010 03:29:31 -0400 Received: from fgwmail6.fujitsu.co.jp ([192.51.44.36]:36976 "EHLO fgwmail6.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932531Ab0DGH3b (ORCPT ); Wed, 7 Apr 2010 03:29:31 -0400 Received: from m5.gw.fujitsu.co.jp ([10.0.50.75]) by fgwmail6.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id o377TT3p005651 for (envelope-from seto.hidetoshi@jp.fujitsu.com); Wed, 7 Apr 2010 16:29:30 +0900 Received: from smail (m5 [127.0.0.1]) by outgoing.m5.gw.fujitsu.co.jp (Postfix) with ESMTP id 9E98845DE51 for ; Wed, 7 Apr 2010 16:29:29 +0900 (JST) Received: from s5.gw.fujitsu.co.jp (s5.gw.fujitsu.co.jp [10.0.50.95]) by m5.gw.fujitsu.co.jp (Postfix) with ESMTP id 718EE45DE4F for ; Wed, 7 Apr 2010 16:29:29 +0900 (JST) Received: from s5.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s5.gw.fujitsu.co.jp (Postfix) with ESMTP id 5D9CE1DB8040 for ; Wed, 7 Apr 2010 16:29:29 +0900 (JST) Received: from ml14.s.css.fujitsu.com (ml14.s.css.fujitsu.com [10.249.87.104]) by s5.gw.fujitsu.co.jp (Postfix) with ESMTP id 0458D1DB803C for ; Wed, 7 Apr 2010 16:29:26 +0900 (JST) Received: from ml14.css.fujitsu.com (ml14 [127.0.0.1]) by ml14.s.css.fujitsu.com (Postfix) with ESMTP id CD6509F6733; Wed, 7 Apr 2010 16:29:25 +0900 (JST) Received: from [127.0.0.1] (unknown [10.124.100.141]) by ml14.s.css.fujitsu.com (Postfix) with ESMTP id 783EE9F6745; Wed, 7 Apr 2010 16:29:25 +0900 (JST) X-SecurityPolicyCheck-FJ: OK by FujitsuOutboundMailChecker v1.3.1 Received: from FMVDA2A041[10.124.100.141] by FMVDA2A041 (FujitsuOutboundMailChecker v1.3.1/9992[10.124.100.141]); Wed, 07 Apr 2010 16:29:24 +0900 (JST) Message-ID: <4BBC3450.3050200@jp.fujitsu.com> Date: Wed, 07 Apr 2010 16:29:20 +0900 From: Hidetoshi Seto User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; ja; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: linux-pci@vger.kernel.org CC: Jesse Barnes Subject: [PATCH 12/22] aerdrv: remove is_downstream References: <4BBC30C2.7010300@jp.fujitsu.com> In-Reply-To: <4BBC30C2.7010300@jp.fujitsu.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 07 Apr 2010 07:29:32 +0000 (UTC) diff --git a/drivers/pci/pcie/aer/aerdrv_core.c b/drivers/pci/pcie/aer/aerdrv_core.c index c55ae58..15cf5a6 100644 --- a/drivers/pci/pcie/aer/aerdrv_core.c +++ b/drivers/pci/pcie/aer/aerdrv_core.c @@ -386,30 +386,20 @@ static pci_ers_result_t broadcast_error_message(struct pci_dev *dev, struct find_aer_service_data { struct pcie_port_service_driver *aer_driver; - int is_downstream; }; static int find_aer_service_iter(struct device *device, void *data) { - struct device_driver *driver; struct pcie_port_service_driver *service_driver; struct find_aer_service_data *result; result = (struct find_aer_service_data *) data; - if (device->bus == &pcie_port_bus_type) { - struct pcie_device *pcie = to_pcie_device(device); - - if (pcie->port->pcie_type == PCI_EXP_TYPE_DOWNSTREAM) - result->is_downstream = 1; - - driver = device->driver; - if (driver) { - service_driver = to_service_driver(driver); - if (service_driver->service == PCIE_PORT_SERVICE_AER) { - result->aer_driver = service_driver; - return 1; - } + if (device->bus == &pcie_port_bus_type && device->driver) { + service_driver = to_service_driver(device->driver); + if (service_driver->service == PCIE_PORT_SERVICE_AER) { + result->aer_driver = service_driver; + return 1; } } @@ -435,7 +425,6 @@ static pci_ers_result_t reset_link(struct pcie_device *aerdev, else udev = dev->bus->self; - data.is_downstream = 0; data.aer_driver = NULL; find_aer_service(udev, &data); @@ -444,22 +433,24 @@ static pci_ers_result_t reset_link(struct pcie_device *aerdev, * If it hasn't the aer driver, use the root port's */ if (!data.aer_driver || !data.aer_driver->reset_link) { - if (data.is_downstream && + if (udev->pcie_type == PCI_EXP_TYPE_DOWNSTREAM && aerdev->device.driver && to_service_driver(aerdev->device.driver)->reset_link) { data.aer_driver = to_service_driver(aerdev->device.driver); } else { - dev_printk(KERN_DEBUG, &dev->dev, "no link-reset " - "support\n"); + dev_printk(KERN_DEBUG, &dev->dev, + "no link-reset support at upstream device %s\n", + pci_name(udev)); return PCI_ERS_RESULT_DISCONNECT; } } status = data.aer_driver->reset_link(udev); if (status != PCI_ERS_RESULT_RECOVERED) { - dev_printk(KERN_DEBUG, &dev->dev, "link reset at upstream " - "device %s failed\n", pci_name(udev)); + dev_printk(KERN_DEBUG, &dev->dev, + "link reset at upstream device %s failed\n", + pci_name(udev)); return PCI_ERS_RESULT_DISCONNECT; }