Skip to contentSkip to conversation

spi: Build coverage cleanups and improvements

PATCH In review Mark Brown 2 participants 12 messages Feb 23, 2023 – Mar 6, 2023

Subsystems (3)
lore
Share & tools
lore

Mark Brown

author maintainer
#0 lore raw

cover spi: Build coverage cleanups and improvements

This series opens up build coverage of a bunch of SPI drivers by allowing build under COMPILE_TEST where possible, while also adding appropriate architecture specific dependencies to a couple of drivers that didn't have them so they don't show up in builds when they're not useful. We also have one fix for the dependencies of the s3c24xx driver which was turned up in the process of doing this.

---
Mark Brown (8):
spi: s3c24xx: Fix dependencies when FIQ support is enabled
spi: rockchip: Add architecture dependency
spi: nxp-flexspi: Fix ARCH_LAYERSCAPE dependency
spi: davinci: Make available for build test
spi: fsi: Make available for build test
spi: qcom-qspi: Make available for build test
spi: s3c24xx: Only have compile time references to FIQ when building it
spi: s3c24xx: Allow build test coverage

 drivers/spi/Kconfig       | 15 +++++++++------
 drivers/spi/spi-s3c24xx.c |  4 ++++
 2 files changed, 13 insertions(+), 6 deletions(-)

---
base-commit: 7234d746a8339066313518bfa024fa03f363a55e
change-id: 20230221-spi-arch-deps-dba116a915e9

Best regards,

Signature · 1 line
Mark Brown <[email protected]>
author maintainer
#1 lore raw

PATCH 1/8 spi: s3c24xx: Fix dependencies when FIQ support is enabled

The FIQ APIs aren't exported symbols so can't be used from modules, meaning that the s3c24xx driver can only have FIQ support enabled when it's built in.

---
 drivers/spi/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/Kconfig +1 -1
index 6fb17efb35f0..d1ee27d55a5f 100644
@@ -862,7 +862,7 @@ config SPI_S3C24XX
 
 config SPI_S3C24XX_FIQ
 	bool "S3C24XX driver with FIQ pseudo-DMA"
-	depends on SPI_S3C24XX
+	depends on SPI_S3C24XX=y
 	select FIQ
 	help
 	  Enable FIQ support for the S3C24XX SPI driver to provide pseudo
Signature · 1 line
2.30.2
#2 lore raw

Re: [PATCH 1/8] spi: s3c24xx: Fix dependencies when FIQ support is enabled

Quoted 14 lines · Mark Brown

The FIQ APIs aren't exported symbols so can't be used from modules, meaning that the s3c24xx driver can only have FIQ support enabled when it's built in.

---
 drivers/spi/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/Kconfig +0 -0
index 6fb17efb35f0..d1ee27d55a5f 100644

drivers/spi/Kconfig config SPI_S3C24XX · line 865

Quoted 5 lines
drivers/spi/Kconfig +1 -1
@@ -862,7 +862,7 @@ config SPI_S3C24XX
 
 config SPI_S3C24XX_FIQ
 	bool "S3C24XX driver with FIQ pseudo-DMA"
-	depends on SPI_S3C24XX
+	depends on SPI_S3C24XX=y

The entire SPI_S3C24XX driver is now being dropped (through Arnd's tree) and should be gone by v6.3-rc1:
c9dcd56feb82 ("spi: remove s3c24xx driver")

The patch is not needed.

Best regards,
Krzysztof

author maintainer
#3 lore raw

PATCH 2/8 spi: rockchip: Add architecture dependency

In reply to Mark Brown

If base support for Rockchip SoCs has been disabled then the SPI driver won't be terribly useful, add a dependency on ARCH_ROCKCHIP || COMPILE_TEST to avoid it appearing when not needed.

---
 drivers/spi/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/spi/Kconfig +1 -0
index d1ee27d55a5f..f765b4ce226d 100644
@@ -783,6 +783,7 @@ config SPI_PXA2XX_PCI
 
 config SPI_ROCKCHIP
 	tristate "Rockchip SPI controller driver"
+	depends on ARCH_ROCKCHIP || COMPILE_TEST
 	help
 	  This selects a driver for Rockchip SPI controller.
 
Signature · 1 line
2.30.2
author maintainer
#4 lore raw

PATCH 3/8 spi: nxp-flexspi: Fix ARCH_LAYERSCAPE dependency

In reply to Mark Brown

Currently the NXP Flex SPI driver has a dependency on ARCH_LAYERSCAPE || HAS_IOMEM which means that the dependency is almost always true and the driver available. Really these should be two separate dependencies, with an || COMPILE_TEST dependency for the architecture to ensure build coverage is maintained.

---
 drivers/spi/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/spi/Kconfig +2 -1
index f765b4ce226d..714c9089272a 100644
@@ -406,7 +406,8 @@ config SPI_HISI_SFC_V3XX
 
 config SPI_NXP_FLEXSPI
 	tristate "NXP Flex SPI controller"
-	depends on ARCH_LAYERSCAPE || HAS_IOMEM
+	depends on ARCH_LAYERSCAPE || COMPILE_TEST
+	depends on HAS_IOMEM
 	help
 	  This enables support for the Flex SPI controller in master mode.
 	  Up to four slave devices can be connected on two buses with two
Signature · 1 line
2.30.2
author maintainer
#5 lore raw

PATCH 4/8 spi: davinci: Make available for build test

In reply to Mark Brown

There is no build time dependency on the DaVicni or Keystone architecture support so add an || COMPILE_TEST so we've got better build coverage of the driver.

---
 drivers/spi/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/Kconfig +1 -1
index 714c9089272a..00c6c41d2df7 100644
@@ -276,7 +276,7 @@ config SPI_COLDFIRE_QSPI
 
 config SPI_DAVINCI
 	tristate "Texas Instruments DaVinci/DA8x/OMAP-L/AM1x SoC SPI controller"
-	depends on ARCH_DAVINCI || ARCH_KEYSTONE
+	depends on ARCH_DAVINCI || ARCH_KEYSTONE || COMPILE_TEST
 	select SPI_BITBANG
 	help
 	  SPI master controller for DaVinci/DA8x/OMAP-L/AM1x SPI modules.
Signature · 1 line
2.30.2
author maintainer
#6 lore raw

PATCH 5/8 spi: fsi: Make available for build test

In reply to Mark Brown

There is no build time dependency on the platform support so add an || COMPILE_TEST so we've got better build coverage of the driver.

---
 drivers/spi/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/Kconfig +1 -1
index 00c6c41d2df7..753d006f8217 100644
@@ -357,7 +357,7 @@ config SPI_FALCON
 
 config SPI_FSI
 	tristate "FSI SPI driver"
-	depends on FSI
+	depends on FSI || COMPILE_TEST
 	help
 	  This enables support for the driver for FSI bus attached SPI
 	  controllers.
Signature · 1 line
2.30.2
author maintainer
#7 lore raw

PATCH 6/8 spi: qcom-qspi: Make available for build test

In reply to Mark Brown

There is no build time dependency on the Qualcomm platform support so add an || COMPILE_TEST so we've got better build coverage of the driver.

---
 drivers/spi/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/Kconfig +1 -1
index 753d006f8217..c7ae712ff954 100644
@@ -826,7 +826,7 @@ config SPI_RSPI
 
 config SPI_QCOM_QSPI
 	tristate "QTI QSPI controller"
-	depends on ARCH_QCOM
+	depends on ARCH_QCOM || COMPILE_TEST
 	help
 	  QSPI(Quad SPI) driver for Qualcomm QSPI controller.
 
Signature · 1 line
2.30.2
author maintainer
#8 lore raw

PATCH 7/8 spi: s3c24xx: Only have compile time references to FIQ when building it

In reply to Mark Brown

There is a config option which allows the FIQ code in the s3c24xx driver to be disabled but it does not cover the inclusion of the API header or the variables added to the driver data. Add some ifdefs protecting these so that we can improve build coverage.

---
 drivers/spi/spi-s3c24xx.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/spi/spi-s3c24xx.c +4 -0
index ef25b5e93900..ad13c6004d40 100644
@@ -21,7 +21,9 @@
 #include <linux/spi/s3c24xx-fiq.h>
 #include <linux/module.h>
 
+#ifdef CONFIG_SPI_S3C24XX_FIQ
 #include <asm/fiq.h>
+#endif
 
 #include "spi-s3c24xx-regs.h"
 
@@ -56,10 +58,12 @@ struct s3c24xx_spi {
 	int			 len;
 	int			 count;
 
+#ifdef CONFIG_SPI_S3C24XX_FIQ
 	struct fiq_handler	 fiq_handler;
 	enum spi_fiq_mode	 fiq_mode;
 	unsigned char		 fiq_inuse;
 	unsigned char		 fiq_claimed;
+#endif
 
 	/* data buffers */
 	const unsigned char	*tx;
Signature · 1 line
2.30.2
#9 lore raw

Re: [PATCH 7/8] spi: s3c24xx: Only have compile time references to FIQ when building it

Quoted 8 lines · Mark Brown

There is a config option which allows the FIQ code in the s3c24xx driver to be disabled but it does not cover the inclusion of the API header or the variables added to the driver data. Add some ifdefs protecting these so that we can improve build coverage.

---
 drivers/spi/spi-s3c24xx.c | 4 ++++

Similarly to patch #1 and #8 - the driver is being removed.

Best regards,
Krzysztof

author maintainer
#10 lore raw

PATCH 8/8 spi: s3c24xx: Allow build test coverage

In reply to Mark Brown

Other than the FIQ code the driver has no platform dependencies so we can include it in compile test coverage, the FIQ code will only build on arm.

---
 drivers/spi/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/spi/Kconfig +2 -1
index c7ae712ff954..8e910cb2d21c 100644
@@ -857,7 +857,7 @@ config SPI_QCOM_GENI
 
 config SPI_S3C24XX
 	tristate "Samsung S3C24XX series SPI"
-	depends on ARCH_S3C24XX
+	depends on ARCH_S3C24XX || COMPILE_TEST
 	select SPI_BITBANG
 	help
 	  SPI driver for Samsung S3C24XX series ARM SoCs
@@ -865,6 +865,7 @@ config SPI_S3C24XX
 config SPI_S3C24XX_FIQ
 	bool "S3C24XX driver with FIQ pseudo-DMA"
 	depends on SPI_S3C24XX=y
+	depends on ARM
 	select FIQ
 	help
 	  Enable FIQ support for the S3C24XX SPI driver to provide pseudo
Signature · 1 line
2.30.2
author maintainer
#11 lore raw
In reply to Mark Brown
Quoted 8 lines · Mark Brown

This series opens up build coverage of a bunch of SPI drivers by allowing build under COMPILE_TEST where possible, while also adding appropriate architecture specific dependencies to a couple of drivers that didn't have them so they don't show up in builds when they're not useful. We also have one fix for the dependencies of the s3c24xx driver which was turned up in the process of doing this.

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/8] spi: s3c24xx: Fix dependencies when FIQ support is enabled
(no commit info)
[2/8] spi: rockchip: Add architecture dependency

      commit: 330a200d360f8b140b31d7da8b657da0472484e6
[3/8] spi: nxp-flexspi: Fix ARCH_LAYERSCAPE dependency
      commit: c6b15b2437a10b7b381d32f4a5341f655bfa296f
[4/8] spi: davinci: Make available for build test
      commit: e48d57d7203441b7a32b4275462ebb9296ea3fa0
[5/8] spi: fsi: Make available for build test
      commit: f916c7080d28831493518364492e33fc6a437907
[6/8] spi: qcom-qspi: Make available for build test
      commit: ada850541ad33f621425a382d0810b839cb3169e

[7/8] spi: s3c24xx: Only have compile time references to FIQ when building it
(no commit info)
[8/8] spi: s3c24xx: Allow build test coverage
(no commit info)

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark