* [PATCH 0/6] drivers/dma: drop modular code from non modular drivers @ 2015-12-09 23:21 Paul Gortmaker 2015-12-09 23:22 ` [PATCH 6/6] drivers/dma: make tegra20-apb-dma.c explicitly non-modular Paul Gortmaker [not found] ` <1449703322-17762-1-git-send-email-paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org> 0 siblings, 2 replies; 6+ messages in thread From: Paul Gortmaker @ 2015-12-09 23:21 UTC (permalink / raw) To: linux-kernel Cc: Alexandre Courbot, linux-tegra, Stephen Warren, Vinod Koul, Haojian Zhuang, Paul Gortmaker, Laxman Dewangan, Thierry Reding, linux-arm-kernel, dmaengine, Dan Williams, Robert Jarzmik, Daniel Mack 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 is roughly 5k lines of dead code in the kernel due to this. There is a quasi-separate theme, in that some of the drivers were allowing an unbind implicitly since it is enabled by default. But for core DMA infrastructure drivers, this doesn't seem useful -- so we also disable that here which allows us to delete any ".remove" functions from the drivers that would otherwise be called during the (impossible to trigger) module removal. Since ARM covers these files the best of all architectures, each file was build tested for allmodconfig on ARM, which at the same time confirms that the files are not built with "CC [M]" -- hence genuinely non-modular. My testing and the larger patch series in general has been done against the latest linux-next tree. Paul. --- Cc: Alexandre Courbot <gnurou@gmail.com> Cc: Daniel Mack <daniel@zonque.org> Cc: Dan Williams <dan.j.williams@intel.com> Cc: Haojian Zhuang <haojian.zhuang@gmail.com> Cc: Laxman Dewangan <ldewangan@nvidia.com> Cc: Robert Jarzmik <robert.jarzmik@free.fr> Cc: Stephen Warren <swarren@wwwdotorg.org> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Vinod Koul <vinod.koul@intel.com> Cc: dmaengine@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-tegra@vger.kernel.org Paul Gortmaker (6): drivers/dma: make edma.c explicitly non-modular drivers/dma: make mmp_pdma.c explicitly non-modular drivers/dma: make mmp_tdma.c explicitly non-modular drivers/dma: make pxa_dma.c explicitly non-modular drivers/dma: make sh/shdma-*.c explicitly non-modular drivers/dma: make tegra20-apb-dma.c explicitly non-modular drivers/dma/edma.c | 37 ++++++------------------------------- drivers/dma/mmp_pdma.c | 21 ++++----------------- drivers/dma/mmp_tdma.c | 22 +++------------------- drivers/dma/pxa_dma.c | 38 +++----------------------------------- drivers/dma/sh/shdma-base.c | 14 ++------------ drivers/dma/sh/shdma-of.c | 11 +++-------- drivers/dma/tegra20-apb-dma.c | 35 ++++------------------------------- 7 files changed, 25 insertions(+), 153 deletions(-) -- 2.6.1 Paul Gortmaker (6): drivers/dma: make edma.c explicitly non-modular drivers/dma: make mmp_pdma.c explicitly non-modular drivers/dma: make mmp_tdma.c explicitly non-modular drivers/dma: make pxa_dma.c explicitly non-modular drivers/dma: make sh/shdma-*.c explicitly non-modular drivers/dma: make tegra20-apb-dma.c explicitly non-modular drivers/dma/edma.c | 37 ++++++------------------------------- drivers/dma/mmp_pdma.c | 21 ++++----------------- drivers/dma/mmp_tdma.c | 22 +++------------------- drivers/dma/pxa_dma.c | 38 +++----------------------------------- drivers/dma/sh/shdma-base.c | 14 ++------------ drivers/dma/sh/shdma-of.c | 11 +++-------- drivers/dma/tegra20-apb-dma.c | 35 ++++------------------------------- 7 files changed, 25 insertions(+), 153 deletions(-) -- 2.6.1 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 6/6] drivers/dma: make tegra20-apb-dma.c explicitly non-modular 2015-12-09 23:21 [PATCH 0/6] drivers/dma: drop modular code from non modular drivers Paul Gortmaker @ 2015-12-09 23:22 ` Paul Gortmaker [not found] ` <1449703322-17762-1-git-send-email-paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org> 1 sibling, 0 replies; 6+ messages in thread From: Paul Gortmaker @ 2015-12-09 23:22 UTC (permalink / raw) To: linux-kernel Cc: Paul Gortmaker, Laxman Dewangan, Dan Williams, Vinod Koul, Stephen Warren, Thierry Reding, Alexandre Courbot, dmaengine, linux-tegra The Kconfig currently controlling compilation of this code is: drivers/dma/Kconfig:config TEGRA20_APB_DMA drivers/dma/Kconfig: bool "NVIDIA Tegra20 APB DMA support" ...meaning that it currently is not being built as a module by anyone. Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only. We explicitly disallow a driver unbind, since that doesn't have a sensible use case anyway, and it allows us to drop the ".remove" code for non-modular drivers. Since module_platform_driver() uses the same init level priority as builtin_platform_driver() the init ordering remains unchanged with this commit. We don't replace module.h with init.h since the file already has that. Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code. We also delete the MODULE_LICENSE tag etc. since all that information was (or is now) contained at the top of the file in the comments. Cc: Laxman Dewangan <ldewangan@nvidia.com> Cc: Dan Williams <dan.j.williams@intel.com> Cc: Vinod Koul <vinod.koul@intel.com> Cc: Stephen Warren <swarren@wwwdotorg.org> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Alexandre Courbot <gnurou@gmail.com> Cc: dmaengine@vger.kernel.org Cc: linux-tegra@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> --- drivers/dma/tegra20-apb-dma.c | 35 ++++------------------------------- 1 file changed, 4 insertions(+), 31 deletions(-) diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c index 935da8192f59..eee783cee45b 100644 --- a/drivers/dma/tegra20-apb-dma.c +++ b/drivers/dma/tegra20-apb-dma.c @@ -3,6 +3,8 @@ * * Copyright (c) 2012-2013, NVIDIA CORPORATION. All rights reserved. * + * Author: Laxman Dewangan <ldewangan@nvidia.com> + * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. @@ -26,7 +28,6 @@ #include <linux/interrupt.h> #include <linux/io.h> #include <linux/mm.h> -#include <linux/module.h> #include <linux/of.h> #include <linux/of_device.h> #include <linux/of_dma.h> @@ -1309,7 +1310,6 @@ static const struct of_device_id tegra_dma_of_match[] = { }, { }, }; -MODULE_DEVICE_TABLE(of, tegra_dma_of_match); static int tegra_dma_probe(struct platform_device *pdev) { @@ -1488,27 +1488,6 @@ err_irq: return ret; } -static int tegra_dma_remove(struct platform_device *pdev) -{ - struct tegra_dma *tdma = platform_get_drvdata(pdev); - int i; - struct tegra_dma_channel *tdc; - - dma_async_device_unregister(&tdma->dma_dev); - - for (i = 0; i < tdma->chip_data->nr_channels; ++i) { - tdc = &tdma->channels[i]; - free_irq(tdc->irq, tdc); - tasklet_kill(&tdc->tasklet); - } - - pm_runtime_disable(&pdev->dev); - if (!pm_runtime_status_suspended(&pdev->dev)) - tegra_dma_runtime_suspend(&pdev->dev); - - return 0; -} - static int tegra_dma_runtime_suspend(struct device *dev) { struct tegra_dma *tdma = dev_get_drvdata(dev); @@ -1616,15 +1595,9 @@ static struct platform_driver tegra_dmac_driver = { .driver = { .name = "tegra-apbdma", .pm = &tegra_dma_dev_pm_ops, + .suppress_bind_attrs = true, .of_match_table = tegra_dma_of_match, }, .probe = tegra_dma_probe, - .remove = tegra_dma_remove, }; - -module_platform_driver(tegra_dmac_driver); - -MODULE_ALIAS("platform:tegra20-apbdma"); -MODULE_DESCRIPTION("NVIDIA Tegra APB DMA Controller driver"); -MODULE_AUTHOR("Laxman Dewangan <ldewangan@nvidia.com>"); -MODULE_LICENSE("GPL v2"); +builtin_platform_driver(tegra_dmac_driver); -- 2.6.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
[parent not found: <1449703322-17762-1-git-send-email-paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>]
* Re: [PATCH 0/6] drivers/dma: drop modular code from non modular drivers [not found] ` <1449703322-17762-1-git-send-email-paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org> @ 2015-12-09 23:29 ` Arnd Bergmann 2015-12-10 0:17 ` Paul Gortmaker 0 siblings, 1 reply; 6+ messages in thread From: Arnd Bergmann @ 2015-12-09 23:29 UTC (permalink / raw) To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r Cc: Paul Gortmaker, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Alexandre Courbot, linux-tegra-u79uwXL29TY76Z2rM5mHXA, Stephen Warren, Vinod Koul, Haojian Zhuang, Laxman Dewangan, Thierry Reding, dmaengine-u79uwXL29TY76Z2rM5mHXA, Dan Williams, Robert Jarzmik, Daniel Mack On Wednesday 09 December 2015 18:21:56 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 is roughly 5k lines of dead code in the > kernel due to this. > > There is a quasi-separate theme, in that some of the drivers were > allowing an unbind implicitly since it is enabled by default. But > for core DMA infrastructure drivers, this doesn't seem useful -- so > we also disable that here which allows us to delete any ".remove" > functions from the drivers that would otherwise be called during the > (impossible to trigger) module removal. > > Since ARM covers these files the best of all architectures, each > file was build tested for allmodconfig on ARM, which at the same > time confirms that the files are not built with "CC [M]" -- hence > genuinely non-modular. > > My testing and the larger patch series in general has been done > against the latest linux-next tree. > > We are in the process of changing the DMA drivers to a new way of passing the "filter" function around. We can soon build them all as loadable modules again. Arnd ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/6] drivers/dma: drop modular code from non modular drivers 2015-12-09 23:29 ` [PATCH 0/6] drivers/dma: drop modular code from non modular drivers Arnd Bergmann @ 2015-12-10 0:17 ` Paul Gortmaker [not found] ` <20151210001741.GT22885-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Paul Gortmaker @ 2015-12-10 0:17 UTC (permalink / raw) To: Arnd Bergmann Cc: Alexandre Courbot, Stephen Warren, Vinod Koul, linux-kernel, Haojian Zhuang, dmaengine, Laxman Dewangan, Thierry Reding, Daniel Mack, linux-tegra, Dan Williams, Robert Jarzmik, linux-arm-kernel [Re: [PATCH 0/6] drivers/dma: drop modular code from non modular drivers] On 10/12/2015 (Thu 00:29) Arnd Bergmann wrote: > On Wednesday 09 December 2015 18:21:56 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 is roughly 5k lines of dead code in the > > kernel due to this. > > > > There is a quasi-separate theme, in that some of the drivers were > > allowing an unbind implicitly since it is enabled by default. But > > for core DMA infrastructure drivers, this doesn't seem useful -- so > > we also disable that here which allows us to delete any ".remove" > > functions from the drivers that would otherwise be called during the > > (impossible to trigger) module removal. > > > > Since ARM covers these files the best of all architectures, each > > file was build tested for allmodconfig on ARM, which at the same > > time confirms that the files are not built with "CC [M]" -- hence > > genuinely non-modular. > > > > My testing and the larger patch series in general has been done > > against the latest linux-next tree. > > > > > > We are in the process of changing the DMA drivers to a new way of > passing the "filter" function around. We can soon build them > all as loadable modules again. Hi Arnd, Thanks for the feedback -- just to clarify, you are suggesting I hold on the series until I see what emerges in the next merge window? Paul. -- > > Arnd ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <20151210001741.GT22885-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>]
* Re: [PATCH 0/6] drivers/dma: drop modular code from non modular drivers [not found] ` <20151210001741.GT22885-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org> @ 2015-12-10 3:12 ` Vinod Koul 2015-12-10 9:01 ` Arnd Bergmann 1 sibling, 0 replies; 6+ messages in thread From: Vinod Koul @ 2015-12-10 3:12 UTC (permalink / raw) To: Paul Gortmaker Cc: Arnd Bergmann, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Alexandre Courbot, linux-tegra-u79uwXL29TY76Z2rM5mHXA, Stephen Warren, Haojian Zhuang, Laxman Dewangan, Thierry Reding, dmaengine-u79uwXL29TY76Z2rM5mHXA, Dan Williams, Robert Jarzmik, Daniel Mack On Wed, Dec 09, 2015 at 07:17:42PM -0500, Paul Gortmaker wrote: > [Re: [PATCH 0/6] drivers/dma: drop modular code from non modular drivers] On 10/12/2015 (Thu 00:29) Arnd Bergmann wrote: > > > On Wednesday 09 December 2015 18:21:56 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 is roughly 5k lines of dead code in the > > > kernel due to this. > > > > > > There is a quasi-separate theme, in that some of the drivers were > > > allowing an unbind implicitly since it is enabled by default. But > > > for core DMA infrastructure drivers, this doesn't seem useful -- so > > > we also disable that here which allows us to delete any ".remove" > > > functions from the drivers that would otherwise be called during the > > > (impossible to trigger) module removal. > > > > > > Since ARM covers these files the best of all architectures, each > > > file was build tested for allmodconfig on ARM, which at the same > > > time confirms that the files are not built with "CC [M]" -- hence > > > genuinely non-modular. > > > > > > My testing and the larger patch series in general has been done > > > against the latest linux-next tree. > > > > > > > > > > We are in the process of changing the DMA drivers to a new way of > > passing the "filter" function around. We can soon build them > > all as loadable modules again. > > Hi Arnd, > > Thanks for the feedback -- just to clarify, you are suggesting I hold > on the series until I see what emerges in the next merge window? Yes, with this we should be able to have loadable modules for *most* so we may not require this Thanks -- ~Vinod ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/6] drivers/dma: drop modular code from non modular drivers [not found] ` <20151210001741.GT22885-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org> 2015-12-10 3:12 ` Vinod Koul @ 2015-12-10 9:01 ` Arnd Bergmann 1 sibling, 0 replies; 6+ messages in thread From: Arnd Bergmann @ 2015-12-10 9:01 UTC (permalink / raw) To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r Cc: Paul Gortmaker, Alexandre Courbot, Stephen Warren, Vinod Koul, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Haojian Zhuang, dmaengine-u79uwXL29TY76Z2rM5mHXA, Laxman Dewangan, Thierry Reding, Daniel Mack, linux-tegra-u79uwXL29TY76Z2rM5mHXA, Dan Williams, Robert Jarzmik On Wednesday 09 December 2015 19:17:42 Paul Gortmaker wrote: > [Re: [PATCH 0/6] drivers/dma: drop modular code from non modular drivers] On 10/12/2015 (Thu 00:29) Arnd Bergmann wrote: > > > On Wednesday 09 December 2015 18:21:56 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 is roughly 5k lines of dead code in the > > > kernel due to this. > > > > > > There is a quasi-separate theme, in that some of the drivers were > > > allowing an unbind implicitly since it is enabled by default. But > > > for core DMA infrastructure drivers, this doesn't seem useful -- so > > > we also disable that here which allows us to delete any ".remove" > > > functions from the drivers that would otherwise be called during the > > > (impossible to trigger) module removal. > > > > > > Since ARM covers these files the best of all architectures, each > > > file was build tested for allmodconfig on ARM, which at the same > > > time confirms that the files are not built with "CC [M]" -- hence > > > genuinely non-modular. > > > > > > My testing and the larger patch series in general has been done > > > against the latest linux-next tree. > > > > > > > > > > We are in the process of changing the DMA drivers to a new way of > > passing the "filter" function around. We can soon build them > > all as loadable modules again. > > Hi Arnd, > > Thanks for the feedback -- just to clarify, you are suggesting I hold > on the series until I see what emerges in the next merge window? > > It may take a few cycles, but I think we'll get there and should not remove the unload logic from any of these drivers. When we're done, there is no reason for a dmaengine driver to be built-in. Arnd ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-12-10 9:01 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-12-09 23:21 [PATCH 0/6] drivers/dma: drop modular code from non modular drivers Paul Gortmaker 2015-12-09 23:22 ` [PATCH 6/6] drivers/dma: make tegra20-apb-dma.c explicitly non-modular Paul Gortmaker [not found] ` <1449703322-17762-1-git-send-email-paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org> 2015-12-09 23:29 ` [PATCH 0/6] drivers/dma: drop modular code from non modular drivers Arnd Bergmann 2015-12-10 0:17 ` Paul Gortmaker [not found] ` <20151210001741.GT22885-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org> 2015-12-10 3:12 ` Vinod Koul 2015-12-10 9:01 ` Arnd Bergmann
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).