From patchwork Fri Jun 7 03:10:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 17655 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f199.google.com (mail-vc0-f199.google.com [209.85.220.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2340B20F47 for ; Fri, 7 Jun 2013 03:10:20 +0000 (UTC) Received: by mail-vc0-f199.google.com with SMTP id gf12sf3736917vcb.2 for ; Thu, 06 Jun 2013 20:10:19 -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=H3B7YsjW/K51mFXfv1maTbndfnpqKMDnDsreE41TnAo=; b=dj99hXUlQhusUBXZ/5xL/csffJzFjimWzLC5fA1gzUoGKP3+prbyjWNKOlKxieiORT PodAZf8O9nqzW5lzyYdPr/47QF5miiV2gEzOlWeQKJ6j94ohFv2jxmTCf5bcvWPDiyZL M+KygDIRTqm7R04SxVHozK0dD2wPPGlKzSA7dg3yuWDTsOlw7MFWeDnQ6RyHCT4hW0ok sptdpJWNABvnQiioRZocxEBgLa7QmGkjSo/rGzjJFN8nEVXjq+IrJVQhdG5yGqwmhw+B j1fheMX52ToXFDBB8C5kyRnj27qgw6ndiMeBGGkmXGpbNXC1VNhuELiL28j5n1mXUBaJ 6n5w== X-Received: by 10.224.205.138 with SMTP id fq10mr461374qab.1.1370574619640; Thu, 06 Jun 2013 20:10:19 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.24.138 with SMTP id u10ls465028qef.75.gmail; Thu, 06 Jun 2013 20:10:19 -0700 (PDT) X-Received: by 10.52.230.164 with SMTP id sz4mr20055992vdc.118.1370574619276; Thu, 06 Jun 2013 20:10:19 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id ef7si42638996vdc.124.2013.06.06.20.10.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Jun 2013 20:10:19 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.171 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.171; Received: by mail-vc0-f171.google.com with SMTP id m16so2497485vca.30 for ; Thu, 06 Jun 2013 20:10:19 -0700 (PDT) X-Received: by 10.52.157.138 with SMTP id wm10mr19610210vdb.57.1370574619074; Thu, 06 Jun 2013 20:10:19 -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 pb14csp94573vcb; Thu, 6 Jun 2013 20:10:18 -0700 (PDT) X-Received: by 10.66.251.101 with SMTP id zj5mr660622pac.122.1370574618174; Thu, 06 Jun 2013 20:10:18 -0700 (PDT) Received: from mail-pd0-f169.google.com (mail-pd0-f169.google.com [209.85.192.169]) by mx.google.com with ESMTPS id lq8si416976pab.200.2013.06.06.20.10.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Jun 2013 20:10:18 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.169 is neither permitted nor denied by best guess record for domain of haojian.zhuang@linaro.org) client-ip=209.85.192.169; Received: by mail-pd0-f169.google.com with SMTP id y10so4230540pdj.14 for ; Thu, 06 Jun 2013 20:10:17 -0700 (PDT) X-Received: by 10.68.11.232 with SMTP id t8mr41081128pbb.128.1370574617592; Thu, 06 Jun 2013 20:10:17 -0700 (PDT) Received: from localhost.localdomain ([27.115.121.40]) by mx.google.com with ESMTPSA id lq4sm815582pab.19.2013.06.06.20.10.13 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Jun 2013 20:10:16 -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] ARM: prima2: fix incorrect panic usage Date: Fri, 7 Jun 2013 11:10:05 +0800 Message-Id: <1370574605-30505-1-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 1.8.1.2 X-Gm-Message-State: ALoCoQloi8SFEqMopq1pruOT+Omyr2gLXMHO0QIPmBMyQWKyKxfnvIpoExZs+J0ahI/5lthrN8pZ X-Original-Sender: haojian.zhuang@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.171 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. Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,255) CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.10.0-rc3-00006-gd7f26ea-dirty #87 [] (unwind_backtrace+0x0/0xf8) from [] (show_stack+0x10/0x1) [] (show_stack+0x10/0x14) from [] (panic+0x90/0x1e8) [] (panic+0x90/0x1e8) from [] (mount_block_root+0x250/0x298) [] (mount_block_root+0x250/0x298) from [] (prepare_namespac) [] (prepare_namespace+0x120/0x174) from [] (kernel_init_fre) [] (kernel_init_freeable+0x17c/0x1c4) from [] (kernel_init+) [] (kernel_init+0x8/0xe4) from [] (ret_from_fork+0x14/0x3c) Signed-off-by: Haojian Zhuang --- 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)