Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp933340imu; Thu, 13 Dec 2018 06:52:51 -0800 (PST) X-Google-Smtp-Source: AFSGD/W5r5DkDL5DPQc2R7mfpa6W+rqKWFDbrFI/+FKmJR6LzwCNA7Ooyw90WqD1UhVqJ/NdHKos X-Received: by 2002:a17:902:7402:: with SMTP id g2mr23339935pll.198.1544712771153; Thu, 13 Dec 2018 06:52:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544712771; cv=none; d=google.com; s=arc-20160816; b=ckoe1UR3mzgBeVFSkKiDY9YzKPcQDQmUdQAyYZfSDgXXWWCya81QsBeI0B4r7xI0oH NtVqBXI9hWHQc3UwCmVS4sGMB6YCarFnp7rlUlilWS1geShhgt4eOYGuK7eF0CGIC2gU AwUA/Rp+sRe1Kh/jwoE/7BOD7IJnEUNnYa/l5b+XUPxLxP+Xym5EIY7E4uctv0QmD/mJ FSwiVFObf189X8ubBIYxXIupRFBg1x91OKJto9WdTR+V8n75DxOXnRgvvVN/bs2CtlKo PC9paiFpND4dFz79bngyabMQCoZedbi5+vb4qajIn0pUfbSsatcT5VWZee4u9hVaWxrv pVMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject; bh=Xe6F+FqP1c0F5K54QeN35IErnZ6yOWSoKdnQE43FvbQ=; b=bb9qqFrwue1F9rxczqE17GuZKZPCfCC4nNF9wzld4gjiacs/mTgLNEGNNyOY5VEEIW 92Q/yrkBEe3UDvC7vGvnD+s5LQAeJD+12rcopdA0k5eL+K1FZnnbTtpDpuZ5DKXLw1MM QZVMIWV0ZPpZz8Wx77NyvX7TYyL8JI7qutvQSkJ+20GCUpxPkQhVIwTm3Dl+VPX1zfj2 WxI57CUYj0KEJMXImTrpeGAkg3uerWX7DoHTLDB3dHpf5lEqfM5dCcFYl1QKYY8SQVa5 2gZ2FJSx7p3442zQr1dvAhCR7R4PaxMqEvJHQkNvP0E5hSV9beucdEjwZ3MzfqY3mFTn 669w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b11si1673157pla.405.2018.12.13.06.52.36; Thu, 13 Dec 2018 06:52:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728965AbeLMOvg (ORCPT + 99 others); Thu, 13 Dec 2018 09:51:36 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:54166 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727551AbeLMOvg (ORCPT ); Thu, 13 Dec 2018 09:51:36 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 43FxTJ6VWWz9v0Kj; Thu, 13 Dec 2018 15:51:32 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id qmnbzjyHf6jM; Thu, 13 Dec 2018 15:51:32 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 43FxTJ5yjHz9ttCS; Thu, 13 Dec 2018 15:51:32 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 262A28B875; Thu, 13 Dec 2018 15:51:34 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id OAbhFL3McqCI; Thu, 13 Dec 2018 15:51:34 +0100 (CET) Received: from PO15451 (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 4B76A8B883; Thu, 13 Dec 2018 15:51:32 +0100 (CET) Subject: Re: [PATCH v1 03/13] powerpc/mm/32s: rework mmu_mapin_ram() From: Christophe Leroy To: =?UTF-8?Q?Jonathan_Neusch=c3=a4fer?= Cc: linuxppc-dev@lists.ozlabs.org, Paul Mackerras , linux-kernel@vger.kernel.org References: <8835330baa77d88e0267b0b1215b78c991e6d17a.1543517818.git.christophe.leroy@c-s.fr> <20181203215558.GK15324@latitude> <84624899-bbda-9f08-2527-151fddbd1b01@c-s.fr> Message-ID: Date: Thu, 13 Dec 2018 15:51:32 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.3 MIME-Version: 1.0 In-Reply-To: <84624899-bbda-9f08-2527-151fddbd1b01@c-s.fr> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Again, Le 13/12/2018 à 13:16, Christophe Leroy a écrit : > Hi, > > On 12/03/2018 09:55 PM, Jonathan Neuschäfer wrote: >> Hi, >> >> On Thu, Nov 29, 2018 at 07:00:16PM +0000, Christophe Leroy wrote: >>> This patch reworks mmu_mapin_ram() to be more generic and map as much >>> blocks as possible. It now supports blocks not starting at address 0. >>> >>> It scans DBATs array to find free ones instead of forcing the use of >>> BAT2 and BAT3. >>> >>> Signed-off-by: Christophe Leroy >>> --- >> >> I've just tested this series on my Wii, and starting from this patch >> (03/13), it hangs at the following lines of output: >> >> [    0.000000] printk: bootconsole [udbg0] enabled >> [    0.000000] Total memory = 319MB; using 1024kB for hash table (at >> (ptrval)) >> >> Before this patch it looks like this and boots to userspace: >> >> [    0.000000] printk: bootconsole [udbg0] enabled >> [    0.000000] Total memory = 319MB; using 1024kB for hash table (at >> (ptrval)) >> [    0.000000] Linux version 4.20.0-rc5-wii-00022-gfbb911b84755 >> (jn@longitude) (gcc version 8.2.0 (Debian 8.2.0-9)) #1337 PREEMPT Mon >> Dec 3 21:49:02 CET 2018 >> ug_udbg_init: early -> final >> usbgecko_udbg: ready >> [    0.000000] Using wii machine description > > Can you tell/provide the .config and dts used ? > > You seem to have 319MB RAM wherease arch/powerpc/boot/dts/wii.dts only > has 88MB Memory: > >     memory { >         device_type = "memory"; >         reg = <0x00000000 0x01800000    /* MEM1 24MB 1T-SRAM */ >                0x10000000 0x04000000>;    /* MEM2 64MB GDDR3 */ >     }; Putting the same description in my mpc832x board DTS and doing a few hacks to get the WII functions called, I get the following: [ 0.000000] Top of RAM: 0x14000000, Total RAM: 0x5800000 [ 0.000000] Memory hole size: 232MB [ 0.000000] Zone ranges: [ 0.000000] DMA [mem 0x0000000000000000-0x0000000013ffffff] [ 0.000000] Normal empty [ 0.000000] Movable zone start for each node [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x0000000000000000-0x00000000017fffff] [ 0.000000] node 0: [mem 0x0000000010000000-0x0000000013ffffff] [ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000013ffffff] [ 0.000000] On node 0 totalpages: 22528 [ 0.000000] DMA zone: 640 pages used for memmap [ 0.000000] DMA zone: 0 pages reserved [ 0.000000] DMA zone: 22528 pages, LIFO batch:3 [ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768 [ 0.000000] pcpu-alloc: [0] 0 [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 21888 [ 0.000000] Kernel command line: loglevel=7 ip=192.168.2.5:192.168.2.2::255.0 [ 0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes) [ 0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes) [ 0.000000] Memory: 77060K/90112K available (6548K kernel code, 1156K rwdata, [ 0.000000] Kernel virtual memory layout: [ 0.000000] * 0xfffdf000..0xfffff000 : fixmap [ 0.000000] * 0xfdffd000..0xfe000000 : early ioremap [ 0.000000] * 0xd5000000..0xfdffd000 : vmalloc & ioremap root@vgoippro:~# cat /sys/kernel/debug/powerpc/block_address_translation ---[ Instruction Block Address Translation ]--- 0: 0xc0000000-0xc0ffffff 0x00000000 Kernel EXEC coherent 1: - 2: 0xc1000000-0xc17fffff 0x01000000 Kernel EXEC coherent 3: - 4: 0xd0000000-0xd3ffffff 0x10000000 Kernel EXEC coherent 5: - 6: - 7: - ---[ Data Block Address Translation ]--- 0: 0xc0000000-0xc0ffffff 0x00000000 Kernel RW coherent 1: 0xfffe0000-0xffffffff 0x0d000000 Kernel RW no cache guarded 2: 0xc1000000-0xc17fffff 0x01000000 Kernel RW coherent 3: - 4: 0xd0000000-0xd3ffffff 0x10000000 Kernel RW coherent 5: - 6: - 7: - Could you please provide the dmesg and /sys/kernel/debug/powerpc/block_address_translation from before this patch, so that we can compare and identify the differences if any ? Thanks Christophe > > Christophe > >> ... >> >> I've tested at patch 1, 2, 3, 4, and 13, so I don't know if it works >> somewhere in the middle, but probably not. >> >> (And in case you're wondering about the 22 in the version string: Those >> are mostly patches that give me a serial console.) >> >> I'm not sure what is going on, because I haven't looked closely at the >> patches or tried to debug the problem. If you have some debugging tips, >> I can try them. >> >> >> Jonathan Neuschäfer >>