Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932092AbbLNI1T (ORCPT ); Mon, 14 Dec 2015 03:27:19 -0500 Received: from mail-bl2nam02on0075.outbound.protection.outlook.com ([104.47.38.75]:12160 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752872AbbLNI1O (ORCPT ); Mon, 14 Dec 2015 03:27:14 -0500 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=bestguesspass action=none header.from=xilinx.com; Subject: Re: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci* To: Thierry Reding , Geert Uytterhoeven References: <1449970917-12633-1-git-send-email-paul.gortmaker@windriver.com> <20151214082425.GA3766@ulmo.nvidia.com> CC: Paul Gortmaker , "linux-kernel@vger.kernel.org" , Linux-sh list , linux-pci , "Alexandre Courbot" , Pratyush Anand , "Michal Simek" , Kishon Vijay Abraham I , Murali Karicheri , =?UTF-8?Q?S=c3=b6ren_Brinkmann?= , Jason Cooper , "Stephen Warren" , Simon Horman , , "linux-omap@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Thomas Petazzoni , Richard Zhu , , Ley Foon Tan , Bjorn Helgaas , Lucas Stach From: Michal Simek Message-ID: <566E7D4E.8010406@xilinx.com> Date: Mon, 14 Dec 2015 09:26:54 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151214082425.GA3766@ulmo.nvidia.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.0.0.1202-22000.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:149.199.60.83;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(438002)(189002)(164054003)(377454003)(24454002)(199003)(47776003)(77096005)(5008740100001)(86362001)(92566002)(64126003)(59896002)(106466001)(63266004)(36756003)(6806005)(2950100001)(65806001)(87936001)(87266999)(11100500001)(19580395003)(5001960100002)(189998001)(230700001)(80316001)(81156007)(36386004)(65816999)(33656002)(586003)(83506001)(50466002)(54356999)(23746002)(5001770100001)(19580405001)(50986999)(65956001)(76176999)(4001350100001)(1220700001)(1096002)(7059030)(107986001);DIR:OUT;SFP:1101;SCL:1;SRVR:BL2NAM02HT240;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;PTR:unknown-60-83.xilinx.com;MX:1;A:1;LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(8251501001);SRVR:BL2NAM02HT240; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(520078)(5005006)(8121501046)(3002001)(10201501046);SRVR:BL2NAM02HT240;BCL:0;PCL:0;RULEID:;SRVR:BL2NAM02HT240; X-Forefront-PRVS: 0790FB1F33 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2015 08:27:11.0665 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.83];Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2NAM02HT240 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2846 Lines: 62 On 14.12.2015 09:24, Thierry Reding wrote: > On Mon, Dec 14, 2015 at 09:19:30AM +0100, Geert Uytterhoeven wrote: >> Hi Paul, >> >> On Sun, Dec 13, 2015 at 2:41 AM, Paul Gortmaker >> wrote: >>> This series of commits is a slice of a larger project to ensure >>> people don't have dead code for module removal in non-modular >>> drivers. Overall there was roughly 5k lines of dead code in the >>> kernel due to this. So far we've fixed several areas, like tty, >>> x86, net, etc. and we continue to work on other areas. >>> >>> There are several reasons to not use module_init for code that can >>> never be built as a module, but the big ones are: >>> >>> (1) it is easy to accidentally code up unused module_exit and remove code >>> (2) it can be misleading when reading the source, thinking it can be >>> modular when the Makefile and/or Kconfig prohibit it >>> (3) it requires the include of the module.h header file which in turn >>> includes nearly everything else. >>> >>> Here we convert some module_init() calls into device_initcall() and delete >>> any module_exit and remove code that gets orphaned in the process, for >>> an overall net code reduction, which is always welcome. >>> >>> The use of device_initcall ensures that the init function ordering >>> remains unchanged, but one could argue that PCI host code might be more >>> appropriate to be handled under subsys_initcall. Fortunately we can >>> revisit making this extra change at a later date if desired; it does >>> not need to happen now, and we reduce the risk of introducing >>> regressions at this point in time by separating the two changes. >>> >>> Over half of the drivers changed here already explicitly disallowed any >>> unbind operations. For the rest we make them the same, since there is >>> not really any sensible use case to unbind any built-in bus support that >>> I can think of. >> >> Personally, I think all of these should become tristate, so distro kernels >> don't have to build in PCI(e) support for all SoCs. multi_v7_defconfig kernels >> are becoming too big. >> >> That does not preclude making these modules un-unloadable, though. > > Most of these can't be made tristate as-is, because they use symbols > that aren't exported. Many of those symbols can easily be exported, so > its just a matter of getting the respective patches merged. I disagree > with making the modules non-unloadable, though. I have a local branch > with changes necessary to unload the host controller driver and it > works just fine. Great. Send them out. Thanks, Michal -- 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/