From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752942AbbJNJJg (ORCPT ); Wed, 14 Oct 2015 05:09:36 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:55761 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750817AbbJNJJd (ORCPT ); Wed, 14 Oct 2015 05:09:33 -0400 From: Arnd Bergmann To: Ley Foon Tan Cc: Bjorn Helgaas , Russell King , Marc Zyngier , Dinh Nguyen , linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Lorenzo Pieralisi Subject: Re: [PATCH v9 3/6] pci:host: Add Altera PCIe host controller driver Date: Wed, 14 Oct 2015 11:09:16 +0200 Message-ID: <5088538.zEUtS0EC0S@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: References: <1444790492-4051-1-git-send-email-lftan@altera.com> <6044983.WR9BTgsOaA@wuerfel> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:R4rmNur2knkRRkx22ftlWhFuOaHDFKy9ATo4Pj92Vu7EyU6tQ1H Ucu8Mbq1pGwwWFBM7QsnI2TvFgry/FxfY+W3yHSE4I+Nyt2FKi9VfDifu9Qhfjv127Hltor MjB1AEeETB8v7+EN5Ninl4Zi/kfoO09z9yMqYo8ERRYzFJ5w+v+4UkeqJZXr/2jLda741eJ i3CahbWlaTKZAABhR+lTQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:1hvxePPRA6c=:Y6z3enT5VOlujSBSQQY8fJ pYP/zvMWJ7t4SZsC06vs/q+4h9GLUn1kBhhLEUm1kmoP4SbIXYdlFru0Xj8e1I1lzfy/c/1HK AjsL6JqdbvfyQkV7y/4QhLQUYAgzCzNlfUOcqbmmwghy4J+iYF+AkTtFPgo2p32xJ/uthZXr0 HBqrDuFnj0w94HNseeNlVpGHMznEBti5jNE899yo8u4XHUleRqSQwz8f7lVx9DKjjJMflYQta XNiezNJ9CDLORnCGHgFLHIuY9VevG4K1mOe6kL2aU1l9MMhqEst5s9g8Xo//mrvzylJQC/KhP SurqhpwjVhudvHYPzGFyL4ETvE6LRFUfXAXA56Y6Tw+sWlhHDZNimEOgoWo5SUyT+XTXl/dNB AZ6Odlp0eYFq+jYsqrd2nEtD6Rg1/0gkIP3kWBjvYxvxL2Lq/PbMfda5UUV/HmAKD4VJGSFZW AO4UML5mOpdesEOThLfY+CE/ByDZOdY5GVhVkYhG/a5+ryOFPoICZOr9pF9jt4wsa7MoTT8U0 7pFW6ZGJ4NYjsD2sDakd2iXzzEnK0/T/CqVf9v392fd7gOcOLyTy4A8/1S0dMYn100U/lS1Wo Afr30Wioo1qQbVN2ZKHSq54RJaDTsT2Isl76PsDLvAlvjMGM1NM6gbPGZMu+P33gYdp06SKQ0 +QTLITPAO6eDV6zMk0oFTNbCxNgvmQTr41+VUG+9IymMwn/kfclqhZ806T086PJ9/FHRxMuSr NIsG1DOlAuqUySf4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday 14 October 2015 16:32:25 Ley Foon Tan wrote: > On Wed, Oct 14, 2015 at 4:20 PM, Arnd Bergmann wrote: > > On Wednesday 14 October 2015 10:41:29 Ley Foon Tan wrote: > >> +static int altera_pcie_remove(struct platform_device *pdev) > >> +{ > >> + struct altera_pcie *pcie = platform_get_drvdata(pdev); > >> + > >> + altera_pcie_free_irq_domain(pcie); > >> + platform_set_drvdata(pdev, NULL); > >> + return 0; > >> +} > > > > I just noticed this. Does it actually work to unload the module > > and tear down all the pci_dev structures in a safe way? > Good catch. It only can be compiled as builtin-moduley now, so we can > remove this _remove callback function. I think we should change both: make it possible to load the driver dynamically, and remove the altera_pcie_remove function. You can prevent the module from being unloaded if you also remove the module_platform_driver() directive and add a module_init() without a matching module_exit(). Please also add a '.suppress_bind_attrs = true,' flag in the driver struct to prevent manual unbinding. Arnd