From patchwork Fri Feb 8 22:56:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hunter, Jon" X-Patchwork-Id: 2118841 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 10C09DFE75 for ; Fri, 8 Feb 2013 22:58:59 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U3wrq-000819-S2; Fri, 08 Feb 2013 22:56:26 +0000 Received: from bear.ext.ti.com ([192.94.94.41]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1U3wrm-00080R-3N for linux-arm-kernel@lists.infradead.org; Fri, 08 Feb 2013 22:56:23 +0000 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id r18MuKZF012023; Fri, 8 Feb 2013 16:56:20 -0600 Received: from DLEE74.ent.ti.com (dlee74.ent.ti.com [157.170.170.8]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id r18MuKPg016386; Fri, 8 Feb 2013 16:56:20 -0600 Received: from [172.24.1.123] (172.24.1.123) by DLEE74.ent.ti.com (157.170.170.8) with Microsoft SMTP Server id 14.1.323.3; Fri, 8 Feb 2013 16:56:19 -0600 Message-ID: <51158293.8010101@ti.com> Date: Fri, 8 Feb 2013 16:56:19 -0600 From: Jon Hunter User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 To: Tony Lindgren Subject: Re: [PATCH 1/2] ARM: OMAP2+: Prevent potential crash if GPMC probe fails References: <1359736726-10193-1-git-send-email-jon-hunter@ti.com> <1359736726-10193-2-git-send-email-jon-hunter@ti.com> <20130201220804.GZ22517@atomide.com> In-Reply-To: <20130201220804.GZ22517@atomide.com> X-Originating-IP: [172.24.1.123] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130208_175622_214239_74900367 X-CRM114-Status: GOOD ( 21.31 ) X-Spam-Score: -7.6 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [192.94.94.41 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Afzal Mohammed , linux-omap , linux-arm 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 On 02/01/2013 04:08 PM, Tony Lindgren wrote: > * Jon Hunter [130201 08:42]: >> If the GPMC probe fails, devices that use the GPMC (such as ethernet >> chips, flash memories, etc) can still allocate a GPMC chip-select and >> register the device. On the OMAP2420 H4 board, this was causing the >> kernel to crash after the gpmc probe failed and the board attempted >> to start networking. Prevent this by marking all the chip-selects as >> reserved by default and only make them available for devices to request >> if the GPMC probe succeeds. > > Thanks applying into omap-for-v3.9/gpmc. Hi Tony, this one appears to be merged incorrectly. The unreserve ended up in the gpmc_calc_timings() function. Here is a patch to fix. Cheers Jon From ebc0613fb5a70f36fcb119cbe58724f9b442903a Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Fri, 8 Feb 2013 16:48:25 -0600 Subject: [PATCH] ARM: OMAP2+: Fix-up gpmc merge error Commit "ARM: OMAP2+: Prevent potential crash if GPMC probe fails" added code to ensure that GPMC chip-selects could not be requested until the device probe was successful. The chip-selects should have been unreserved at the end of the probe function, but the code to unreserve them appears to have ended up in the gpmc_calc_timings() function and hence, this is causing problems requesting chip-selects. Fix this merge error by unreserving the chip-selects at the end of the probe, but before we call the gpmc child probe functions (for device-tree) which request a chip-select. Signed-off-by: Jon Hunter Tested-by: Ezequiel Garcia Tested-by: Philip Avinash Tested-by: Grazvydas Ignotas --- arch/arm/mach-omap2/gpmc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index 1adb2d4..1e8bcb4 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c @@ -1125,9 +1125,6 @@ int gpmc_calc_timings(struct gpmc_timings *gpmc_t, /* TODO: remove, see function definition */ gpmc_convert_ps_to_ns(gpmc_t); - /* Now the GPMC is initialised, unreserve the chip-selects */ - gpmc_cs_map = 0; - return 0; } @@ -1388,6 +1385,9 @@ static int gpmc_probe(struct platform_device *pdev) if (IS_ERR_VALUE(gpmc_setup_irq())) dev_warn(gpmc_dev, "gpmc_setup_irq failed\n"); + /* Now the GPMC is initialised, unreserve the chip-selects */ + gpmc_cs_map = 0; + rc = gpmc_probe_dt(pdev); if (rc < 0) { clk_disable_unprepare(gpmc_l3_clk);