From patchwork Fri Jul 6 21:01:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Warren X-Patchwork-Id: 1167621 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 2240D3FC33 for ; Fri, 6 Jul 2012 21:06:07 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SnFfu-0003ju-5j; Fri, 06 Jul 2012 21:02:50 +0000 Received: from avon.wwwdotorg.org ([2001:470:1f0f:bd7::2]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SnFfP-0003fE-6M for linux-arm-kernel@lists.infradead.org; Fri, 06 Jul 2012 21:02:37 +0000 Received: from severn.wwwdotorg.org (unknown [192.168.65.5]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by avon.wwwdotorg.org (Postfix) with ESMTPS id 2221562FB; Fri, 6 Jul 2012 15:06:23 -0600 (MDT) Received: from [10.20.204.51] (searspoint.nvidia.com [216.228.112.21]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by severn.wwwdotorg.org (Postfix) with ESMTPSA id 910C1E4100; Fri, 6 Jul 2012 15:01:43 -0600 (MDT) Message-ID: <4FF75235.2050104@wwwdotorg.org> Date: Fri, 06 Jul 2012 15:01:41 -0600 From: Stephen Warren User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 To: thierry.reding@avionic-design.de Subject: Re: [PATCH 03/15] ARM: tegra: use fixed PCI i/o mapping References: <1341600040-30993-1-git-send-email-robherring2@gmail.com> <1341600040-30993-4-git-send-email-robherring2@gmail.com> <4FF74028.6090300@wwwdotorg.org> <4FF74689.8070103@gmail.com> <4FF74789.8000804@wwwdotorg.org> <4FF74C61.4060903@wwwdotorg.org> In-Reply-To: <4FF74C61.4060903@wwwdotorg.org> X-Enigmail-Version: 1.4.2 X-Virus-Scanned: clamav-milter 0.96.5 at avon.wwwdotorg.org X-Virus-Status: Clean X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: "linux-tegra@vger.kernel.org" , Olof Johansson , linux-arm-kernel@lists.infradead.org, Colin Cross X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org (cutting down CCs for Tegra-specific discussion) On 07/06/2012 02:36 PM, Stephen Warren wrote: > On 07/06/2012 02:16 PM, Stephen Warren wrote: >> On 07/06/2012 02:11 PM, Rob Herring wrote: >>> On 07/06/2012 02:44 PM, Stephen Warren wrote: >>>> On 07/06/2012 12:40 PM, Rob Herring wrote: >>>>> From: Rob Herring >>>>> >>>>> Move tegra PCI to fixed i/o mapping and remove io.h. >>>> >>>> Thierry, since you're the Tegra PCIe expert right now, could you please >>>> test and/or comment on this. >>>> >>>> I did try testing this on next-20120705 on TrimSlice (i.e. the >>>> PCIe-based Ethernet controller), but found that PCIe has stopped working >>>> there due to "resource collisions". I know this used to work fairly >>>> recently, since I tested it when I added the PCIe initialization call to >>>> board-dt-tegra20.c. The PCIe messages are: >>> >>> This is with my change and it works currently without? >> >> Sorry, no, it's broken even without your change. Hence, I can't test the >> impact of your change. Well, I saw the same failure with your patches >> too, but that isn't really conclusive testing of your change:-) > > Aha. The PCIe problem only shows up when booting TrimSlice using DT (in > next-20120705 or Tegra's for-next branch). > > When booting using board files, PCIe works, both without and with your > patch, on top of next-20120705. > > So, your patches are tested on Tegra and still working. I haven't root-caused it, but I have found what changed that triggered the problem: When I first wrote the patch to board-dt-tegra20.c that brought DT booting up to feature parity with non-DT boot, IIRC, I wrote a late_initcall() to run whatever code I added. I'm sure I tested TrimSlice PCIe when booting using DT then, since that was the whole point of the patch. Later, I revised the patch to sit on top of Shawn Guo's .init_late machine descriptor patch, and ran the code from there instead. However, this appears to have broken PCIe on Trimslice; I must have screwed up the testing of that change. I don't know why this causes a behavior difference though; perhaps some resource acquisition race condition. But just reverting that change doesn't fix the problem; I need to switch to a *subsys*_initcall() instead (which is in fact what the Trimslice board file uses for PCIe init). In other words: MACHINE_END diff --git a/arch/arm/mach-tegra/board-dt-tegra20.c b/arch/arm/mach-tegra/board-dt-tegra20.c index 70a19a9..74aefaf 100644 --- a/arch/arm/mach-tegra/board-dt-tegra20.c +++ b/arch/arm/mach-tegra/board-dt-tegra20.c @@ -145,19 +145,20 @@ static struct { #endif }; -static void __init tegra_dt_init_late(void) +static int __init tegra_dt_init_late(void) { int i; - tegra_init_late(); - for (i = 0; i < ARRAY_SIZE(board_init_funcs); i++) { if (of_machine_is_compatible(board_init_funcs[i].machine)) { board_init_funcs[i].init(); break; } } + + return 0; } +subsys_initcall(tegra_dt_init_late); static const char *tegra20_dt_board_compat[] = { "nvidia,tegra20", @@ -171,7 +172,7 @@ DT_MACHINE_START(TEGRA_DT, "nVidia Tegra20 (Flattened Device Tree)") .handle_irq = gic_handle_irq, .timer = &tegra_timer, .init_machine = tegra_dt_init, - .init_late = tegra_dt_init_late, + .init_late = tegra_init_late, .restart = tegra_assert_system_reset, .dt_compat = tegra20_dt_board_compat,