From patchwork Tue Oct 13 06:21:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinghai Lu X-Patchwork-Id: 529602 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 6104C14016A for ; Tue, 13 Oct 2015 17:21:46 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=mTtcw3In; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751745AbbJMGVo (ORCPT ); Tue, 13 Oct 2015 02:21:44 -0400 Received: from mail-vk0-f45.google.com ([209.85.213.45]:32826 "EHLO mail-vk0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751665AbbJMGVo (ORCPT ); Tue, 13 Oct 2015 02:21:44 -0400 Received: by vkaw128 with SMTP id w128so4447357vka.0; Mon, 12 Oct 2015 23:21:43 -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=osY/eMCGALO3B/srcfvar4XQchcbP+PF+V/LikxMH3k=; b=mTtcw3In//4+j+Ug7+rkD1MWOoZVWYL6cXpltlOtbJ/+o9qkaqQcueiVkN/zYB8AUs dF/FoKIlutA3iT6ac7tgLjIzwtJudW6a/z83Vw/JrEvm2KJVMKosgSKi5ZM+3xuJZyog v+0l+GfFEd8RbTVZPJTsYLvXVX9kEUcC1WXiUCPpWYy4DRkTxkKMyt7iX1iob0u/edHW 92+xZn/P/LDkgLhhUos56IMEn/q8qc44XMxmxIf1QmahcOeFZDZbU41AX5BX2wrsqy+5 pdoE2+0IVx1ts/UzEMRsxM8/TQ58ikr/U5XRIimX70/zRJcso9an9gTiKGT0I67uM0cT yLrA== MIME-Version: 1.0 X-Received: by 10.31.0.132 with SMTP id 126mr12749541vka.152.1444717303257; Mon, 12 Oct 2015 23:21:43 -0700 (PDT) Received: by 10.103.45.72 with HTTP; Mon, 12 Oct 2015 23:21:43 -0700 (PDT) In-Reply-To: References: Date: Mon, 12 Oct 2015 23:21:43 -0700 X-Google-Sender-Auth: yy4fQswpmBCPlubJuGf3HbnbLHo Message-ID: Subject: Re: 4.3-rc3 BAR allocation problems on multiple machines From: Yinghai Lu To: Meelis Roos Cc: Linux Kernel list , "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, Oct 12, 2015 at 10:43 PM, Yinghai Lu wrote: > On Mon, Oct 12, 2015 at 10:06 PM, Meelis Roos wrote: >>> >> > sparc64 machines: >> >> Updated on V210 - the others were more recent. Now I get more BAR >> warning there too: >> >> http://kodu.ut.ee/~mroos/dm/dm.v210+patches >> > > interesting, mem and mem64 is overlapping. > > [ 38.824625] /pci@1f,700000: TOMATILLO PCI Bus Module ver[4:0] > [ 38.824654] /pci@1f,700000: PCI IO [io > 0x7f601000000-0x7f601ffffff] offset 7f601000000 > [ 38.824680] /pci@1f,700000: PCI MEM [mem > 0x7f700000000-0x7f7ffffffff] offset 7f700000000 > [ 38.824704] /pci@1f,700000: PCI MEM64 [mem > 0x7f700000000-0x7f7ffffffff] offset 7f700000000 > [ 38.826310] PCI: Scanning PBM /pci@1f,700000 > [ 38.826479] schizo f0069c00: PCI host bridge to bus 0000:00 > [ 38.826506] pci_bus 0000:00: root bus resource [io > 0x7f601000000-0x7f601ffffff] (bus address [0x0000-0xffffff]) > [ 38.826536] pci_bus 0000:00: root bus resource [mem > 0x7f700000000-0x7f7ffffffff] (bus address [0x00000000-0xffffffff]) > [ 38.826565] pci_bus 0000:00: root bus resource [mem > 0x7f700000000-0x7f7ffffffff] (bus address [0x00000000-0xffffffff]) > For overlapping, please check attached patch that should fix the problem. Thanks Yinghai Subject: [PATCH] sparc/PCI: check overlapping mmio64 with mmio for root bus Found one system have overlapping between mmio64 and mmio: /pci@1d,700000: TOMATILLO PCI Bus Module ver[4:0] /pci@1d,700000: PCI IO [io 0x7c601000000-0x7c601ffffff] offset 7c601000000 /pci@1d,700000: PCI MEM [mem 0x7c700000000-0x7c7ffffffff] offset 7c700000000 /pci@1d,700000: PCI MEM64 [mem 0x7c700000000-0x7c7ffffffff] offset 7c700000000 PCI: Scanning PBM /pci@1d,700000 schizo f00859d4: PCI host bridge to bus 0003:00 pci_bus 0003:00: root bus resource [io 0x7c601000000-0x7c601ffffff] (bus address [0x0000-0xffffff]) pci_bus 0003:00: root bus resource [mem 0x7c700000000-0x7c7ffffffff] (bus address [0x00000000-0xffffffff]) pci_bus 0003:00: root bus resource [mem 0x7c700000000-0x7c7ffffffff] (bus address [0x00000000-0xffffffff]) so add checking for overlapping, and skip that mem64. Signed-off-by: Yinghai Lu --- arch/sparc/kernel/pci_common.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) Index: linux-2.6/arch/sparc/kernel/pci_common.c =================================================================== --- linux-2.6.orig/arch/sparc/kernel/pci_common.c +++ linux-2.6/arch/sparc/kernel/pci_common.c @@ -483,12 +483,17 @@ void pci_determine_mem_io_space(struct p if (mem64_offset != pbm->mem_offset) panic("mem offset %llx != mem64 offset %llx\n", pbm->mem_offset, mem64_offset); + if (pbm->mem64_space.start <= pbm->mem_space.end) + pbm->mem64_space.start = pbm->mem_space.end + 1; + if (pbm->mem64_space.start > pbm->mem64_space.end) + pbm->mem64_space.flags = 0; } else pbm->mem_offset = mem64_offset; + } + if (pbm->mem64_space.flags) printk("%s: PCI MEM64 %pR offset %llx\n", pbm->name, &pbm->mem64_space, pbm->mem_offset); - } pbm->io_space.name = pbm->mem_space.name = pbm->name; pbm->mem64_space.name = pbm->name;