From patchwork Thu Nov 12 12:21:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 7601551 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 71B889F4F5 for ; Thu, 12 Nov 2015 12:22:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 95078206EB for ; Thu, 12 Nov 2015 12:22:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C629420749 for ; Thu, 12 Nov 2015 12:22:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754499AbbKLMWo (ORCPT ); Thu, 12 Nov 2015 07:22:44 -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 Received: from wuerfel.localnet ([134.3.118.24]) by mrelayeu.kundenserver.de (mreue101) with ESMTPSA (Nemesis) id 0LqlM2-1aasj81Fgo-00eOnJ; Thu, 12 Nov 2015 13:21:40 +0100 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 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-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Zhou Wang Reviewed-by: Hanjun Guo --- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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;