From patchwork Wed Sep 3 13:18:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xia Kaixu X-Patchwork-Id: 36606 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f200.google.com (mail-ie0-f200.google.com [209.85.223.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 20174202E4 for ; Wed, 3 Sep 2014 13:19:39 +0000 (UTC) Received: by mail-ie0-f200.google.com with SMTP id at20sf44381276iec.7 for ; Wed, 03 Sep 2014 06:19:38 -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=Y2mIgP2TQ3gZhdrVHdP7i7Jg2s9UY10BgDr+dDDCit+VXBm1Wm32PLL/JJe2Ev15xZ 7KHqBFU86XNJ4ThA4mQ3VXt3GrR+aU7imOpym1hPWYZHgzucFIwf5t1QoNz+kTqIBOIg O2efcZ5b+kOrM0i7rbaR7mMwWM6LgNBYOxk6Fmzpw2RCBYRyaLnj9a/CUaYql8kDvVlK LKBJ92/EV2E8vyyz+8UP4qhjsTzuzJLyC9tAXlzNiMakmROEmiMzY3ttmSFLNzITAKkj eAeyIk+Afj904kacCji9f2Sxy/7v1p9zEurYr8lLNxsuiC88+amzSHO/OhBe8HrrEaOM dKPg== X-Gm-Message-State: ALoCoQlNnSclIeuWkL4izy+RXwDp1o/93Zqe7E2jPXR/R7NK9wcdmJNFIHVV/1dxxZLy0WpxTLYN X-Received: by 10.182.135.194 with SMTP id pu2mr21520432obb.35.1409750378516; Wed, 03 Sep 2014 06:19:38 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.97.100 with SMTP id l91ls2785049qge.69.gmail; Wed, 03 Sep 2014 06:19:38 -0700 (PDT) X-Received: by 10.52.5.201 with SMTP id u9mr241763vdu.85.1409750378289; Wed, 03 Sep 2014 06:19:38 -0700 (PDT) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id i9si3609035vca.73.2014.09.03.06.19.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Sep 2014 06:19:38 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.180 as permitted sender) client-ip=209.85.220.180; Received: by mail-vc0-f180.google.com with SMTP id lf12so8828383vcb.11 for ; Wed, 03 Sep 2014 06:19:38 -0700 (PDT) X-Received: by 10.52.119.229 with SMTP id kx5mr4667290vdb.40.1409750378203; Wed, 03 Sep 2014 06:19:38 -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 uj3csp679688vcb; Wed, 3 Sep 2014 06:19:37 -0700 (PDT) X-Received: by 10.70.93.8 with SMTP id cq8mr14940417pdb.160.1409750377027; Wed, 03 Sep 2014 06:19:37 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t4si11178969pdn.117.2014.09.03.06.19.27 for ; Wed, 03 Sep 2014 06:19:28 -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 S932854AbaICNTP (ORCPT + 25 others); Wed, 3 Sep 2014 09:19:15 -0400 Received: from mail-pa0-f53.google.com ([209.85.220.53]:54124 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932227AbaICNTL (ORCPT ); Wed, 3 Sep 2014 09:19:11 -0400 Received: by mail-pa0-f53.google.com with SMTP id fa1so17412089pad.40 for ; Wed, 03 Sep 2014 06:19:07 -0700 (PDT) X-Received: by 10.70.43.39 with SMTP id t7mr57619063pdl.101.1409750346318; Wed, 03 Sep 2014 06:19:06 -0700 (PDT) Received: from localhost.localdomain ([218.17.215.175]) by mx.google.com with ESMTPSA id l3sm9382920pdr.17.2014.09.03.06.19.00 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Sep 2014 06:19:05 -0700 (PDT) From: Xia Kaixu To: linux-kernel@vger.kernel.org Cc: kaixu.xia@linaro.org, arnd@arndb.de, Anton Vorontsov , Felix Fietkau , Imre Kaloz , linaro-kernel@lists.linaro.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: cns3xxx: fix allmodconfig panic in pci driver Date: Wed, 3 Sep 2014 21:18:12 +0800 Message-Id: <1409750292-24105-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.180 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);