Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752155AbbEFJ0O (ORCPT ); Wed, 6 May 2015 05:26:14 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:63067 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750779AbbEFJ0J (ORCPT ); Wed, 6 May 2015 05:26:09 -0400 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Cc: Gabriel Fernandez , Bjorn Helgaas , Mark Rutland , Andrew Lunn , "kernel@stlinux.com" , Viresh Kumar , Liviu Dudau , Sachin Kamat , "linux-kernel@vger.kernel.org" , Tanmay Inamdar , Lee Jones , Mauro Carvalho Chehab , Phil Edworthy , Russell King , Pawel Moll , Jingoo Han , Kishon Vijay Abraham I , Muralidharan Karicheri , "linux-pci@vger.kernel.org" , Thierry Reding , "devicetree@vger.kernel.org" , Ian Campbell , Kumar Gala , Joe Perches , Rob Herring , Fabrice Gasnier , Maxime Coquelin , Srinivas Kandagatla , Patrice Chotard , Gabriel FERNANDEZ , Minghuan Lian , Greg KH , Tejun Heo , Andrew Morton , "David S. Miller" , Lucas Stach Subject: Re: [PATCH v3 3/5] PCI: st: Provide support for the sti PCIe controller Date: Wed, 06 May 2015 11:24:58 +0200 Message-ID: <2236679.A9NfANRyhD@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: References: <1428657168-12495-1-git-send-email-gabriel.fernandez@linaro.org> <20150505221646.GE24643@google.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:WW1ZUoonblAZkZbtvWgx11yQeqM1C+AypWFnvB291nvffSw9bPw wmM34fBoqd6GJseKkSxdQVFpAjf9sMG0vLSe+gZ+AkAAc07+7ny/9Yj/nC2tbxnKhMvdayh D5bEwijSWMYcQCbAOOXJ0WrrGP8TCdCccwoT/yxp3nTTGja0H1LmquN1aZzIQIqPuO1NDWo ZtsTxjSBLfSlFXdRdA+Jg== X-UI-Out-Filterresults: notjunk:1; Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1549 Lines: 42 On Wednesday 06 May 2015 11:14:25 Gabriel Fernandez wrote: > > >> +static int __init pcie_init(void) > >> +{ > >> + return platform_driver_probe(&st_pcie_driver, st_pcie_probe); > >> +} > >> +device_initcall(pcie_init); > > > > Can you use module_platform_driver_probe() or module_init() here? > > > > Yes we can use module_init() here. > > By the way if figure out i removed __init attribute on st_pcie_probe() > in previous version to follow Arnd's remark. > But st_pcie_probe calls hook_fault_code() that has __init attribute. > So I think we need to keep __init for probe routine ? > Also, we have to restrict bind/unbind with "suppress_bind_attrs" in > platform_driver structure. > This is the main reason to not allow module unload/reload. > > If you are ok i will send a v4 ? > If you mark the probe function as __init, you have to use module_platform_driver_probe() or platform_driver_probe() instead, to prevent the probe function from being deferred. Calling hook_fault_code() also means you need to prevent module unloading, by providing only a module_init but not a module_exit function, so module_platform_driver_probe() also won't work. It may be a good idea to work on improving the hook_fault_code() infrastructure to make it more usable with loadable device drivers. Arnd -- 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/