From patchwork Fri Jun 7 03:17:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 17656 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gg0-f197.google.com (mail-gg0-f197.google.com [209.85.161.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 06BC6238FD for ; Fri, 7 Jun 2013 03:17:19 +0000 (UTC) Received: by mail-gg0-f197.google.com with SMTP id x14sf3371338ggx.4 for ; Thu, 06 Jun 2013 20:17:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=ISntip3/yX9UCe/g6YXp6cXFYIBbA0u9v9KUgG4F9uw=; b=F7RfTBn3WAmycw4qSMIdyybk5KTZgYT/DjV09wDTsZmKYXi9LssjUOQcocordeS6ft ueUcW/qd32EHR3+mhaQjPtOd9kH0+ToRJ94CwVs4lJLVGBlUAhDmKlevDGFF/Nk0VmNB jizbXVxkJMLdwUhQ8F55Ciry11iYL6pvMa4SrSqdRf2SthJ9JHJiHQgG7JLFPK1BXzDa LNgqj/lIxvMA49pO8S9FsJmCiScdWA8dFklZsvOTg99rmUlqbo75vW3ogZx5TGeX21Ep lOZad2QkJfLDgV5sDcN9SBwY/6i45NalmYSRcl2K/jOT2mQVzRl+nmPMaKWjulQ2FfHf Ml2Q== X-Received: by 10.224.42.141 with SMTP id s13mr431617qae.3.1370575038482; Thu, 06 Jun 2013 20:17:18 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.47.52 with SMTP id a20ls1591491qen.51.gmail; Thu, 06 Jun 2013 20:17:18 -0700 (PDT) X-Received: by 10.58.233.173 with SMTP id tx13mr10410313vec.31.1370575038261; Thu, 06 Jun 2013 20:17:18 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id zt2si41606383vdb.11.2013.06.06.20.17.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Jun 2013 20:17:18 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id id13so2453484vcb.37 for ; Thu, 06 Jun 2013 20:17:18 -0700 (PDT) X-Received: by 10.58.106.77 with SMTP id gs13mr289824veb.22.1370575038164; Thu, 06 Jun 2013 20:17:18 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.10.206 with SMTP id pb14csp94804vcb; Thu, 6 Jun 2013 20:17:17 -0700 (PDT) X-Received: by 10.68.32.161 with SMTP id k1mr41457842pbi.221.1370575037048; Thu, 06 Jun 2013 20:17:17 -0700 (PDT) Received: from mail-pa0-x22c.google.com (mail-pa0-x22c.google.com [2607:f8b0:400e:c03::22c]) by mx.google.com with ESMTPS id pf4si50003801pbc.104.2013.06.06.20.17.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Jun 2013 20:17:17 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c03::22c is neither permitted nor denied by best guess record for domain of haojian.zhuang@linaro.org) client-ip=2607:f8b0:400e:c03::22c; Received: by mail-pa0-f44.google.com with SMTP id wp1so2218764pac.31 for ; Thu, 06 Jun 2013 20:17:16 -0700 (PDT) X-Received: by 10.68.190.196 with SMTP id gs4mr33271523pbc.189.1370575036548; Thu, 06 Jun 2013 20:17:16 -0700 (PDT) Received: from localhost.localdomain ([27.115.121.40]) by mx.google.com with ESMTPSA id al2sm75439862pbc.25.2013.06.06.20.17.12 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Jun 2013 20:17:15 -0700 (PDT) From: Haojian Zhuang To: baohua.song@csr.com, linux@arm.linux.org.uk, linux-arm-kernel@lists.infradead.org, arnd@arndb.de, olof@lixom.net Cc: patches@linaro.org, Haojian Zhuang Subject: [PATCH v2] ARM: prima2: fix incorrect panic usage Date: Fri, 7 Jun 2013 11:17:07 +0800 Message-Id: <1370575027-31671-1-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 1.8.1.2 X-Gm-Message-State: ALoCoQnfLTKPg1DDJV5qB+h7v4g1WmItsk54JiW/xAHNtl5wVdrMIjgLoVtCnSRi+DsAKrQSxrzY X-Original-Sender: haojian.zhuang@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , In prima2, some functions of checking DT is registered in initcall level. If it doesn't match the compatible name of sirf, kernel will panic. It blocks the usage of multiplatform on other verndor. The error message is in below. Signen-off-by: Haojian Zhuang Knic - not syncing: unable to find compatible pwrc node in dtb CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.10.0-rc3-00006-gd7f26ea-dirty #86 [] (unwind_backtrace+0x0/0xf8) from [] (show_stack+0x10/0x1) [] (show_stack+0x10/0x14) from [] (panic+0x90/0x1e8) [] (panic+0x90/0x1e8) from [] (sirfsoc_of_pwrc_init+0x24/0x) [] (sirfsoc_of_pwrc_init+0x24/0x58) from [] (do_one_initcal) [] (do_one_initcall+0x90/0x150) from [] (kernel_init_freeab) [] (kernel_init_freeable+0xfc/0x1c4) from [] (kernel_init+0) [] (kernel_init+0x8/0xe4) from [] (ret_from_fork+0x14/0x3c) Changelog: v2: 1. Fix the wrong error message. --- arch/arm/mach-prima2/pm.c | 6 ++++-- arch/arm/mach-prima2/rstc.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-prima2/pm.c b/arch/arm/mach-prima2/pm.c index 9936c18..8f595c0 100644 --- a/arch/arm/mach-prima2/pm.c +++ b/arch/arm/mach-prima2/pm.c @@ -101,8 +101,10 @@ static int __init sirfsoc_of_pwrc_init(void) struct device_node *np; np = of_find_matching_node(NULL, pwrc_ids); - if (!np) - panic("unable to find compatible pwrc node in dtb\n"); + if (!np) { + pr_err("unable to find compatible sirf pwrc node in dtb\n"); + return -ENOENT; + } /* * pwrc behind rtciobrg is not located in memory space diff --git a/arch/arm/mach-prima2/rstc.c b/arch/arm/mach-prima2/rstc.c index 435019c..d5e0cbc 100644 --- a/arch/arm/mach-prima2/rstc.c +++ b/arch/arm/mach-prima2/rstc.c @@ -28,8 +28,10 @@ static int __init sirfsoc_of_rstc_init(void) struct device_node *np; np = of_find_matching_node(NULL, rstc_ids); - if (!np) - panic("unable to find compatible rstc node in dtb\n"); + if (!np) { + pr_err("unable to find compatible sirf rstc node in dtb\n"); + return -ENOENT; + } sirfsoc_rstc_base = of_iomap(np, 0); if (!sirfsoc_rstc_base)