Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754524AbbKLMWp (ORCPT ); Thu, 12 Nov 2015 07:22:45 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:60916 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754489AbbKLMWb (ORCPT ); Thu, 12 Nov 2015 07:22:31 -0500 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Cc: Jisheng Zhang , wangzhou1@hisilicon.com, bhelgaas@google.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] PCI: hisi: fix deferred probing Date: Thu, 12 Nov 2015 13:21:37 +0100 Message-ID: <4417267.EzK5DAjM5p@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1447329728-1589-1-git-send-email-jszhang@marvell.com> References: <1447329728-1589-1-git-send-email-jszhang@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:OFWvR4AVuuSamUZZBEe2K1QeLsdsxTf6fx0dkbyNU0jEUZNhDAG b1eAZe4cZBaFRCI5OYaey5Zmv89vPyalqLDXLx7X4FunBob30sTdHjeBBCO1m1zO5X1RG8g qquVHZcXJG2c/zpyhfKpqaUIC8gCyYpL+Kt8iSa/BD2dtPnM8iDIJl27+cZ27PSNlqctCgN VPeRS3OK+S44ef6m8dLtg== X-UI-Out-Filterresults: notjunk:1;V01:K0:iYx6n1aNfRo=:slRoPKviQlEqSpW8cGnGrW aQ6V59ZnteqjJhXgXBsTUo+j6xhnaQI0uVBRAxFjhmrKGPOl1p3KqQNI7XbBSjuXiJVv/Qlnl XSLe4M0w/vKlNpgREcf0haQQKJuobksoxPDF+lKlX20fifAcamBbbzYzvQqhXdA5UoG+cIayM VNCj/zRqMkdJehY/DM8qLqRRVl3hyvvVvSdTtpsZZWQ3EHbEhuPTKz9K4jqLf3QjZiH/qegLJ GJRquJiK8cNTghlxdFUCztfCuZthT+kdFCy/zEk0FxtSXDG4sRMKKLby2eHQ9ZnB5ZybZPrZ1 eKo2vGP1KmExsF1wxJmTfKpWQXU2WwaapIoCMH+ryUGX13QA/CiCeZ6Uz3TwLyjaiG/mFTWo4 IY+Y0dPSlB1GyaUriX47y9VWh8Eb8w6QKmWRqKIgFCFt7H+nHO9Zrjfnzq4lGKZazSXrlYM+W n81Wl5vShyB6KpwgqKoKUHZEFw1MELBxc7K6QziFWJ5oy++SOI8sN6H1XYU8J36uqzhzT85a/ CPxbKtZ3aU9R5WfMjKzXg3mjKx73bAbn0jiK3Su9z10EbJhDch+/5zBolD2I9JocRc7buXD6P sj0P/wo+yhXrKDJoSPOAQk2E3zAeaWEJXQO68tHkSQybeGm9FK6jkJBFtOKB5IoriVk86shFL iIGiXrbuHp2aEpvBRwALGvAVCBfDJIesN0rKRMcI6mpTyLQgMHp+hUYYUkjiSzL0pGW8dj0TD XNYAORJbdv0ERfMq Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1518 Lines: 41 The hisi_pcie_probe function is incorrectly marked as __init, as Kconfig tells us: WARNING: drivers/pci/host/built-in.o(.data+0x7780): Section mismatch in reference from the variable hisi_pcie_driver to the function .init.text:hisi_pcie_probe() If the probe for this device gets deferred past the point where __init functions are removed, or the device is unbound and then reattached to the driver, we branch into uninitialized memory, which is bad. This removes the __init annotation. Signed-off-by: Arnd Bergmann diff --git a/drivers/pci/host/pcie-hisi.c b/drivers/pci/host/pcie-hisi.c index 35457ecd8e70..163671a4f798 100644 --- a/drivers/pci/host/pcie-hisi.c +++ b/drivers/pci/host/pcie-hisi.c @@ -111,7 +111,7 @@ static struct pcie_host_ops hisi_pcie_host_ops = { .link_up = hisi_pcie_link_up, }; -static int __init hisi_add_pcie_port(struct pcie_port *pp, +static int hisi_add_pcie_port(struct pcie_port *pp, struct platform_device *pdev) { int ret; @@ -139,7 +139,7 @@ static int __init hisi_add_pcie_port(struct pcie_port *pp, return 0; } -static int __init hisi_pcie_probe(struct platform_device *pdev) +static int hisi_pcie_probe(struct platform_device *pdev) { struct hisi_pcie *hisi_pcie; struct pcie_port *pp; -- 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/