From patchwork Fri Nov 20 11:17:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sekhar Nori X-Patchwork-Id: 57064 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp413291lbb; Fri, 20 Nov 2015 03:17:38 -0800 (PST) X-Received: by 10.66.140.79 with SMTP id re15mr17828527pab.127.1448018255151; Fri, 20 Nov 2015 03:17:35 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id sj4si18427851pac.228.2015.11.20.03.17.34; Fri, 20 Nov 2015 03:17:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759925AbbKTLRc (ORCPT + 28 others); Fri, 20 Nov 2015 06:17:32 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:39877 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759909AbbKTLR3 (ORCPT ); Fri, 20 Nov 2015 06:17:29 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id tAKBH5YP011958; Fri, 20 Nov 2015 05:17:05 -0600 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id tAKBH5pV001753; Fri, 20 Nov 2015 05:17:05 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.224.2; Fri, 20 Nov 2015 05:17:05 -0600 Received: from psplinux063.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id tAKBH3G9004947; Fri, 20 Nov 2015 05:17:03 -0600 From: Sekhar Nori To: Murali Karicheri , Bjorn Helgaas CC: , , Subject: [PATCH] PCI: keystone: fix crash with deferred probe Date: Fri, 20 Nov 2015 16:47:02 +0530 Message-ID: <866b2f1544f9d55fa932aa9f9cb5e7d523a23d05.1448017883.git.nsekhar@ti.com> X-Mailer: git-send-email 2.4.4.408.g16da57c MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Drop __init annotations for functions called during probe of keystone PCIe host. This fixes kernel crashes seen because of init data reclamation if the driver defer probes because of phy unavailability. While at it, drop the useless __refdata annotation to driver structure. If its really needed, it should be added back with a comment explaining why. Signed-off-by: Sekhar Nori --- drivers/pci/host/pci-keystone-dw.c | 2 +- drivers/pci/host/pci-keystone.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) -- 2.4.4.408.g16da57c -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/drivers/pci/host/pci-keystone-dw.c b/drivers/pci/host/pci-keystone-dw.c index ed34c9520a02..47ddbcce53ca 100644 --- a/drivers/pci/host/pci-keystone-dw.c +++ b/drivers/pci/host/pci-keystone-dw.c @@ -469,7 +469,7 @@ void ks_dw_pcie_initiate_link_train(struct keystone_pcie *ks_pcie) * and call dw_pcie_v3_65_host_init() API to initialize the Keystone * PCI host controller. */ -int __init ks_dw_pcie_host_init(struct keystone_pcie *ks_pcie, +int ks_dw_pcie_host_init(struct keystone_pcie *ks_pcie, struct device_node *msi_intc_np) { struct pcie_port *pp = &ks_pcie->pp; diff --git a/drivers/pci/host/pci-keystone.c b/drivers/pci/host/pci-keystone.c index 0aa81bd3de12..593a58834c7d 100644 --- a/drivers/pci/host/pci-keystone.c +++ b/drivers/pci/host/pci-keystone.c @@ -291,7 +291,7 @@ static struct pcie_host_ops keystone_pcie_host_ops = { .scan_bus = ks_dw_pcie_v3_65_scan_bus, }; -static int __init ks_add_pcie_port(struct keystone_pcie *ks_pcie, +static int ks_add_pcie_port(struct keystone_pcie *ks_pcie, struct platform_device *pdev) { struct pcie_port *pp = &ks_pcie->pp; @@ -340,7 +340,7 @@ static int __exit ks_pcie_remove(struct platform_device *pdev) return 0; } -static int __init ks_pcie_probe(struct platform_device *pdev) +static int ks_pcie_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct keystone_pcie *ks_pcie; @@ -396,7 +396,7 @@ fail_clk: return ret; } -static struct platform_driver ks_pcie_driver __refdata = { +static struct platform_driver ks_pcie_driver = { .probe = ks_pcie_probe, .remove = __exit_p(ks_pcie_remove), .driver = {