* [PATCH v2 1/6] Revert "drivers/tty/serial: make 8250/8250_mtk.c explicitly non-modular" [not found] <1455205297-1021302-1-git-send-email-arnd@arndb.de> @ 2016-02-11 15:41 ` Arnd Bergmann 2016-02-11 16:00 ` Paul Gortmaker [not found] ` <1455205297-1021302-1-git-send-email-arnd-r2nGTMty4D4@public.gmane.org> 2016-02-11 15:41 ` [PATCH v2 5/6] serial: 8250/mediatek: fix building with SERIAL_8250=m Arnd Bergmann 2 siblings, 1 reply; 11+ messages in thread From: Arnd Bergmann @ 2016-02-11 15:41 UTC (permalink / raw) To: Greg Kroah-Hartman, Matthias Brugger Cc: linux-arm-kernel, Arnd Bergmann, Paul Gortmaker, linux-serial, linux-kernel, Jiri Slaby, linux-mediatek This reverts commit d72d391c126e, which tried to remove dead code but left the driver in a useless state when the main 8250 driver is a loadable module. This would normally result in a link error, but as the entire drivers/tty/serial/8250/ directory is only entered when CONFIG_SERIAL_8250 is set, we never notice that the driver does not get built in this configuration. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: d72d391c126e ("drivers/tty/serial: make 8250/8250_mtk.c explicitly non-modular") --- drivers/tty/serial/8250/8250_mtk.c | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c index 0e590b233f03..78883ca64ddd 100644 --- a/drivers/tty/serial/8250/8250_mtk.c +++ b/drivers/tty/serial/8250/8250_mtk.c @@ -16,7 +16,7 @@ */ #include <linux/clk.h> #include <linux/io.h> -#include <linux/init.h> +#include <linux/module.h> #include <linux/of_irq.h> #include <linux/of_platform.h> #include <linux/platform_device.h> @@ -245,6 +245,23 @@ static int mtk8250_probe(struct platform_device *pdev) return 0; } +static int mtk8250_remove(struct platform_device *pdev) +{ + struct mtk8250_data *data = platform_get_drvdata(pdev); + + pm_runtime_get_sync(&pdev->dev); + + serial8250_unregister_port(data->line); + + pm_runtime_disable(&pdev->dev); + pm_runtime_put_noidle(&pdev->dev); + + if (!pm_runtime_status_suspended(&pdev->dev)) + mtk8250_runtime_suspend(&pdev->dev); + + return 0; +} + #ifdef CONFIG_PM_SLEEP static int mtk8250_suspend(struct device *dev) { @@ -275,18 +292,18 @@ static const struct of_device_id mtk8250_of_match[] = { { .compatible = "mediatek,mt6577-uart" }, { /* Sentinel */ } }; +MODULE_DEVICE_TABLE(of, mtk8250_of_match); static struct platform_driver mtk8250_platform_driver = { .driver = { - .name = "mt6577-uart", - .pm = &mtk8250_pm_ops, - .of_match_table = mtk8250_of_match, - .suppress_bind_attrs = true, - + .name = "mt6577-uart", + .pm = &mtk8250_pm_ops, + .of_match_table = mtk8250_of_match, }, .probe = mtk8250_probe, + .remove = mtk8250_remove, }; -builtin_platform_driver(mtk8250_platform_driver); +module_platform_driver(mtk8250_platform_driver); #ifdef CONFIG_SERIAL_8250_CONSOLE static int __init early_mtk8250_setup(struct earlycon_device *device, @@ -302,3 +319,7 @@ static int __init early_mtk8250_setup(struct earlycon_device *device, OF_EARLYCON_DECLARE(mtk8250, "mediatek,mt6577-uart", early_mtk8250_setup); #endif + +MODULE_AUTHOR("Matthias Brugger"); +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("Mediatek 8250 serial port driver"); -- 2.7.0 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/6] Revert "drivers/tty/serial: make 8250/8250_mtk.c explicitly non-modular" 2016-02-11 15:41 ` [PATCH v2 1/6] Revert "drivers/tty/serial: make 8250/8250_mtk.c explicitly non-modular" Arnd Bergmann @ 2016-02-11 16:00 ` Paul Gortmaker [not found] ` <20160211160021.GF28452-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org> 0 siblings, 1 reply; 11+ messages in thread From: Paul Gortmaker @ 2016-02-11 16:00 UTC (permalink / raw) To: Arnd Bergmann Cc: Greg Kroah-Hartman, Matthias Brugger, linux-arm-kernel, linux-serial, linux-kernel, Jiri Slaby, linux-mediatek [[PATCH v2 1/6] Revert "drivers/tty/serial: make 8250/8250_mtk.c explicitly non-modular"] On 11/02/2016 (Thu 16:41) Arnd Bergmann wrote: > This reverts commit d72d391c126e, which tried to remove dead code but > left the driver in a useless state when the main 8250 driver is a Am I misunderstanding something? The commit didn't cause the driver to be in a useless state for 8250=m. But rather isn't that it was a pre-existing condition, independent of the change to 8250_mtk.c to remove the dead code in d72d391c126e? Since the commit did not touch Kconfig or Makefile, I can't see how it could cause some new useless state that did not already exist, and hence the "Fixes:" tag is invalid as well. Paul. -- > loadable module. This would normally result in a link error, but > as the entire drivers/tty/serial/8250/ directory is only entered > when CONFIG_SERIAL_8250 is set, we never notice that the driver does > not get built in this configuration. > > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > Fixes: d72d391c126e ("drivers/tty/serial: make 8250/8250_mtk.c explicitly non-modular") > --- > drivers/tty/serial/8250/8250_mtk.c | 35 ++++++++++++++++++++++++++++------- > 1 file changed, 28 insertions(+), 7 deletions(-) > > diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c > index 0e590b233f03..78883ca64ddd 100644 > --- a/drivers/tty/serial/8250/8250_mtk.c > +++ b/drivers/tty/serial/8250/8250_mtk.c > @@ -16,7 +16,7 @@ > */ > #include <linux/clk.h> > #include <linux/io.h> > -#include <linux/init.h> > +#include <linux/module.h> > #include <linux/of_irq.h> > #include <linux/of_platform.h> > #include <linux/platform_device.h> > @@ -245,6 +245,23 @@ static int mtk8250_probe(struct platform_device *pdev) > return 0; > } > > +static int mtk8250_remove(struct platform_device *pdev) > +{ > + struct mtk8250_data *data = platform_get_drvdata(pdev); > + > + pm_runtime_get_sync(&pdev->dev); > + > + serial8250_unregister_port(data->line); > + > + pm_runtime_disable(&pdev->dev); > + pm_runtime_put_noidle(&pdev->dev); > + > + if (!pm_runtime_status_suspended(&pdev->dev)) > + mtk8250_runtime_suspend(&pdev->dev); > + > + return 0; > +} > + > #ifdef CONFIG_PM_SLEEP > static int mtk8250_suspend(struct device *dev) > { > @@ -275,18 +292,18 @@ static const struct of_device_id mtk8250_of_match[] = { > { .compatible = "mediatek,mt6577-uart" }, > { /* Sentinel */ } > }; > +MODULE_DEVICE_TABLE(of, mtk8250_of_match); > > static struct platform_driver mtk8250_platform_driver = { > .driver = { > - .name = "mt6577-uart", > - .pm = &mtk8250_pm_ops, > - .of_match_table = mtk8250_of_match, > - .suppress_bind_attrs = true, > - > + .name = "mt6577-uart", > + .pm = &mtk8250_pm_ops, > + .of_match_table = mtk8250_of_match, > }, > .probe = mtk8250_probe, > + .remove = mtk8250_remove, > }; > -builtin_platform_driver(mtk8250_platform_driver); > +module_platform_driver(mtk8250_platform_driver); > > #ifdef CONFIG_SERIAL_8250_CONSOLE > static int __init early_mtk8250_setup(struct earlycon_device *device, > @@ -302,3 +319,7 @@ static int __init early_mtk8250_setup(struct earlycon_device *device, > > OF_EARLYCON_DECLARE(mtk8250, "mediatek,mt6577-uart", early_mtk8250_setup); > #endif > + > +MODULE_AUTHOR("Matthias Brugger"); > +MODULE_LICENSE("GPL"); > +MODULE_DESCRIPTION("Mediatek 8250 serial port driver"); > -- > 2.7.0 > ^ permalink raw reply [flat|nested] 11+ messages in thread
[parent not found: <20160211160021.GF28452-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>]
* Re: [PATCH v2 1/6] Revert "drivers/tty/serial: make 8250/8250_mtk.c explicitly non-modular" [not found] ` <20160211160021.GF28452-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org> @ 2016-02-11 16:06 ` Arnd Bergmann 2016-02-11 16:28 ` Paul Gortmaker 0 siblings, 1 reply; 11+ messages in thread From: Arnd Bergmann @ 2016-02-11 16:06 UTC (permalink / raw) To: Paul Gortmaker Cc: Greg Kroah-Hartman, linux-kernel-u79uwXL29TY76Z2rM5mHXA, linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-serial-u79uwXL29TY76Z2rM5mHXA, Jiri Slaby, Matthias Brugger, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r On Thursday 11 February 2016 11:00:22 Paul Gortmaker wrote: > [[PATCH v2 1/6] Revert "drivers/tty/serial: make 8250/8250_mtk.c explicitly non-modular"] On 11/02/2016 (Thu 16:41) Arnd Bergmann wrote: > > > This reverts commit d72d391c126e, which tried to remove dead code but > > left the driver in a useless state when the main 8250 driver is a > > Am I misunderstanding something? The commit didn't cause the driver to > be in a useless state for 8250=m. But rather isn't that it was a > pre-existing condition, independent of the change to 8250_mtk.c to > remove the dead code in d72d391c126e? > > Since the commit did not touch Kconfig or Makefile, I can't see how it > could cause some new useless state that did not already exist, and hence > the "Fixes:" tag is invalid as well. My wording may have been bad here. What I meant to say is that it was broken before the patch, and still broken after the patch. The Fixes tag was meant to just be a reference to the commit I'm reverting. Arnd ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/6] Revert "drivers/tty/serial: make 8250/8250_mtk.c explicitly non-modular" 2016-02-11 16:06 ` Arnd Bergmann @ 2016-02-11 16:28 ` Paul Gortmaker 2016-02-11 16:32 ` Arnd Bergmann 0 siblings, 1 reply; 11+ messages in thread From: Paul Gortmaker @ 2016-02-11 16:28 UTC (permalink / raw) To: Arnd Bergmann Cc: Greg Kroah-Hartman, Matthias Brugger, linux-arm-kernel, linux-serial, linux-kernel, Jiri Slaby, linux-mediatek [Re: [PATCH v2 1/6] Revert "drivers/tty/serial: make 8250/8250_mtk.c explicitly non-modular"] On 11/02/2016 (Thu 17:06) Arnd Bergmann wrote: > On Thursday 11 February 2016 11:00:22 Paul Gortmaker wrote: > > [[PATCH v2 1/6] Revert "drivers/tty/serial: make 8250/8250_mtk.c explicitly non-modular"] On 11/02/2016 (Thu 16:41) Arnd Bergmann wrote: > > > > > This reverts commit d72d391c126e, which tried to remove dead code but > > > left the driver in a useless state when the main 8250 driver is a > > > > Am I misunderstanding something? The commit didn't cause the driver to > > be in a useless state for 8250=m. But rather isn't that it was a > > pre-existing condition, independent of the change to 8250_mtk.c to > > remove the dead code in d72d391c126e? > > > > Since the commit did not touch Kconfig or Makefile, I can't see how it > > could cause some new useless state that did not already exist, and hence > > the "Fixes:" tag is invalid as well. > > My wording may have been bad here. What I meant to say is that it > was broken before the patch, and still broken after the patch. OK, no problem. I just didn't want Greg/Jiri to think I was sending them broken commits. Will need a v3 to get rid of the extra module.h anyway, so that gives you a chance to reword. > > The Fixes tag was meant to just be a reference to the commit I'm > reverting. Yeah, but since the stable people trigger off of that, and since the revert doesn't really fix anything, that is probably best removed. The stable trees don't need the revert. Thanks, Paul. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/6] Revert "drivers/tty/serial: make 8250/8250_mtk.c explicitly non-modular" 2016-02-11 16:28 ` Paul Gortmaker @ 2016-02-11 16:32 ` Arnd Bergmann 0 siblings, 0 replies; 11+ messages in thread From: Arnd Bergmann @ 2016-02-11 16:32 UTC (permalink / raw) To: Paul Gortmaker Cc: Greg Kroah-Hartman, Matthias Brugger, linux-arm-kernel, linux-serial, linux-kernel, Jiri Slaby, linux-mediatek On Thursday 11 February 2016 11:28:52 Paul Gortmaker wrote: > [Re: [PATCH v2 1/6] Revert "drivers/tty/serial: make 8250/8250_mtk.c explicitly non-modular"] On 11/02/2016 (Thu 17:06) Arnd Bergmann wrote: > > > On Thursday 11 February 2016 11:00:22 Paul Gortmaker wrote: > > > [[PATCH v2 1/6] Revert "drivers/tty/serial: make 8250/8250_mtk.c explicitly non-modular"] On 11/02/2016 (Thu 16:41) Arnd Bergmann wrote: > > > > > > > This reverts commit d72d391c126e, which tried to remove dead code but > > > > left the driver in a useless state when the main 8250 driver is a > > > > > > Am I misunderstanding something? The commit didn't cause the driver to > > > be in a useless state for 8250=m. But rather isn't that it was a > > > pre-existing condition, independent of the change to 8250_mtk.c to > > > remove the dead code in d72d391c126e? > > > > > > Since the commit did not touch Kconfig or Makefile, I can't see how it > > > could cause some new useless state that did not already exist, and hence > > > the "Fixes:" tag is invalid as well. > > > > My wording may have been bad here. What I meant to say is that it > > was broken before the patch, and still broken after the patch. > > OK, no problem. I just didn't want Greg/Jiri to think I was sending them > broken commits. Will need a v3 to get rid of the extra module.h > anyway, so that gives you a chance to reword. Sure. > > > > The Fixes tag was meant to just be a reference to the commit I'm > > reverting. > > Yeah, but since the stable people trigger off of that, and since the > revert doesn't really fix anything, that is probably best removed. > The stable trees don't need the revert. Yes, good point. Arnd ^ permalink raw reply [flat|nested] 11+ messages in thread
[parent not found: <1455205297-1021302-1-git-send-email-arnd-r2nGTMty4D4@public.gmane.org>]
* [PATCH v2 3/6] serial: 8250/mediatek: mark PM functions as __maybe_unused [not found] ` <1455205297-1021302-1-git-send-email-arnd-r2nGTMty4D4@public.gmane.org> @ 2016-02-11 15:41 ` Arnd Bergmann 0 siblings, 0 replies; 11+ messages in thread From: Arnd Bergmann @ 2016-02-11 15:41 UTC (permalink / raw) To: Greg Kroah-Hartman Cc: Arnd Bergmann, Sascha Hauer, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Paul Gortmaker, linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-serial-u79uwXL29TY76Z2rM5mHXA, Jiri Slaby, Matthias Brugger, Eddie Huang, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r The mtk8250_runtime_suspend function is not used when runtime PM is disabled, so we get a warning about an unused function: drivers/tty/serial/8250/8250_mtk.c:119:12: error: 'mtk8250_runtime_suspend' defined but not used [-Werror=unused-function] static int mtk8250_runtime_suspend(struct device *dev) This marks all the PM functions as __maybe_unused to avoid the warning, and removes the #ifdef around the PM_SLEEP functions for consistency. Signed-off-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org> Acked-by: Matthias Brugger <matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> --- drivers/tty/serial/8250/8250_mtk.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c index 78883ca64ddd..6ecc6e3e82dc 100644 --- a/drivers/tty/serial/8250/8250_mtk.c +++ b/drivers/tty/serial/8250/8250_mtk.c @@ -116,7 +116,7 @@ mtk8250_set_termios(struct uart_port *port, struct ktermios *termios, tty_termios_encode_baud_rate(termios, baud, baud); } -static int mtk8250_runtime_suspend(struct device *dev) +static int __maybe_unused mtk8250_runtime_suspend(struct device *dev) { struct mtk8250_data *data = dev_get_drvdata(dev); @@ -126,7 +126,7 @@ static int mtk8250_runtime_suspend(struct device *dev) return 0; } -static int mtk8250_runtime_resume(struct device *dev) +static int __maybe_unused mtk8250_runtime_resume(struct device *dev) { struct mtk8250_data *data = dev_get_drvdata(dev); int err; @@ -262,8 +262,7 @@ static int mtk8250_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM_SLEEP -static int mtk8250_suspend(struct device *dev) +static int __maybe_unused mtk8250_suspend(struct device *dev) { struct mtk8250_data *data = dev_get_drvdata(dev); @@ -272,7 +271,7 @@ static int mtk8250_suspend(struct device *dev) return 0; } -static int mtk8250_resume(struct device *dev) +static int __maybe_unused mtk8250_resume(struct device *dev) { struct mtk8250_data *data = dev_get_drvdata(dev); @@ -280,7 +279,6 @@ static int mtk8250_resume(struct device *dev) return 0; } -#endif /* CONFIG_PM_SLEEP */ static const struct dev_pm_ops mtk8250_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(mtk8250_suspend, mtk8250_resume) -- 2.7.0 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 5/6] serial: 8250/mediatek: fix building with SERIAL_8250=m [not found] <1455205297-1021302-1-git-send-email-arnd@arndb.de> 2016-02-11 15:41 ` [PATCH v2 1/6] Revert "drivers/tty/serial: make 8250/8250_mtk.c explicitly non-modular" Arnd Bergmann [not found] ` <1455205297-1021302-1-git-send-email-arnd-r2nGTMty4D4@public.gmane.org> @ 2016-02-11 15:41 ` Arnd Bergmann 2016-02-11 16:04 ` Paul Gortmaker ` (2 more replies) 2 siblings, 3 replies; 11+ messages in thread From: Arnd Bergmann @ 2016-02-11 15:41 UTC (permalink / raw) To: Greg Kroah-Hartman Cc: linux-arm-kernel, Arnd Bergmann, Paul Gortmaker, linux-serial, linux-kernel, Jiri Slaby, Matthias Brugger, Sascha Hauer, Eddie Huang, Masahiro Yamada, linux-mediatek The Mediatek 8250 driver has a 'bool' Kconfig symbol, but that breaks when SERIAL_8250 is a loadable module: drivers/tty/built-in.o: In function `mtk8250_set_termios': :(.text+0x1bee8): undefined reference to `serial8250_do_set_termios' :(.text+0x1bf10): undefined reference to `uart_get_baud_rate' :(.text+0x1c09c): undefined reference to `uart_get_divisor' drivers/tty/built-in.o: In function `mtk8250_do_pm': :(.text+0x1c0d0): undefined reference to `serial8250_do_pm' drivers/tty/built-in.o: In function `mtk8250_probe': :(.text+0x1c2e4): undefined reference to `serial8250_register_8250_port' serial/8250/8250_mtk.c:287:242: error: data definition has no type or storage class [-Werror] serial/8250/8250_mtk.c:287:122: error: 'mtk8250_platform_driver_init' defined but not used [-Werror=unused-function] This changes the symbol to a 'tristate', so the dependency on SERIAL_8250 also works when that is set to 'm'. To actually build the driver, we also need to include <linux/module.h>. Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- drivers/tty/serial/8250/8250_mtk.c | 3 ++- drivers/tty/serial/8250/Kconfig | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c index 6ecc6e3e82dc..55be90c1d85e 100644 --- a/drivers/tty/serial/8250/8250_mtk.c +++ b/drivers/tty/serial/8250/8250_mtk.c @@ -19,6 +19,7 @@ #include <linux/module.h> #include <linux/of_irq.h> #include <linux/of_platform.h> +#include <linux/module.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/serial_8250.h> @@ -303,7 +304,7 @@ static struct platform_driver mtk8250_platform_driver = { }; module_platform_driver(mtk8250_platform_driver); -#ifdef CONFIG_SERIAL_8250_CONSOLE +#if defined(CONFIG_SERIAL_8250_CONSOLE) && !defined(MODULE) static int __init early_mtk8250_setup(struct earlycon_device *device, const char *options) { diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig index 67ad6b0d595b..6ae0fae4f796 100644 --- a/drivers/tty/serial/8250/Kconfig +++ b/drivers/tty/serial/8250/Kconfig @@ -370,7 +370,7 @@ config SERIAL_8250_LPC18XX serial port, say Y to this option. If unsure, say Y. config SERIAL_8250_MT6577 - bool "Mediatek serial port support" + tristate "Mediatek serial port support" depends on SERIAL_8250 && ARCH_MEDIATEK help If you have a Mediatek based board and want to use the -- 2.7.0 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2 5/6] serial: 8250/mediatek: fix building with SERIAL_8250=m 2016-02-11 15:41 ` [PATCH v2 5/6] serial: 8250/mediatek: fix building with SERIAL_8250=m Arnd Bergmann @ 2016-02-11 16:04 ` Paul Gortmaker 2016-02-11 16:31 ` Arnd Bergmann 2016-02-11 23:14 ` Matthias Brugger 2016-02-12 9:43 ` Masahiro Yamada 2 siblings, 1 reply; 11+ messages in thread From: Paul Gortmaker @ 2016-02-11 16:04 UTC (permalink / raw) To: Arnd Bergmann Cc: Greg Kroah-Hartman, Sascha Hauer, linux-kernel, Masahiro Yamada, linux-mediatek, linux-serial, Jiri Slaby, Matthias Brugger, Eddie Huang, linux-arm-kernel [[PATCH v2 5/6] serial: 8250/mediatek: fix building with SERIAL_8250=m] On 11/02/2016 (Thu 16:41) Arnd Bergmann wrote: > The Mediatek 8250 driver has a 'bool' Kconfig symbol, but that > breaks when SERIAL_8250 is a loadable module: > > drivers/tty/built-in.o: In function `mtk8250_set_termios': > :(.text+0x1bee8): undefined reference to `serial8250_do_set_termios' > :(.text+0x1bf10): undefined reference to `uart_get_baud_rate' > :(.text+0x1c09c): undefined reference to `uart_get_divisor' > drivers/tty/built-in.o: In function `mtk8250_do_pm': > :(.text+0x1c0d0): undefined reference to `serial8250_do_pm' > drivers/tty/built-in.o: In function `mtk8250_probe': > :(.text+0x1c2e4): undefined reference to `serial8250_register_8250_port' > serial/8250/8250_mtk.c:287:242: error: data definition has no type or storage class [-Werror] > serial/8250/8250_mtk.c:287:122: error: 'mtk8250_platform_driver_init' defined but not used [-Werror=unused-function] > > This changes the symbol to a 'tristate', so the dependency on > SERIAL_8250 also works when that is set to 'm'. > To actually build the driver, we also need to include <linux/module.h>. > > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > --- > drivers/tty/serial/8250/8250_mtk.c | 3 ++- > drivers/tty/serial/8250/Kconfig | 2 +- > 2 files changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c > index 6ecc6e3e82dc..55be90c1d85e 100644 > --- a/drivers/tty/serial/8250/8250_mtk.c > +++ b/drivers/tty/serial/8250/8250_mtk.c > @@ -19,6 +19,7 @@ > #include <linux/module.h> > #include <linux/of_irq.h> > #include <linux/of_platform.h> > +#include <linux/module.h> Something isn't right here ; I can see module.h three lines up in the context. Guessing your addition of the revert makes this addition no longer required... P. -- > #include <linux/platform_device.h> > #include <linux/pm_runtime.h> > #include <linux/serial_8250.h> > @@ -303,7 +304,7 @@ static struct platform_driver mtk8250_platform_driver = { > }; > module_platform_driver(mtk8250_platform_driver); > > -#ifdef CONFIG_SERIAL_8250_CONSOLE > +#if defined(CONFIG_SERIAL_8250_CONSOLE) && !defined(MODULE) > static int __init early_mtk8250_setup(struct earlycon_device *device, > const char *options) > { > diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig > index 67ad6b0d595b..6ae0fae4f796 100644 > --- a/drivers/tty/serial/8250/Kconfig > +++ b/drivers/tty/serial/8250/Kconfig > @@ -370,7 +370,7 @@ config SERIAL_8250_LPC18XX > serial port, say Y to this option. If unsure, say Y. > > config SERIAL_8250_MT6577 > - bool "Mediatek serial port support" > + tristate "Mediatek serial port support" > depends on SERIAL_8250 && ARCH_MEDIATEK > help > If you have a Mediatek based board and want to use the > -- > 2.7.0 > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 5/6] serial: 8250/mediatek: fix building with SERIAL_8250=m 2016-02-11 16:04 ` Paul Gortmaker @ 2016-02-11 16:31 ` Arnd Bergmann 0 siblings, 0 replies; 11+ messages in thread From: Arnd Bergmann @ 2016-02-11 16:31 UTC (permalink / raw) To: Paul Gortmaker Cc: Greg Kroah-Hartman, Sascha Hauer, linux-kernel, Masahiro Yamada, linux-mediatek, linux-serial, Jiri Slaby, Matthias Brugger, Eddie Huang, linux-arm-kernel On Thursday 11 February 2016 11:04:38 you wrote: > > diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c > > index 6ecc6e3e82dc..55be90c1d85e 100644 > > --- a/drivers/tty/serial/8250/8250_mtk.c > > +++ b/drivers/tty/serial/8250/8250_mtk.c > > @@ -19,6 +19,7 @@ > > #include <linux/module.h> > > #include <linux/of_irq.h> > > #include <linux/of_platform.h> > > +#include <linux/module.h> > > Something isn't right here ; I can see module.h three lines up in the > context. Guessing your addition of the revert makes this addition no > longer required... > Ok, thanks for noticing this. Also, I really should know my alphabet at this point. I saw that the headers were sorted alphabetically and thought I had added it in the right place, which would have worked fine after the revert. Oh well. Arnd ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 5/6] serial: 8250/mediatek: fix building with SERIAL_8250=m 2016-02-11 15:41 ` [PATCH v2 5/6] serial: 8250/mediatek: fix building with SERIAL_8250=m Arnd Bergmann 2016-02-11 16:04 ` Paul Gortmaker @ 2016-02-11 23:14 ` Matthias Brugger 2016-02-12 9:43 ` Masahiro Yamada 2 siblings, 0 replies; 11+ messages in thread From: Matthias Brugger @ 2016-02-11 23:14 UTC (permalink / raw) To: Arnd Bergmann, Greg Kroah-Hartman Cc: linux-arm-kernel, Paul Gortmaker, linux-serial, linux-kernel, Jiri Slaby, Sascha Hauer, Eddie Huang, Masahiro Yamada, linux-mediatek On 11/02/16 16:41, Arnd Bergmann wrote: > The Mediatek 8250 driver has a 'bool' Kconfig symbol, but that > breaks when SERIAL_8250 is a loadable module: > > drivers/tty/built-in.o: In function `mtk8250_set_termios': > :(.text+0x1bee8): undefined reference to `serial8250_do_set_termios' > :(.text+0x1bf10): undefined reference to `uart_get_baud_rate' > :(.text+0x1c09c): undefined reference to `uart_get_divisor' > drivers/tty/built-in.o: In function `mtk8250_do_pm': > :(.text+0x1c0d0): undefined reference to `serial8250_do_pm' > drivers/tty/built-in.o: In function `mtk8250_probe': > :(.text+0x1c2e4): undefined reference to `serial8250_register_8250_port' > serial/8250/8250_mtk.c:287:242: error: data definition has no type or storage class [-Werror] > serial/8250/8250_mtk.c:287:122: error: 'mtk8250_platform_driver_init' defined but not used [-Werror=unused-function] > > This changes the symbol to a 'tristate', so the dependency on > SERIAL_8250 also works when that is set to 'm'. > To actually build the driver, we also need to include <linux/module.h>. > > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > --- Acked-by: Matthias Brugger <matthias.bgg@gmail.com> ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 5/6] serial: 8250/mediatek: fix building with SERIAL_8250=m 2016-02-11 15:41 ` [PATCH v2 5/6] serial: 8250/mediatek: fix building with SERIAL_8250=m Arnd Bergmann 2016-02-11 16:04 ` Paul Gortmaker 2016-02-11 23:14 ` Matthias Brugger @ 2016-02-12 9:43 ` Masahiro Yamada 2 siblings, 0 replies; 11+ messages in thread From: Masahiro Yamada @ 2016-02-12 9:43 UTC (permalink / raw) To: Arnd Bergmann Cc: Greg Kroah-Hartman, linux-arm-kernel, Paul Gortmaker, linux-serial, Linux Kernel Mailing List, Jiri Slaby, Matthias Brugger, Sascha Hauer, Eddie Huang, moderated list:ARM/Mediatek SoC support Hi Arnd, 2016-02-12 0:41 GMT+09:00 Arnd Bergmann <arnd@arndb.de>: > The Mediatek 8250 driver has a 'bool' Kconfig symbol, but that > breaks when SERIAL_8250 is a loadable module: > > drivers/tty/built-in.o: In function `mtk8250_set_termios': > :(.text+0x1bee8): undefined reference to `serial8250_do_set_termios' > :(.text+0x1bf10): undefined reference to `uart_get_baud_rate' > :(.text+0x1c09c): undefined reference to `uart_get_divisor' > drivers/tty/built-in.o: In function `mtk8250_do_pm': > :(.text+0x1c0d0): undefined reference to `serial8250_do_pm' > drivers/tty/built-in.o: In function `mtk8250_probe': > :(.text+0x1c2e4): undefined reference to `serial8250_register_8250_port' > serial/8250/8250_mtk.c:287:242: error: data definition has no type or storage class [-Werror] > serial/8250/8250_mtk.c:287:122: error: 'mtk8250_platform_driver_init' defined but not used [-Werror=unused-function] > > This changes the symbol to a 'tristate', so the dependency on > SERIAL_8250 also works when that is set to 'm'. > To actually build the driver, we also need to include <linux/module.h>. > > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > --- > drivers/tty/serial/8250/8250_mtk.c | 3 ++- > drivers/tty/serial/8250/Kconfig | 2 +- > 2 files changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c > index 6ecc6e3e82dc..55be90c1d85e 100644 > --- a/drivers/tty/serial/8250/8250_mtk.c > +++ b/drivers/tty/serial/8250/8250_mtk.c > @@ -19,6 +19,7 @@ > #include <linux/module.h> > #include <linux/of_irq.h> > #include <linux/of_platform.h> > +#include <linux/module.h> > #include <linux/platform_device.h> > #include <linux/pm_runtime.h> > #include <linux/serial_8250.h> > @@ -303,7 +304,7 @@ static struct platform_driver mtk8250_platform_driver = { > }; > module_platform_driver(mtk8250_platform_driver); > > -#ifdef CONFIG_SERIAL_8250_CONSOLE > +#if defined(CONFIG_SERIAL_8250_CONSOLE) && !defined(MODULE) > static int __init early_mtk8250_setup(struct earlycon_device *device, > const char *options) > { As mentioned in 4/6, this hunk might become unneeded if https://patchwork.kernel.org/patch/8289231/ is accepted. -- Best Regards Masahiro Yamada ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2016-02-12 9:43 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1455205297-1021302-1-git-send-email-arnd@arndb.de>
2016-02-11 15:41 ` [PATCH v2 1/6] Revert "drivers/tty/serial: make 8250/8250_mtk.c explicitly non-modular" Arnd Bergmann
2016-02-11 16:00 ` Paul Gortmaker
[not found] ` <20160211160021.GF28452-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
2016-02-11 16:06 ` Arnd Bergmann
2016-02-11 16:28 ` Paul Gortmaker
2016-02-11 16:32 ` Arnd Bergmann
[not found] ` <1455205297-1021302-1-git-send-email-arnd-r2nGTMty4D4@public.gmane.org>
2016-02-11 15:41 ` [PATCH v2 3/6] serial: 8250/mediatek: mark PM functions as __maybe_unused Arnd Bergmann
2016-02-11 15:41 ` [PATCH v2 5/6] serial: 8250/mediatek: fix building with SERIAL_8250=m Arnd Bergmann
2016-02-11 16:04 ` Paul Gortmaker
2016-02-11 16:31 ` Arnd Bergmann
2016-02-11 23:14 ` Matthias Brugger
2016-02-12 9:43 ` Masahiro Yamada
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox