From patchwork Mon Sep 14 23:58:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinghai Lu X-Patchwork-Id: 517638 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id D376C140082 for ; Tue, 15 Sep 2015 09:58:23 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=gfVd8UMw; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752228AbbINX6W (ORCPT ); Mon, 14 Sep 2015 19:58:22 -0400 Received: from mail-vk0-f53.google.com ([209.85.213.53]:33561 "EHLO mail-vk0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751595AbbINX6V (ORCPT ); Mon, 14 Sep 2015 19:58:21 -0400 Received: by vkgd64 with SMTP id d64so69413413vkg.0 for ; Mon, 14 Sep 2015 16:58:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=5AQP7WdK58Q3jNiEiM9znaxa8NXaFcELJTow9wHyMes=; b=gfVd8UMw8GzEk1DRSFSLEtoELlwW/rT+q9X6cyNvAqfFCSrXx0e3UMosewo8k59luH /8o1bOhpSIT4rUD8DDKuC2mzQnSbhoJRUq+meaqCEuAHZPR4kGbEHiE1/qQKo8JmJO0v gEyFdeatUewlqtcKiahIpkySSvKssU9/vhgeEmh0Oagvj+6hPaU3Lc+pUprAiPW0wpMq cP+WRqfdtyWlBps0HfJ+/cWmYc1HNGc0Q/M7vv4jvE9kka605KsiE5Ojmq0Pu2IWcwSG LygC/tX6uqhojcC0mgueb2Jh36jTUPt4C0am2oqRSuakKseDJg0g209+m6/dnmio45xC ZfYA== MIME-Version: 1.0 X-Received: by 10.31.185.198 with SMTP id j189mr16672051vkf.34.1442275100347; Mon, 14 Sep 2015 16:58:20 -0700 (PDT) Received: by 10.103.37.67 with HTTP; Mon, 14 Sep 2015 16:58:20 -0700 (PDT) In-Reply-To: References: <20150902203250.GB829@google.com> <20150903100115.GA15308@red-moon> <20150903162140.GG829@google.com> <20150904141903.GA22997@red-moon> <20150904164412.GD22997@red-moon> <20150907091230.GB29293@red-moon> <20150914100929.GB18886@red-moon> <20150914162834.GA11199@red-moon> Date: Mon, 14 Sep 2015 16:58:20 -0700 X-Google-Sender-Auth: r3545lTLy2Yk_By6GqF4Uodpx1I Message-ID: Subject: Re: trouble with PCI: Call pci_read_bridge_bases() from core instead of arch code From: Yinghai Lu To: Lorenzo Pieralisi Cc: Bjorn Helgaas , "oe5hpm@gmail.com" , Ralf Baechle , "James E.J. Bottomley" , Michael Ellerman , Richard Henderson , Benjamin Herrenschmidt , David Howells , Russell King , Tony Luck , "David S. Miller" , Ingo Molnar , Guenter Roeck , Michal Simek , Chris Zankel , "linux-pci@vger.kernel.org" Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Mon, Sep 14, 2015 at 10:36 AM, Yinghai Lu wrote: > On Mon, Sep 14, 2015 at 9:28 AM, Lorenzo Pieralisi > wrote: >> On Mon, Sep 14, 2015 at 05:05:50PM +0100, Yinghai Lu wrote: >>> We could just revert >>> dff22d2054b5 (" PCI: Call pci_read_bridge_bases() from core instead of >>> arch code") >>> instead. >> > if arch code called pci_read_bridge_bases() via pcibios_fixup_bus(), > then it need to have > to call pcibios_allocate_bus_resources() later. > > but now arm (mips ?) does not have calling pcibios_allocate_bus_resources(). Found other problem that is caused by dff22d2054b5 (" PCI: Call pci_read_bridge_bases() from core instead of arch code") If that commit does not get reverted, will need to have attached patch Subject: [PATCH] PCI: Skip reading bridge bases with existing ones on rescan Noticed there is noisy print out pci bridge bases read out for existing devices that is caused by commit dff22d2054b5 ("PCI: Call pci_read_bridge_bases() from core instead of arch code") pci_bus 0000:06: scanning bus pcieport 0000:06:00.0: scanning [bus 07-09] behind bridge, pass 0 pcieport 0000:06:00.0: PCI bridge to [bus 07-09] pcieport 0000:06:00.0: bridge window [io 0x1000-0x2fff] pcieport 0000:06:00.0: bridge window [mem 0xfda00000-0xfddfffff] pcieport 0000:06:00.0: bridge window [mem 0xfc000000-0xfc3fffff 64bit pref] pci_bus 0000:07: scanning bus pcieport 0000:07:00.0: scanning [bus 08-08] behind bridge, pass 0 pcieport 0000:07:00.0: PCI bridge to [bus 08] pcieport 0000:07:00.0: bridge window [io 0x2000-0x2fff] pcieport 0000:07:00.0: bridge window [mem 0xfdc00000-0xfddfffff] pcieport 0000:07:00.0: bridge window [mem 0xfc200000-0xfc3fffff 64bit pref] pci_bus 0000:08: scanning bus pcieport 0000:07:00.1: scanning [bus 09-09] behind bridge, pass 0 pcieport 0000:07:00.1: PCI bridge to [bus 09] pcieport 0000:07:00.1: bridge window [io 0x1000-0x1fff] pcieport 0000:07:00.1: bridge window [mem 0xfda00000-0xfdbfffff] pcieport 0000:07:00.1: bridge window [mem 0xfc000000-0xfc1fffff 64bit pref] Add is_added checking to avoid those wrong reading. Fixes: dff22d2054b5 ("PCI: Call pci_read_bridge_bases() from core instead of arch code") Signed-off-by: Yinghai Lu --- drivers/pci/probe.c | 3 +++ 1 file changed, 3 insertions(+) Subject: [PATCH] PCI: Skip reading bridge bases with existing ones on rescan Noticed there is noisy print out pci bridge bases read out for existing devices that is caused by commit dff22d2054b5 ("PCI: Call pci_read_bridge_bases() from core instead of arch code") pci_bus 0000:06: scanning bus pcieport 0000:06:00.0: scanning [bus 07-09] behind bridge, pass 0 pcieport 0000:06:00.0: PCI bridge to [bus 07-09] pcieport 0000:06:00.0: bridge window [io 0x1000-0x2fff] pcieport 0000:06:00.0: bridge window [mem 0xfda00000-0xfddfffff] pcieport 0000:06:00.0: bridge window [mem 0xfc000000-0xfc3fffff 64bit pref] pci_bus 0000:07: scanning bus pcieport 0000:07:00.0: scanning [bus 08-08] behind bridge, pass 0 pcieport 0000:07:00.0: PCI bridge to [bus 08] pcieport 0000:07:00.0: bridge window [io 0x2000-0x2fff] pcieport 0000:07:00.0: bridge window [mem 0xfdc00000-0xfddfffff] pcieport 0000:07:00.0: bridge window [mem 0xfc200000-0xfc3fffff 64bit pref] pci_bus 0000:08: scanning bus pcieport 0000:07:00.1: scanning [bus 09-09] behind bridge, pass 0 pcieport 0000:07:00.1: PCI bridge to [bus 09] pcieport 0000:07:00.1: bridge window [io 0x1000-0x1fff] pcieport 0000:07:00.1: bridge window [mem 0xfda00000-0xfdbfffff] pcieport 0000:07:00.1: bridge window [mem 0xfc000000-0xfc1fffff 64bit pref] Add is_added checking to avoid those wrong reading. Fixes: dff22d2054b5 ("PCI: Call pci_read_bridge_bases() from core instead of arch code") Signed-off-by: Yinghai Lu --- drivers/pci/probe.c | 3 +++ 1 file changed, 3 insertions(+) Index: linux-2.6/drivers/pci/probe.c =================================================================== --- linux-2.6.orig/drivers/pci/probe.c +++ linux-2.6/drivers/pci/probe.c @@ -455,6 +455,9 @@ void pci_read_bridge_bases(struct pci_bu struct resource *res; int i; + if (child->is_added) + return; + if (pci_is_root_bus(child)) /* It's a host bus, nothing to read */ return;