Received: by 10.223.164.202 with SMTP id h10csp1146562wrb; Thu, 9 Nov 2017 22:34:02 -0800 (PST) X-Google-Smtp-Source: ABhQp+SMkAR1ez2tt/ghcV1p6Qwx1nvSQWrSi8BvQcq6y1iffJ/0BzcKhYGQMmzEh5f/CBNPA1+j X-Received: by 10.98.75.221 with SMTP id d90mr3193248pfj.90.1510295642709; Thu, 09 Nov 2017 22:34:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510295642; cv=none; d=google.com; s=arc-20160816; b=uNv+AbrjpVBYku6ufToEUJ627OWU7yi4nc6K27NqVU5jlJ6Dj04qI7Ci1VgOMKO2QW BSTioMnt8VGicrAyDxMTY95k52gqrIHB9BRmU72r00mndJHLtsRCIl6jpph2HBTpYyb7 G4JYxV/D3IFRwBcQnAeHt/bYuyO2Qrhrfz+Tf57KS6lVQjAbPw6Qi+4stiIOPO3LmDh6 t3PhKy74V9exy8tqC9u2lE2Flu74IYG9st5znFXqD/3ZBHDl6GiS5kssY07oUhb0Qwf7 0Nz2RJcnrJsEXBOCx9OXtZWuGEn9Ljr5+jTNF9k2oUCTg69odJlWJFCStk8KAAKhZjDR BYhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=56YZftoz4V9fFX9pA3EK7OR86tNzTA6n3Eknkhbai3s=; b=UHC+YtdcHGi4opJMdoLOwUz+EXNr7EB44okfL5/8bd/akaPwZhXCCZ28rlvq+aG1Fg zzMl82QpOTFSaZnJbzL5q64ouljEvNHFzlVLepkQSuNhdejhlp9hFdl2cA4dr/YbpOMP I+IjdJhW1bJKuJWKk+030fbg1+0jU1wesfaSsRAR3dScEanF6VcrOVbHAsl2/C2JzW1L dxAPJBTmD2N59JJp6tF7jGRen45jotp7SN/Co+bzt+sJdsqEmmv5G+7bJiSBpRKHBn5W eDqR4zCCs4h6HRdlhH/A4TBnZiucrt1luYuL6P0n3+UG7FNdOxERhMH5J1r/m4sQNxpX /7cg== 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 p73si8525440pfk.14.2017.11.09.22.33.50; Thu, 09 Nov 2017 22:34:02 -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 S1754310AbdKJGci (ORCPT + 83 others); Fri, 10 Nov 2017 01:32:38 -0500 Received: from LGEAMRELO13.lge.com ([156.147.23.53]:54631 "EHLO lgeamrelo13.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751272AbdKJGcg (ORCPT ); Fri, 10 Nov 2017 01:32:36 -0500 Received: from unknown (HELO lgeamrelo02.lge.com) (156.147.1.126) by 156.147.23.53 with ESMTP; 10 Nov 2017 15:32:32 +0900 X-Original-SENDERIP: 156.147.1.126 X-Original-MAILFROM: iamjoonsoo.kim@lge.com Received: from unknown (HELO localhost) (10.177.222.138) by 156.147.1.126 with ESMTP; 10 Nov 2017 15:32:31 +0900 X-Original-SENDERIP: 10.177.222.138 X-Original-MAILFROM: iamjoonsoo.kim@lge.com Date: Fri, 10 Nov 2017 15:37:28 +0900 From: Joonsoo Kim To: Tony Lindgren Cc: Pavel Machek , pali.rohar@gmail.com, sre@kernel.org, kernel list , linux-arm-kernel , linux-omap@vger.kernel.org, khilman@kernel.org, aaro.koskinen@iki.fi, ivo.g.dimitrov.75@gmail.com, patrikbachan@gmail.com, serge@hallyn.com, abcloriens@gmail.com, "Aneesh Kumar K.V" , Vlastimil Babka , Andrew Morton , Stephen Rothwell , Russell King Subject: Re: n900 in next-20170901 Message-ID: <20171110063727.GA32073@js1304-P5Q-DELUXE> References: <20171107154842.GP28152@atomide.com> <20171108074645.GA18747@js1304-P5Q-DELUXE> <20171108163413.GU28152@atomide.com> <20171109000801.GA23982@js1304-P5Q-DELUXE> <20171109001113.GZ28152@atomide.com> <20171109003639.GB23982@js1304-P5Q-DELUXE> <20171109035031.GA24383@js1304-P5Q-DELUXE> <20171109150854.GC28152@atomide.com> <20171110001315.GA29669@js1304-P5Q-DELUXE> <20171110032610.GJ28152@atomide.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171110032610.GJ28152@atomide.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 09, 2017 at 07:26:10PM -0800, Tony Lindgren wrote: > * Joonsoo Kim [171110 00:10]: > > On Thu, Nov 09, 2017 at 07:08:54AM -0800, Tony Lindgren wrote: > > > Hmm OK. Does your first patch above now have the initcall issue too? > > > It boots if I make that also subsys_initcall and then I get: > > > > > [ 2.078094] vmalloc_pool_init: DMA: get vmalloc area: d0010000 > > > > Yes, first patch has the initcall issue and it's intentional in order > > to check the theory. I checked following log for this. > > > > - Boot failure > > SRAM_ADDR: omap_map_sram: P: 0x40208000 - 0x4020f000 > > SRAM_ADDR: omap_map_sram: V: 0xd0050000 - 0xd0057000 > > > > - Boot success > > SRAM_ADDR: omap_map_sram: P: 0x40208000 - 0x4020f000 > > SRAM_ADDR: omap_map_sram: V: 0xd0008000 - 0xd000f000 > > > > When failure, virtual address for sram is higher than normal one due > > to vmalloc area allocation in __dma_alloc_remap(). If it is deferred, > > virtual address is the same with success case and then the system work. > > > > So, my next theory is that there is n900 specific assumption that sram > > should have that address. Could you check if any working tree for n900 > > which doesn't have my CMA series work or not with adding > > "arm/dma: vmalloc area allocation"? > > Oh I see, sorry I was not following you earlier. So you mean that > by adding the vmalloc_pool_init() initcall the va mapping for SRAM > changes. Exactly. > > And yes, save_secure_ram_context seems to be doing some sketchy > virt to phys calculation with sram_phy_addr_mask. Here's a small > patch to fix that for your CMA series, maybe you can merge it > with your series to avoid breaking booting for git bisect. > > Then I'll follow up on cleaning up save_secure_ram_context later. Thanks for the patch. However, the patch should be modified. See below. > Regards, > > Tony > > 8< ------------------------- > >From tony Mon Sep 17 00:00:00 2001 > From: Tony Lindgren > Date: Thu, 9 Nov 2017 17:05:34 -0800 > Subject: [PATCH] ARM: OMAP2+: Add static SRAM mapping for > save_secure_ram_context > > With the CMA changes from Joonsoo Kim , it > was noticed that n900 stopped booting. After investigating it turned > out that n900 save_secure_ram_context does some whacky virtual to > physical address translation for the SRAM data address. > > Let's fix this for CMA changes by adding a static mapping for SRAM > on omap3. Then we can follow up with a patch to clean up the address > translation in save_secure_ram_context later on. > > Debugged-by: Joonsoo Kim > Signed-off-by: Tony Lindgren > --- > arch/arm/mach-omap2/io.c | 6 ++++++ > arch/arm/mach-omap2/iomap.h | 4 ++++ > 2 files changed, 10 insertions(+) > > diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c > --- a/arch/arm/mach-omap2/io.c > +++ b/arch/arm/mach-omap2/io.c > @@ -139,6 +139,12 @@ static struct map_desc omap243x_io_desc[] __initdata = { > > #ifdef CONFIG_ARCH_OMAP3 > static struct map_desc omap34xx_io_desc[] __initdata = { > + { > + .virtual = OMAP34XX_SRAM_VIRT, > + .pfn = __phys_to_pfn(OMAP34XX_SRAM_PHYS), > + .length = OMAP34XX_SRAM_SIZE, > + .type = MT_DEVICE > + }, > { > .virtual = L3_34XX_VIRT, > .pfn = __phys_to_pfn(L3_34XX_PHYS), > diff --git a/arch/arm/mach-omap2/iomap.h b/arch/arm/mach-omap2/iomap.h > --- a/arch/arm/mach-omap2/iomap.h > +++ b/arch/arm/mach-omap2/iomap.h > @@ -123,6 +123,10 @@ > * VPOM3430 was not working for Int controller > */ > > +#define OMAP34XX_SRAM_PHYS 0x40200000 > +#define OMAP34XX_SRAM_VIRT 0xd0010000 > +#define OMAP34XX_SRAM_SIZE 0x10000 For my testing environment, vmalloc address space is started at roughly 0xe0000000 so 0xd0010000 would not be valid. And, PHYS can be different according to the system type. Maybe either OMAP3_SRAM_PUB_PA or OMAP3_SRAM_PA. It seems that SIZE and TYPE should be considered, too. My understanding is correct? Thanks. From 1583659184383234780@xxx Fri Nov 10 06:24:50 +0000 2017 X-GM-THRID: 1577552291468010502 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread