From patchwork Thu Jun 27 16:32:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Westerberg X-Patchwork-Id: 2794311 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6F0499F3C3 for ; Thu, 27 Jun 2013 16:28:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 193A3203FA for ; Thu, 27 Jun 2013 16:28:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 22DC9202EB for ; Thu, 27 Jun 2013 16:28:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752241Ab3F0Q2r (ORCPT ); Thu, 27 Jun 2013 12:28:47 -0400 Received: from mga11.intel.com ([192.55.52.93]:30198 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752152Ab3F0Q2q (ORCPT ); Thu, 27 Jun 2013 12:28:46 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 27 Jun 2013 09:29:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.87,953,1363158000"; d="scan'208";a="361529021" Received: from lahna.fi.intel.com ([10.237.72.166]) by fmsmga002.fm.intel.com with ESMTP; 27 Jun 2013 09:28:42 -0700 Received: from westeri by lahna.fi.intel.com with local (Exim 4.77) (envelope-from ) id 1UsF7n-0002Kd-1A; Thu, 27 Jun 2013 19:32:47 +0300 Date: Thu, 27 Jun 2013 19:32:46 +0300 From: Mika Westerberg To: Bjorn Helgaas Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" , Jesse Barnes , Yinghai Lu , "Ronciak, John" , "Penner, Miles J" , Bruce Allan , "Kirill A. Shutemov" , Heikki Krogerus , "linux-kernel@vger.kernel.org" , "linux-pci@vger.kernel.org" , "x86@kernel.org" Subject: Re: [PATCH 2/6] PCI: acpiphp: enable_device(): rescan even if no new devices on slot Message-ID: <20130627163246.GZ9294@intel.com> References: <1372177330-28013-1-git-send-email-mika.westerberg@linux.intel.com> <1372177330-28013-3-git-send-email-mika.westerberg@linux.intel.com> <20130627130229.GT9294@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20130627130229.GT9294@intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 On Thu, Jun 27, 2013 at 04:02:29PM +0300, Mika Westerberg wrote: > On Wed, Jun 26, 2013 at 05:37:58PM -0600, Bjorn Helgaas wrote: > > > @@ -707,8 +702,11 @@ static int __ref enable_device(struct acpiphp_slot *slot) > > > dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) { > > > max = pci_scan_bridge(bus, dev, max, pass); > > > if (pass && dev->subordinate) { > > > - check_hotplug_bridge(slot, dev); > > > - pcibios_resource_survey_bus(dev->subordinate); > > > + if (!dev->subordinate->is_added) { > > > + check_hotplug_bridge(slot, dev); > > > + pcibios_resource_survey_bus( > > > + dev->subordinate); > > > > It's a shame that pcibios_resource_survey_bus() can't be called twice. > > It would be nice if it were smart enough to notice on the second call > > that "oh, resources have already been assigned, so there's nothing > > more to be done." Did you look to see whether that's feasible? > > I didn't but now that you mentioned I went and checked. I'm pretty sure we > can handle it there in the next revision and drop this change. With following patch that fixes pcibios_resource_survey_bus() Thunderbolt seems to be working just fine (and the quirk is gone). If it looks okay, I'll include it into the next iteration of the patches. --- 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/arch/x86/pci/i386.c b/arch/x86/pci/i386.c index 94919e3..db6b1ab 100644 --- a/arch/x86/pci/i386.c +++ b/arch/x86/pci/i386.c @@ -210,6 +210,8 @@ static void pcibios_allocate_bridge_resources(struct pci_dev *dev) r = &dev->resource[idx]; if (!r->flags) continue; + if (r->parent) /* Already allocated */ + continue; if (!r->start || pci_claim_resource(dev, idx) < 0) { /* * Something is wrong with the region. @@ -318,6 +320,8 @@ static void pcibios_allocate_dev_rom_resource(struct pci_dev *dev) r = &dev->resource[PCI_ROM_RESOURCE]; if (!r->flags || !r->start) return; + if (r->parent) /* Already allocated */ + return; if (pci_claim_resource(dev, PCI_ROM_RESOURCE) < 0) { r->end -= r->start;