This is a re-send of three patches I sent a couple of days ago,
with a revert of two patches that Paul did, taking the code in
the opposite direction now, towards ensuring the drivers actually
work as loadable modules, which helps with 'allmodconfig' build
testing.
I've also added another patch for uniphier, and fixed smaller
related issues that came up in further testing.
Arnd
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(-)
@@ -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");
From: Paul Gortmaker <hidden> Date: 2016-02-11 16:01:20
[[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.
--
quoted hunk
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(-)
@@ -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");
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:
quoted
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
From: Paul Gortmaker <hidden> Date: 2016-02-11 16:29:41
[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:
quoted
[[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:
quoted
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.
--
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:
quoted
On Thursday 11 February 2016 11:00:22 Paul Gortmaker wrote:
quoted
[[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:
quoted
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.
quoted
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.
This reverts commit cafe1ac64023, 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: cafe1ac64023 ("drivers/tty: make serial 8250_ingenic.c explicitly non-modular")
---
drivers/tty/serial/8250/8250_ingenic.c | 28 +++++++++++++++++++++-------
1 file changed, 21 insertions(+), 7 deletions(-)
From: Paul Gortmaker <hidden> Date: 2016-02-11 16:05:21
[[PATCH v2 2/6] Revert "drivers/tty/serial: make 8250/8250_ingenic.c explicitly non-modular"] On 11/02/2016 (Thu 16:41) Arnd Bergmann wrote:
This reverts commit cafe1ac64023, 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.
Same comments apply here as per 1/6.
OTOH, if you were to say that 8250=m and this driver =y is a useless
configuration, and the easiest way to rectify that was to convert it
to tristate, and hence we revert cafe1ac64023 to regain some modular
code -- that would make more sense to me.
P.
--
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@arndb.de>
Acked-by: Matthias Brugger <matthias.bgg@gmail.com>
---
drivers/tty/serial/8250/8250_mtk.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
The newly added uniphier serial port driver fails to build as
a loadable module when the base 8250 driver is built-in and
its console support enabled:
ERROR: "early_serial8250_setup" [drivers/tty/serial/8250/8250_uniphier.ko] undefined!
This changes the driver to only provide the early console support
if it is built-in itself as well.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/tty/serial/8250/8250_uniphier.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Hi Arnd,
2016-02-12 0:41 GMT+09:00 Arnd Bergmann [off-list ref]:
quoted hunk
The newly added uniphier serial port driver fails to build as
a loadable module when the base 8250 driver is built-in and
its console support enabled:
ERROR: "early_serial8250_setup" [drivers/tty/serial/8250/8250_uniphier.ko] undefined!
This changes the driver to only provide the early console support
if it is built-in itself as well.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/tty/serial/8250/8250_uniphier.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
I noticed commit 2eaa790989e03900298ad24f77f1086dbbc1aebd
revived this link error, but I am not happy with seeing
this patch again and again.
Can you check this patch?
https://patchwork.kernel.org/patch/8289231/
--
Best Regards
Masahiro Yamada
I noticed commit 2eaa790989e03900298ad24f77f1086dbbc1aebd
revived this link error, but I am not happy with seeing
this patch again and again.
Can you check this patch?
https://patchwork.kernel.org/patch/8289231/
Yes, I think your patch is nicer than mine. Let's see what the others
think, then I can resend my remaining patches on top of yours.
Arnd
I noticed commit 2eaa790989e03900298ad24f77f1086dbbc1aebd
revived this link error, but I am not happy with seeing
this patch again and again.
Can you check this patch?
https://patchwork.kernel.org/patch/8289231/
Yes, I think your patch is nicer than mine. Let's see what the others
think, then I can resend my remaining patches on top of yours.
OK, thanks!
I noticed some typos, so I've posted v2.
(no change in code-diff).
--
Best Regards
Masahiro Yamada
I noticed commit 2eaa790989e03900298ad24f77f1086dbbc1aebd
revived this link error, but I am not happy with seeing
this patch again and again.
Can you check this patch?
https://patchwork.kernel.org/patch/8289231/
Yes, I think your patch is nicer than mine. Let's see what the others
think, then I can resend my remaining patches on top of yours.
As Peter pointed out, my patch would not work without CONFIG_OF.
I can not suggest any other alternative,
so I am OK with this patch.
Unfortunately, the "tty-linus" branch is getting dirty with
apply, revert, apply again.
--
Best Regards
Masahiro Yamada
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(-)
@@ -370,7 +370,7 @@ config SERIAL_8250_LPC18XXserialport,sayYtothisoption.Ifunsure,sayY.configSERIAL_8250_MT6577-bool"Mediatek serial port support"+tristate"Mediatek serial port support"depends onSERIAL_8250&&ARCH_MEDIATEKhelpIfyouhaveaMediatekbasedboardandwanttousethe
From: Paul Gortmaker <hidden> Date: 2016-02-11 16:10:39
[[PATCH v2 5/6] serial: 8250/mediatek: fix building with SERIAL_8250=m] On 11/02/2016 (Thu 16:41) Arnd Bergmann wrote:
quoted hunk
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(-)
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.
--
@@ -370,7 +370,7 @@ config SERIAL_8250_LPC18XXserialport,sayYtothisoption.Ifunsure,sayY.configSERIAL_8250_MT6577-bool"Mediatek serial port support"+tristate"Mediatek serial port support"depends onSERIAL_8250&&ARCH_MEDIATEKhelpIfyouhaveaMediatekbasedboardandwanttousethe
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
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>
---
Hi Arnd,
2016-02-12 0:41 GMT+09:00 Arnd Bergmann [off-list ref]:
quoted hunk
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(-)
The Ingenic 8250 driver has a 'bool' Kconfig symbol, but that
breaks when SERIAL_8250 is a loadable module:
drivers/tty/built-in.o: In function `ingenic_uart_probe':
8250_ingenic.c:(.text+0x1c1a0): undefined reference to `serial8250_register_8250_port'
This changes the symbol to a 'tristate', plus a dependency on
SERIAL_8250, which makes it work again. Unlike the other
soc-specific backends, this one has no dependency on an
architecture or a platform. I'm adding a dependency on
MIPS || COMPILE_TEST as well here, to avoid showing the driver
on architectures that are not interested in it.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/tty/serial/8250/8250_ingenic.c | 2 +-
drivers/tty/serial/8250/Kconfig | 7 ++++---
2 files changed, 5 insertions(+), 4 deletions(-)
@@ -384,9 +384,10 @@ config SERIAL_8250_UNIPHIERserialports,sayYtothisoption.Ifunsure,sayN.configSERIAL_8250_INGENIC-bool"Support for Ingenic SoC serial ports"-depends onOF_FLATTREE-selectLIBFDT+tristate"Support for Ingenic SoC serial ports"+depends onSERIAL_8250+depends on(OF_FLATTREE&&SERIAL_8250_CONSOLE)||!SERIAL_8250_CONSOLE+depends onMIPS||COMPILE_TESThelpIfyouhaveasystemusinganIngenicSoCandwishtomakeuseofitsUARTs,sayYtothisoption.Ifunsure,sayN.
Hi Arnd,
2016-02-12 0:41 GMT+09:00 Arnd Bergmann [off-list ref]:
quoted hunk
The Ingenic 8250 driver has a 'bool' Kconfig symbol, but that
breaks when SERIAL_8250 is a loadable module:
drivers/tty/built-in.o: In function `ingenic_uart_probe':
8250_ingenic.c:(.text+0x1c1a0): undefined reference to `serial8250_register_8250_port'
This changes the symbol to a 'tristate', plus a dependency on
SERIAL_8250, which makes it work again. Unlike the other
soc-specific backends, this one has no dependency on an
architecture or a platform. I'm adding a dependency on
MIPS || COMPILE_TEST as well here, to avoid showing the driver
on architectures that are not interested in it.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/tty/serial/8250/8250_ingenic.c | 2 +-
drivers/tty/serial/8250/Kconfig | 7 ++++---
2 files changed, 5 insertions(+), 4 deletions(-)