From patchwork Wed Sep 3 12:39:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xia Kaixu X-Patchwork-Id: 36605 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f72.google.com (mail-oa0-f72.google.com [209.85.219.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 02F052039B for ; Wed, 3 Sep 2014 12:40:37 +0000 (UTC) Received: by mail-oa0-f72.google.com with SMTP id m1sf45277532oag.11 for ; Wed, 03 Sep 2014 05:40:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=meJsIw/VPiqa+6yQB7isFqZQJXYZ7fKx/HfPPqODmB0=; b=IQTZa2uEobgFbKeZQixYppNOn7nQFvs8vL5RsrA26bHEAkcOVu65qiXrFNQsVGy5Fc HbbyJWsJdceRqImvDbZwNBYsmkFbO/btRhYK0fhG1WPkSajW82SysCRuMtgIycRZSH7Y AwHGSumfLR/jSwha/2SUpot8TUw8Ob2bYi7WQi4R7gqGwSc5rCFUtU7HvznSfiE8QyGU G8OE2DSeSxdsdzU/p0sIr/CVU6afUOQrf4b1mssxw9rH2glRv39QhtBlhqd6SMa/5F6V 3byYzqpPrNa03qIpIVN9jFwJxPN6Tp0uEV6b5fSSuyZcZJc+d+26IXxul81UmMHA9ixI 5e7A== X-Gm-Message-State: ALoCoQlVnHGTpg/W/jeL9RZZDxpIxEL53TifODKtCfFDxEw5iOeYmwuzsTGvdZly3TeCTh8Vb6F/ X-Received: by 10.43.66.18 with SMTP id xo18mr14599901icb.16.1409748037463; Wed, 03 Sep 2014 05:40:37 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.51.170 with SMTP id u39ls2733380qga.21.gmail; Wed, 03 Sep 2014 05:40:37 -0700 (PDT) X-Received: by 10.52.165.116 with SMTP id yx20mr29409698vdb.13.1409748037271; Wed, 03 Sep 2014 05:40:37 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id ul1si3546927vcb.79.2014.09.03.05.40.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Sep 2014 05:40:37 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.177 as permitted sender) client-ip=209.85.220.177; Received: by mail-vc0-f177.google.com with SMTP id hq11so8485677vcb.8 for ; Wed, 03 Sep 2014 05:40:37 -0700 (PDT) X-Received: by 10.52.129.165 with SMTP id nx5mr25429102vdb.25.1409748036958; Wed, 03 Sep 2014 05:40:36 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp674085vcb; Wed, 3 Sep 2014 05:40:36 -0700 (PDT) X-Received: by 10.70.88.75 with SMTP id be11mr58469199pdb.69.1409748036031; Wed, 03 Sep 2014 05:40:36 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v1si11170260pdq.30.2014.09.03.05.40.26 for ; Wed, 03 Sep 2014 05:40:27 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932565AbaICMkO (ORCPT + 25 others); Wed, 3 Sep 2014 08:40:14 -0400 Received: from mail-pa0-f47.google.com ([209.85.220.47]:44075 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932220AbaICMkM (ORCPT ); Wed, 3 Sep 2014 08:40:12 -0400 Received: by mail-pa0-f47.google.com with SMTP id hz1so17292486pad.6 for ; Wed, 03 Sep 2014 05:40:12 -0700 (PDT) X-Received: by 10.66.66.198 with SMTP id h6mr4592601pat.72.1409748010934; Wed, 03 Sep 2014 05:40:10 -0700 (PDT) Received: from localhost.localdomain ([218.17.215.175]) by mx.google.com with ESMTPSA id td4sm6847115pbc.36.2014.09.03.05.40.07 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Sep 2014 05:40:10 -0700 (PDT) From: Xia Kaixu To: linux-kernel@vger.kernel.org Cc: kaixu.xia@linaro.org, arnd@arndb.de, Imre Kaloz , linaro-kernel@lists.linaro.org Subject: [PATCH] ARM: cns3xxx: fix allmodconfig panic in pci driver Date: Wed, 3 Sep 2014 20:39:22 +0800 Message-Id: <1409747962-23739-1-git-send-email-kaixu.xia@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: kaixu.xia@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.177 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Xia Kaixu The kernel panic occurs when running an allmodconfig kernel on OMAP4460. The inicall "cns3xxx_pcie_init" does not check which hardware it's running on and just tries to access to its specific registers. Now call it from .init_late callback from the two machine descriptors. Signed-off-by: Xia Kaixu Signed-off-by: Arnd Bergmann Cc: Anton Vorontsov Cc: Felix Fietkau Cc: Imre Kaloz Cc: linaro-kernel@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org --- arch/arm/mach-cns3xxx/cns3420vb.c | 1 + arch/arm/mach-cns3xxx/core.c | 1 + arch/arm/mach-cns3xxx/core.h | 9 +++++++++ arch/arm/mach-cns3xxx/pcie.c | 3 +-- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-cns3xxx/cns3420vb.c b/arch/arm/mach-cns3xxx/cns3420vb.c index d863d87..99c74cc 100644 --- a/arch/arm/mach-cns3xxx/cns3420vb.c +++ b/arch/arm/mach-cns3xxx/cns3420vb.c @@ -250,5 +250,6 @@ MACHINE_START(CNS3420VB, "Cavium Networks CNS3420 Validation Board") .init_irq = cns3xxx_init_irq, .init_time = cns3xxx_timer_init, .init_machine = cns3420_init, + .init_late = cns3xxx_pcie_init_late, .restart = cns3xxx_restart, MACHINE_END diff --git a/arch/arm/mach-cns3xxx/core.c b/arch/arm/mach-cns3xxx/core.c index f85449a..c2363bb 100644 --- a/arch/arm/mach-cns3xxx/core.c +++ b/arch/arm/mach-cns3xxx/core.c @@ -404,5 +404,6 @@ DT_MACHINE_START(CNS3XXX_DT, "Cavium Networks CNS3xxx") .init_irq = cns3xxx_init_irq, .init_time = cns3xxx_timer_init, .init_machine = cns3xxx_init, + .init_late = cns3xxx_pcie_init_late, .restart = cns3xxx_restart, MACHINE_END diff --git a/arch/arm/mach-cns3xxx/core.h b/arch/arm/mach-cns3xxx/core.h index 5218b61..780689b 100644 --- a/arch/arm/mach-cns3xxx/core.h +++ b/arch/arm/mach-cns3xxx/core.h @@ -21,6 +21,15 @@ void __init cns3xxx_l2x0_init(void); static inline void cns3xxx_l2x0_init(void) {} #endif /* CONFIG_CACHE_L2X0 */ +#ifdef CONFIG_PCI +extern int __init cns3xxx_pcie_init_late(void); +#else +static inline int __init cns3xxx_pcie_init_late(void) +{ + return -ENXIO; +} +#endif + void __init cns3xxx_map_io(void); void __init cns3xxx_init_irq(void); void cns3xxx_power_off(void); diff --git a/arch/arm/mach-cns3xxx/pcie.c b/arch/arm/mach-cns3xxx/pcie.c index 413134c..bf2a4e8 100644 --- a/arch/arm/mach-cns3xxx/pcie.c +++ b/arch/arm/mach-cns3xxx/pcie.c @@ -318,7 +318,7 @@ static int cns3xxx_pcie_abort_handler(unsigned long addr, unsigned int fsr, return 0; } -static int __init cns3xxx_pcie_init(void) +int __init cns3xxx_pcie_init_late(void) { int i; @@ -340,4 +340,3 @@ static int __init cns3xxx_pcie_init(void) return 0; } -device_initcall(cns3xxx_pcie_init);