From patchwork Wed Jun 29 20:06:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darren Stevens X-Patchwork-Id: 642224 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rfwVx5M3dz9sf9 for ; Thu, 30 Jun 2016 07:17:45 +1000 (AEST) Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3rfwVx4bKlzDr0Y for ; Thu, 30 Jun 2016 07:17:45 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.13]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3rfwTm3C75zDqvB for ; Thu, 30 Jun 2016 07:16:44 +1000 (AEST) Received: from mintppc.lan ([86.169.226.157]) by mrelayeu.kundenserver.de (mreue101) with ESMTPA (Nemesis) id 0LdEht-1bj8vR1qzJ-00iQ5Y; Wed, 29 Jun 2016 23:06:56 +0200 From: Darren Stevens To: linuxppc-dev@lists.ozlabs.org Date: Wed, 29 Jun 2016 21:06:28 +0100 (BST) Message-ID: <4867f9385a2.1e1ca6c1@auth.smtp.1and1.co.uk> User-Agent: YAM/2.9p1 (AmigaOS4; PPC; rv:20140418r7798) Subject: [PATCH v2 RFC] pasemi: Fix boot failure on 4.7-rc1 MIME-Version: 1.0 Content-type: multipart/mixed; boundary="--=_BOUNDARY.6c7dc3c071961d4d.74" X-Provags-ID: V03:K0:wczhpp44lmI7Vp3NvaggGfst1mrVcJ/nXJTzdM+Zt5MJ9LZiBRm A+2o8q9p09C8PJ+urcybh4x4fAFLSFAs1yBg9QWq242wn9itlPVu9gTbvZSbjcuD5K9JilM FC+4V3ip0QrKhsnOJSVxxuNR1IhM5E91nC2M1qvZwhdFqCF5MUiR7japKuhC714uM1M0jyT CPPt0vPNKuDwZVFwoaIjg== X-UI-Out-Filterresults: notjunk:1; V01:K0:b3pPhRWO/3s=:JWD1NF1vYnVDsZJieQOeLh TfSGN/ipxgWYCDA+bThiaiRX5T5VYkSfXuktFEAGQH9V8X4jYamsnjJ1sVk3RXmO3o5GkeKET zI9Q5+JE/K5B1KcYuLEx8rkDxIBKjoAlM1Usty1DxEEH4jJv0qtmE8BveGHtQOfxMX2M5MBXL U7Y1ult2kLaUpQJ2jJyUDp740VVp08Gem5g6LfWVa3JWQVRiSHAc4VUNwF7v+jzfyZ3dZtavp +Sidv5H2qXw6hBqIR+VxOAF0d1tszEBYPTh2VL3+BVh/NDn2Ez9qvVuz8G+Gyt0XXGMNPfnPd Uu+vLb0iOIoaz8ncJN4XXrBiFtPp9l7cUjkdUWpK7gPJgdALDAFp3BvdfwuGqq0Dy1N6szijR 7rkYCGDpKemErGsffE7wyFJeEVbhjW9Da7LSb4240SeG5dVCeUEjq6mObcxGF1SKzX6NDCEDs 3DJsWoT20BjwgZ2RgWN6MeOBW64PfvkyjemB+xKoU2eC/WaqQOprCoKSRCCFOVbzXT099m+fB dgz5uJFBhKQUxa5hvukCKMBqlDhpNXz3iudqRZkg46BGaVocr0e71Trlq/rYJf+W+rWGxN3hc OJkpPx6d8387gfQF5sLkc8ap/0B7WYHHfnXDF1hx+M1fhZL8xTQnpBIcr1qyVTfP871cc+2Ut +uRm9PtljEwYWQ3WPVkkm9c1/2/hp3aWGtKECPfNEcfCw5JjMgq1vbV3etvfGO6OSSt8= X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pat Wall , aperez@alexperez.com, matthew@a-eon.com, "Aneesh Kumar K.V" , "R.T.Dickinson" , Christian Zigotzky Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Commit:d6a9996e84ac4beb7713e9485f4563e100a9b03e (powerpc/mm: vmalloc abstraction in preparation for radix) turned kernel memory and IO addresses from #defined constants to variables initialised at runtime. On PA6T systems the setup_arch machine call initialises the onboard PCI-e root-ports, and uses pci_io_base to do this, which is now before its value has been set resulting in a panic right after 'booting linux via __start()' Move the pci_io_base initialisation to the same place as vmalloc ranges are set (hash__early_init_mmu()/radix__early_init_mmu()) Reported-by: Christian Zigotzky Signed-off-by: Darren Stevens Reviewed-by: Aneesh Kumar K.V --- Tested on my AmigaOneX1000, I don't have access to a refence board system, and our developer with one is on honeymoon. I am hoping to follow this patch with others to reduce the size of the nemo patch we apply, eventually I'd like to see the patch gone, but that is a very big job. Kind regards Darren diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h b/arch/powerpc/include/asm/book3s/64/pgtable.h index 88a5eca..ab84c89 100644 --- a/arch/powerpc/include/asm/book3s/64/pgtable.h +++ b/arch/powerpc/include/asm/book3s/64/pgtable.h @@ -230,6 +230,7 @@ extern unsigned long __kernel_virt_size; #define KERN_VIRT_SIZE __kernel_virt_size extern struct page *vmemmap; extern unsigned long ioremap_bot; +extern unsigned long pci_io_base; #endif /* __ASSEMBLY__ */ #include diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c index 3759df5..a5ae49a 100644 --- a/arch/powerpc/kernel/pci_64.c +++ b/arch/powerpc/kernel/pci_64.c @@ -47,7 +47,6 @@ static int __init pcibios_init(void) printk(KERN_INFO "PCI: Probing PCI hardware\n"); - pci_io_base = ISA_IO_BASE; /* For now, override phys_mem_access_prot. If we need it,g * later, we may move that initialization to each ppc_md */ diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index 5b22ba0..b5b5fe6 100644 --- a/arch/powerpc/mm/hash_utils_64.c +++ b/arch/powerpc/mm/hash_utils_64.c @@ -922,6 +922,8 @@ void __init hash__early_init_mmu(void) vmemmap = (struct page *)H_VMEMMAP_BASE; ioremap_bot = IOREMAP_BASE; + pci_io_base = ISA_IO_BASE; + /* Initialize the MMU Hash table and create the linear mapping * of memory. Has to be done before SLB initialization as this is * currently where the page size encoding is obtained. diff --git a/arch/powerpc/mm/pgtable-radix.c b/arch/powerpc/mm/pgtable-radix.c index e58707d..095fbfa 100644 --- a/arch/powerpc/mm/pgtable-radix.c +++ b/arch/powerpc/mm/pgtable-radix.c @@ -328,6 +328,9 @@ void __init radix__early_init_mmu(void) __vmalloc_end = RADIX_VMALLOC_END; vmemmap = (struct page *)RADIX_VMEMMAP_BASE; ioremap_bot = IOREMAP_BASE; + + pci_io_base = ISA_IO_BASE; + /* * For now radix also use the same frag size */