From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754600AbbKMDHU (ORCPT ); Thu, 12 Nov 2015 22:07:20 -0500 Received: from lhrrgout.huawei.com ([194.213.3.17]:17949 "EHLO lhrrgout.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754270AbbKMDHS convert rfc822-to-8bit (ORCPT ); Thu, 12 Nov 2015 22:07:18 -0500 From: Gabriele Paoloni To: Arnd Bergmann , "linux-arm-kernel@lists.infradead.org" , "Wangzhou (B)" CC: Jisheng Zhang , "bhelgaas@google.com" , "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] PCI: hisi: fix deferred probing Thread-Topic: [PATCH] PCI: hisi: fix deferred probing Thread-Index: AQHRHUT3uvGxNbPPRkizRWHm2u1q0J6ZRc4w Date: Fri, 13 Nov 2015 03:06:27 +0000 Message-ID: References: <1447329728-1589-1-git-send-email-jszhang@marvell.com> <4417267.EzK5DAjM5p@wuerfel> In-Reply-To: <4417267.EzK5DAjM5p@wuerfel> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.46.190.188] Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020204.564553BC.0072,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 49a53296ad4f9fe806ec8314b9d06113 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks Arnd, this looks ok to me Zhou Wang can you please Ack? > -----Original Message----- > From: linux-kernel-owner@vger.kernel.org [mailto:linux-kernel- > owner@vger.kernel.org] On Behalf Of Arnd Bergmann > Sent: 12 November 2015 12:22 > To: linux-arm-kernel@lists.infradead.org > Cc: Jisheng Zhang; Wangzhou (B); bhelgaas@google.com; linux- > pci@vger.kernel.org; linux-kernel@vger.kernel.org > Subject: [PATCH] PCI: hisi: fix deferred probing > > 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/ From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lhrrgout.huawei.com ([194.213.3.17]:17949 "EHLO lhrrgout.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754270AbbKMDHS convert rfc822-to-8bit (ORCPT ); Thu, 12 Nov 2015 22:07:18 -0500 From: Gabriele Paoloni To: Arnd Bergmann , "linux-arm-kernel@lists.infradead.org" , "Wangzhou (B)" CC: Jisheng Zhang , "bhelgaas@google.com" , "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] PCI: hisi: fix deferred probing Date: Fri, 13 Nov 2015 03:06:27 +0000 Message-ID: References: <1447329728-1589-1-git-send-email-jszhang@marvell.com> <4417267.EzK5DAjM5p@wuerfel> In-Reply-To: <4417267.EzK5DAjM5p@wuerfel> Content-Type: text/plain; charset="Windows-1252" MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org List-ID: Thanks Arnd, this looks ok to me Zhou Wang can you please Ack? > -----Original Message----- > From: linux-kernel-owner@vger.kernel.org [mailto:linux-kernel- > owner@vger.kernel.org] On Behalf Of Arnd Bergmann > Sent: 12 November 2015 12:22 > To: linux-arm-kernel@lists.infradead.org > Cc: Jisheng Zhang; Wangzhou (B); bhelgaas@google.com; linux- > pci@vger.kernel.org; linux-kernel@vger.kernel.org > Subject: [PATCH] PCI: hisi: fix deferred probing > > 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/ From mboxrd@z Thu Jan 1 00:00:00 1970 From: gabriele.paoloni@huawei.com (Gabriele Paoloni) Date: Fri, 13 Nov 2015 03:06:27 +0000 Subject: [PATCH] PCI: hisi: fix deferred probing In-Reply-To: <4417267.EzK5DAjM5p@wuerfel> References: <1447329728-1589-1-git-send-email-jszhang@marvell.com> <4417267.EzK5DAjM5p@wuerfel> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Thanks Arnd, this looks ok to me Zhou Wang can you please Ack? > -----Original Message----- > From: linux-kernel-owner at vger.kernel.org [mailto:linux-kernel- > owner at vger.kernel.org] On Behalf Of Arnd Bergmann > Sent: 12 November 2015 12:22 > To: linux-arm-kernel at lists.infradead.org > Cc: Jisheng Zhang; Wangzhou (B); bhelgaas at google.com; linux- > pci at vger.kernel.org; linux-kernel at vger.kernel.org > Subject: [PATCH] PCI: hisi: fix deferred probing > > 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 at vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/