From patchwork Mon Oct 15 19:16:31 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Cochran X-Patchwork-Id: 1595291 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 6C787DFB34 for ; Mon, 15 Oct 2012 19:18:46 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TNq9v-0000A3-FU; Mon, 15 Oct 2012 19:17:03 +0000 Received: from mail-wi0-f177.google.com ([209.85.212.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TNq9k-00007c-Sq for linux-arm-kernel@lists.infradead.org; Mon, 15 Oct 2012 19:16:54 +0000 Received: by mail-wi0-f177.google.com with SMTP id hj13so1888867wib.0 for ; Mon, 15 Oct 2012 12:16:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :in-reply-to:references; bh=P4vT3WY5gYjOPyJYGpi1CtNFB2Jz/Lgn9dYPPcqFSd4=; b=YuJRkLF0JmluSgGxrCAXet2PMcNR1LkSEqRLAlma8HIqQtEV2DYdlxCnhvfwuRw3gE 05auyzwEOxRknL+ZMR63zqK1qOOu4v8sCyGHt7DQlPML3+tpSU0bZIbCSjDxcLw/5wvO WIr9GnYxhf5U8QQIESln3HMMFz0RKLziu37yj8Z8Li3mS7vt8HTayOC6maSHwcpxQPwS zcrUird0vA2nuqFY9j1jRte4jySCPDEsaIFaC4nu14rxjrLwewoO6DRw1/wxn16G6cdj iTJjQALstCpn0lQ8LqBmSkqJpmqmAb0ZmTU2RvHAk2Z5+tGc7ytpP2zz/w6hMyX1qBrF QHFw== Received: by 10.216.220.78 with SMTP id n56mr7612135wep.135.1350328610235; Mon, 15 Oct 2012 12:16:50 -0700 (PDT) Received: from localhost.localdomain (089144206171.atnat0015.highway.a1.net. [89.144.206.171]) by mx.google.com with ESMTPS id hv8sm15625117wib.0.2012.10.15.12.16.47 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 15 Oct 2012 12:16:48 -0700 (PDT) From: Richard Cochran To: Subject: [PATCH 1/5] ARM: OMAP2+: gpmc: Fix kernel BUG for DT boot mode Date: Mon, 15 Oct 2012 21:16:31 +0200 Message-Id: <41d66042625157d089e9c9532030a6831e79c641.1350327324.git.richardcochran@gmail.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: References: In-Reply-To: References: X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.212.177 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (richardcochran[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Afzal Mohammed , Russell King , Arnd Bergmann , Tony Lindgren , "hvaibhav@ti.com" , David Miller , linux-arm-kernel@lists.infradead.org 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: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: hvaibhav@ti.com With recent changes in omap gpmc driver code, in case of DT boot mode, where bootloader does not configure gpmc cs space will result into kernel BUG() inside gpmc_mem_init() function, as gpmc cs0 gpmc_config7[0].csvalid bit is set to '1' and gpmc_config7[0].baseaddress is set to '0' on reset. This use-case is applicable for any board/EVM which doesn't have any peripheral connected to gpmc cs0, for example BeagleXM and BeagleBone, so DT boot mode fails. This patch adds of_have_populated_dt() check before creating device, so that for DT boot mode, gpmc probe will not be called which is expected behavior, as gpmc is not supported yet from DT. Signed-off-by: Vaibhav Hiremath Cc: Afzal Mohammed Cc: Tony Lindgren Cc Paul Walmsley --- arch/arm/mach-omap2/gpmc.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index 5ac5cf3..90b033e 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c @@ -981,6 +981,10 @@ static int __init omap_gpmc_init(void) struct platform_device *pdev; char *oh_name = "gpmc"; + /* If dtb is there, the devices will be created dynamically */ + if (of_have_populated_dt()) + return -ENODEV; + oh = omap_hwmod_lookup(oh_name); if (!oh) { pr_err("Could not look up %s\n", oh_name);