Skip to contentSkip to conversation

tty: serial: make SERIAL_SPRD depends on ARM or ARM64

PATCH In review Chunyan Zhang 3 participants 6 messages Mar 24, 2020 – Mar 25, 2020 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tty: serial: make SERIAL_SPRD depends on ARM or ARM64

From: Chunyan Zhang <[email protected]>

kbuild-test reported an error:

config: mips-randconfig-a001-20200321 ...

Quoted 1 line
Quoted 1 line

drivers/tty/serial/sprd_serial.c:1175: undefined reference

to `clk_set_parent'

Because some mips Kconfig-s select CONFIG_HAVE_CLK but not CONFIG_COMMON_CLK, so it's probably that clk_set_parent is missed for those configs.

To fix this error, this patch adds dependence on ARM || ARM64 for SERIAL_SPRD.

Fixes 7ba87cfec71a ("tty: serial: make SERIAL_SPRD not depend on ARCH_SPRD")
---
 drivers/tty/serial/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/tty/serial/Kconfig +1 -0
index b43dce785a58..417f7e45a3f8 100644
@@ -1444,6 +1444,7 @@ config SERIAL_MEN_Z135
 config SERIAL_SPRD
 	tristate "Support for Spreadtrum serial"
 	select SERIAL_CORE
+	depends on ARM || ARM64 || COMPILE_TEST
 	help
 	  This enables the driver for the Spreadtrum's serial.
 
Signature · 1 line
2.20.1
#1 lore raw
Quoted 5 lines · Chunyan Zhang

From: Chunyan Zhang <[email protected]>

kbuild-test reported an error:

config: mips-randconfig-a001-20200321 ...

Quoted 8 lines
Quoted 1 line
Quoted 1 line

drivers/tty/serial/sprd_serial.c:1175: undefined reference

to `clk_set_parent'

Because some mips Kconfig-s select CONFIG_HAVE_CLK but not CONFIG_COMMON_CLK, so it's probably that clk_set_parent is missed for those configs.

To fix this error, this patch adds dependence on ARM || ARM64 for SERIAL_SPRD.

From the above, isn't the real dependency COMMON_CLOCK?

Mark.

Quoted 23 lines
Fixes 7ba87cfec71a ("tty: serial: make SERIAL_SPRD not depend on ARCH_SPRD")
---
 drivers/tty/serial/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/tty/serial/Kconfig +1 -0
index b43dce785a58..417f7e45a3f8 100644
@@ -1444,6 +1444,7 @@ config SERIAL_MEN_Z135
 config SERIAL_SPRD
 	tristate "Support for Spreadtrum serial"
 	select SERIAL_CORE
+	depends on ARM || ARM64 || COMPILE_TEST
 	help
 	  This enables the driver for the Spreadtrum's serial.
 
Signature · 1 line
2.20.1
#2 lore raw

Hi Mark, Greg,

Pleas see my answer below.

Quoted 10 lines · Mark Rutland
Quoted 8 lines · Chunyan Zhang

From: Chunyan Zhang <[email protected]>

kbuild-test reported an error:

config: mips-randconfig-a001-20200321 ...

Quoted 1 line
Quoted 1 line

drivers/tty/serial/sprd_serial.c:1175: undefined reference

to `clk_set_parent'

Quoted 7 lines
Quoted 5 lines

Because some mips Kconfig-s select CONFIG_HAVE_CLK but not CONFIG_COMMON_CLK, so it's probably that clk_set_parent is missed for those configs.

To fix this error, this patch adds dependence on ARM || ARM64 for SERIAL_SPRD.

From the above, isn't the real dependency COMMON_CLOCK?

Some arch can implement its own clock APIs, for example AR7 [1].

The sprd serial driver is used on ARM and ARM64 platforms only for now, which uses clock functions provided by COMMON_CLK, but it has the possibility of being used on other architecture platforms, that was my thought.

I should revise this commit message to:
"
Because some mips Kconfig-s select CONFIG_HAVE_CLK but not define clk_set_parent which is used by the sprd serial driver.
...
"

Does it make sense?

Thanks,
Chunyan

[1] https://elixir.bootlin.com/linux/v5.5.11/source/arch/mips/ar7/clock.c#L475

Quoted 26 lines

Mark.

Quoted 23 lines
Fixes 7ba87cfec71a ("tty: serial: make SERIAL_SPRD not depend on ARCH_SPRD")
---
 drivers/tty/serial/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/tty/serial/Kconfig +1 -1
index b43dce785a58..417f7e45a3f8 100644
@@ -1444,6 +1444,7 @@ config SERIAL_MEN_Z135
 config SERIAL_SPRD
      tristate "Support for Spreadtrum serial"
      select SERIAL_CORE
+     depends on ARM || ARM64 || COMPILE_TEST
      help
        This enables the driver for the Spreadtrum's serial.
 
--

2.20.1

#3 lore raw
Quoted 18 lines · Chunyan Zhang

Hi Mark, Greg,

Pleas see my answer below.

Quoted 13 lines · Mark Rutland
Quoted 11 lines · Chunyan Zhang

From: Chunyan Zhang <[email protected]>

kbuild-test reported an error:

config: mips-randconfig-a001-20200321 ...

Quoted 1 line
Quoted 1 line

drivers/tty/serial/sprd_serial.c:1175: undefined reference

to `clk_set_parent'

Because some mips Kconfig-s select CONFIG_HAVE_CLK but not CONFIG_COMMON_CLK, so it's probably that clk_set_parent is missed for those configs.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

To fix this error, this patch adds dependence on ARM || ARM64 for SERIAL_SPRD.

From the above, isn't the real dependency COMMON_CLOCK?

Some arch can implement its own clock APIs, for example AR7 [1].

That's fine, then they can not select this option.

Quoted 5 lines

The sprd serial driver is used on ARM and ARM64 platforms only for now, which uses clock functions provided by COMMON_CLK, but it has the possibility of being used on other architecture platforms, that was my thought.

Quoted 8 lines

I should revise this commit message to:
"
Because some mips Kconfig-s select CONFIG_HAVE_CLK but not define clk_set_parent which is used by the sprd serial driver.
...
"

Does it make sense?

The arch is not the issue here, the clock framework is, so properly depend on that, not an arbitrary CPU type.

thanks,

greg k-h

#4 lore raw
Quoted 41 lines · Greg Kroah-Hartman
Quoted 18 lines · Chunyan Zhang

Hi Mark, Greg,

Pleas see my answer below.

Quoted 13 lines · Mark Rutland
Quoted 11 lines · Chunyan Zhang

From: Chunyan Zhang <[email protected]>

kbuild-test reported an error:

config: mips-randconfig-a001-20200321 ...

Quoted 1 line
Quoted 1 line

drivers/tty/serial/sprd_serial.c:1175: undefined reference

to `clk_set_parent'

Because some mips Kconfig-s select CONFIG_HAVE_CLK but not CONFIG_COMMON_CLK, so it's probably that clk_set_parent is missed for those configs.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

To fix this error, this patch adds dependence on ARM || ARM64 for SERIAL_SPRD.

From the above, isn't the real dependency COMMON_CLOCK?

Some arch can implement its own clock APIs, for example AR7 [1].

That's fine, then they can not select this option.

Quoted 12 lines

The sprd serial driver is used on ARM and ARM64 platforms only for now, which uses clock functions provided by COMMON_CLK, but it has the possibility of being used on other architecture platforms, that was my thought.

I should revise this commit message to:
"
Because some mips Kconfig-s select CONFIG_HAVE_CLK but not define clk_set_parent which is used by the sprd serial driver.
...
"

Quoted 4 lines
Quoted 1 line

Does it make sense?

The arch is not the issue here, the clock framework is, so properly depend on that, not an arbitrary CPU type.

Ok, I will address it.

Thanks,
Chunyan

#5 lore raw
In reply to Chunyan Zhang
Quoted 26 lines · Chunyan Zhang

From: Chunyan Zhang <[email protected]>

kbuild-test reported an error:

config: mips-randconfig-a001-20200321 ...

Quoted 1 line
Quoted 1 line

drivers/tty/serial/sprd_serial.c:1175: undefined reference

to `clk_set_parent'

Because some mips Kconfig-s select CONFIG_HAVE_CLK but not CONFIG_COMMON_CLK, so it's probably that clk_set_parent is missed for those configs.

To fix this error, this patch adds dependence on ARM || ARM64 for SERIAL_SPRD.

Fixes 7ba87cfec71a ("tty: serial: make SERIAL_SPRD not depend on ARCH_SPRD")
---
 drivers/tty/serial/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/tty/serial/Kconfig +0 -0
index b43dce785a58..417f7e45a3f8 100644

drivers/tty/serial/Kconfig config SERIAL_MEN_Z135 · line 1447

Quoted 4 lines
drivers/tty/serial/Kconfig +1 -0
@@ -1444,6 +1444,7 @@ config SERIAL_MEN_Z135
 config SERIAL_SPRD
 	tristate "Support for Spreadtrum serial"
 	select SERIAL_CORE
+	depends on ARM || ARM64 || COMPILE_TEST

Why not just depend on the proper CLK config option instead?

thanks,

greg k-h