All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 00/22] Improve compile test coverage
@ 2022-01-05  5:17 Damien Le Moal
  2022-01-05  5:17 ` [PATCH v3 01/22] ata: sata_fsl: add compile test support Damien Le Moal
                   ` (21 more replies)
  0 siblings, 22 replies; 24+ messages in thread
From: Damien Le Moal @ 2022-01-05  5:17 UTC (permalink / raw)
  To: linux-ide; +Cc: Hannes Reinecke

Patches 1 to 18 enable the compilation of all ata drivers that can be
compiled with CONFIG_COMPILE_TEST to improve compile test coverage.
The last 4 patches fix compilation and sparse warnings found by enabling
COMPILE_TEST on a x86_64 host.

Changes from v2:
* Change patch 22 to fix read_id() port operation interface instead
* Added review tags

Changes from v1:
* Added another sata_fsl warning fix (patch 20)

Damien Le Moal (22):
  ata: sata_fsl: add compile test support
  ata: ahci_brcm: add compile test support
  ata: ahci_da850: add compile test support
  ata: ahci_dm816: add compile test support
  ata: ahci_st: add compile test support
  ata: ahci_mtk: add compile test support
  ata: ahci_mvebu: add compile test support
  ata: ahci_sunxi: add compile test support
  ata: ahci_tegra: add compile test support
  ata: ahci_xgene: add compile test support
  ata: ahci_seattle: add compile test support
  ata: pata_bk3710: add compile test support
  ata: pata_cs5535: add compile test support
  ata: pata_ftide010: add compile test support
  ata: pata_imx: add compile test support
  ata: pata_pxa: add compile test support
  ata: pata_legacy: add compile test support
  ata: pata_samsung_cf: add compile test support
  ata: sata_fsl: fix scsi host initialization
  ata: sata_fsl: fix cmdhdr_tbl_entry and prde struct definitions
  ata: ahci_xgene: use correct type for port mmio address
  ata: fix read_id() ata port operation interface

 drivers/ata/Kconfig        | 38 +++++++++++++++++++-------------------
 drivers/ata/ahci_brcm.c    |  2 +-
 drivers/ata/ahci_ceva.c    |  5 ++---
 drivers/ata/ahci_xgene.c   |  8 ++++----
 drivers/ata/libata-core.c  |  6 +++---
 drivers/ata/pata_it821x.c  | 23 +++++++++++------------
 drivers/ata/pata_netcell.c |  5 +++--
 drivers/ata/sata_fsl.c     | 23 +++++++++++------------
 include/linux/libata.h     | 16 ++++++++++++++--
 9 files changed, 68 insertions(+), 58 deletions(-)

-- 
2.31.1


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH v3 01/22] ata: sata_fsl: add compile test support
  2022-01-05  5:17 [PATCH v3 00/22] Improve compile test coverage Damien Le Moal
@ 2022-01-05  5:17 ` Damien Le Moal
  2022-01-05  5:17 ` [PATCH v3 02/22] ata: ahci_brcm: " Damien Le Moal
                   ` (20 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Damien Le Moal @ 2022-01-05  5:17 UTC (permalink / raw)
  To: linux-ide; +Cc: Hannes Reinecke

Add dependendy on COMPILE_TEST to allow compile tests with configs that
do not enable FSL_SOC.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
---
 drivers/ata/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 9ebaa3c288dd..80bad7cba631 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -290,7 +290,7 @@ config AHCI_QORIQ
 
 config SATA_FSL
 	tristate "Freescale 3.0Gbps SATA support"
-	depends on FSL_SOC
+	depends on FSL_SOC || COMPILE_TEST
 	select SATA_HOST
 	help
 	  This option enables support for Freescale 3.0Gbps SATA controller.
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 02/22] ata: ahci_brcm: add compile test support
  2022-01-05  5:17 [PATCH v3 00/22] Improve compile test coverage Damien Le Moal
  2022-01-05  5:17 ` [PATCH v3 01/22] ata: sata_fsl: add compile test support Damien Le Moal
@ 2022-01-05  5:17 ` Damien Le Moal
  2022-01-05  5:17 ` [PATCH v3 03/22] ata: ahci_da850: " Damien Le Moal
                   ` (19 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Damien Le Moal @ 2022-01-05  5:17 UTC (permalink / raw)
  To: linux-ide; +Cc: Hannes Reinecke

Add Kconfig dependendy on COMPILE_TEST to allow compile tests with
configs that do not enable ARCH_BRCMSTB, BMIPS_GENERIC or ARCH_BCM_XXX.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
---
 drivers/ata/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 80bad7cba631..3bf38a328851 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -163,7 +163,7 @@ config SATA_AHCI_PLATFORM
 config AHCI_BRCM
 	tristate "Broadcom AHCI SATA support"
 	depends on ARCH_BRCMSTB || BMIPS_GENERIC || ARCH_BCM_NSP || \
-		   ARCH_BCM_63XX
+		   ARCH_BCM_63XX || COMPILE_TEST
 	select SATA_HOST
 	help
 	  This option enables support for the AHCI SATA3 controller found on
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 03/22] ata: ahci_da850: add compile test support
  2022-01-05  5:17 [PATCH v3 00/22] Improve compile test coverage Damien Le Moal
  2022-01-05  5:17 ` [PATCH v3 01/22] ata: sata_fsl: add compile test support Damien Le Moal
  2022-01-05  5:17 ` [PATCH v3 02/22] ata: ahci_brcm: " Damien Le Moal
@ 2022-01-05  5:17 ` Damien Le Moal
  2022-01-05  5:17 ` [PATCH v3 04/22] ata: ahci_dm816: " Damien Le Moal
                   ` (18 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Damien Le Moal @ 2022-01-05  5:17 UTC (permalink / raw)
  To: linux-ide; +Cc: Hannes Reinecke

Add Kconfig dependendy on COMPILE_TEST to allow compile tests with
configs that do not enable ARCH_DAVINCI_DA850.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
---
 drivers/ata/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 3bf38a328851..9f1288fd5482 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -173,7 +173,7 @@ config AHCI_BRCM
 
 config AHCI_DA850
 	tristate "DaVinci DA850 AHCI SATA support"
-	depends on ARCH_DAVINCI_DA850
+	depends on ARCH_DAVINCI_DA850 || COMPILE_TEST
 	select SATA_HOST
 	help
 	  This option enables support for the DaVinci DA850 SoC's
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 04/22] ata: ahci_dm816: add compile test support
  2022-01-05  5:17 [PATCH v3 00/22] Improve compile test coverage Damien Le Moal
                   ` (2 preceding siblings ...)
  2022-01-05  5:17 ` [PATCH v3 03/22] ata: ahci_da850: " Damien Le Moal
@ 2022-01-05  5:17 ` Damien Le Moal
  2022-01-05  5:17 ` [PATCH v3 05/22] ata: ahci_st: " Damien Le Moal
                   ` (17 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Damien Le Moal @ 2022-01-05  5:17 UTC (permalink / raw)
  To: linux-ide; +Cc: Hannes Reinecke

Add Kconfig dependendy on COMPILE_TEST to allow compile tests with
configs that do not enable ARCH_OMAP2PLUS.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
---
 drivers/ata/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 9f1288fd5482..e9f919f17d09 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -183,7 +183,7 @@ config AHCI_DA850
 
 config AHCI_DM816
 	tristate "DaVinci DM816 AHCI SATA support"
-	depends on ARCH_OMAP2PLUS
+	depends on ARCH_OMAP2PLUS || COMPILE_TEST
 	select SATA_HOST
 	help
 	  This option enables support for the DaVinci DM816 SoC's
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 05/22] ata: ahci_st: add compile test support
  2022-01-05  5:17 [PATCH v3 00/22] Improve compile test coverage Damien Le Moal
                   ` (3 preceding siblings ...)
  2022-01-05  5:17 ` [PATCH v3 04/22] ata: ahci_dm816: " Damien Le Moal
@ 2022-01-05  5:17 ` Damien Le Moal
  2022-01-05  5:17 ` [PATCH v3 06/22] ata: ahci_mtk: " Damien Le Moal
                   ` (16 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Damien Le Moal @ 2022-01-05  5:17 UTC (permalink / raw)
  To: linux-ide; +Cc: Hannes Reinecke

Add Kconfig dependendy on COMPILE_TEST to allow compile tests with
configs that do not enable ARCH_STI.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
---
 drivers/ata/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index e9f919f17d09..83fac101744c 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -193,7 +193,7 @@ config AHCI_DM816
 
 config AHCI_ST
 	tristate "ST AHCI SATA support"
-	depends on ARCH_STI
+	depends on ARCH_STI || COMPILE_TEST
 	select SATA_HOST
 	help
 	  This option enables support for ST AHCI SATA controller.
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 06/22] ata: ahci_mtk: add compile test support
  2022-01-05  5:17 [PATCH v3 00/22] Improve compile test coverage Damien Le Moal
                   ` (4 preceding siblings ...)
  2022-01-05  5:17 ` [PATCH v3 05/22] ata: ahci_st: " Damien Le Moal
@ 2022-01-05  5:17 ` Damien Le Moal
  2022-01-05  5:17 ` [PATCH v3 07/22] ata: ahci_mvebu: " Damien Le Moal
                   ` (15 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Damien Le Moal @ 2022-01-05  5:17 UTC (permalink / raw)
  To: linux-ide; +Cc: Hannes Reinecke

Add Kconfig dependendy on COMPILE_TEST to allow compile tests with
configs that do not enable ARCH_MEDIATEK.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
---
 drivers/ata/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 83fac101744c..1545201b9104 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -223,7 +223,7 @@ config AHCI_CEVA
 
 config AHCI_MTK
 	tristate "MediaTek AHCI SATA support"
-	depends on ARCH_MEDIATEK
+	depends on ARCH_MEDIATEK || COMPILE_TEST
 	select MFD_SYSCON
 	select SATA_HOST
 	help
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 07/22] ata: ahci_mvebu: add compile test support
  2022-01-05  5:17 [PATCH v3 00/22] Improve compile test coverage Damien Le Moal
                   ` (5 preceding siblings ...)
  2022-01-05  5:17 ` [PATCH v3 06/22] ata: ahci_mtk: " Damien Le Moal
@ 2022-01-05  5:17 ` Damien Le Moal
  2022-01-05  5:17 ` [PATCH v3 08/22] ata: ahci_sunxi: " Damien Le Moal
                   ` (14 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Damien Le Moal @ 2022-01-05  5:17 UTC (permalink / raw)
  To: linux-ide; +Cc: Hannes Reinecke

Add Kconfig dependendy on COMPILE_TEST to allow compile tests with
configs that do not enable ARCH_MVEBU.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
---
 drivers/ata/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 1545201b9104..237124624db4 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -234,7 +234,7 @@ config AHCI_MTK
 
 config AHCI_MVEBU
 	tristate "Marvell EBU AHCI SATA support"
-	depends on ARCH_MVEBU
+	depends on ARCH_MVEBU || COMPILE_TEST
 	select SATA_HOST
 	help
 	  This option enables support for the Marvebu EBU SoC's
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 08/22] ata: ahci_sunxi: add compile test support
  2022-01-05  5:17 [PATCH v3 00/22] Improve compile test coverage Damien Le Moal
                   ` (6 preceding siblings ...)
  2022-01-05  5:17 ` [PATCH v3 07/22] ata: ahci_mvebu: " Damien Le Moal
@ 2022-01-05  5:17 ` Damien Le Moal
  2022-01-05  5:17 ` [PATCH v3 09/22] ata: ahci_tegra: " Damien Le Moal
                   ` (13 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Damien Le Moal @ 2022-01-05  5:17 UTC (permalink / raw)
  To: linux-ide; +Cc: Hannes Reinecke

Add Kconfig dependendy on COMPILE_TEST to allow compile tests with
configs that do not enable ARCH_SUNXI.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
---
 drivers/ata/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 237124624db4..db3f65ae1ed5 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -253,7 +253,7 @@ config AHCI_OCTEON
 
 config AHCI_SUNXI
 	tristate "Allwinner sunxi AHCI SATA support"
-	depends on ARCH_SUNXI
+	depends on ARCH_SUNXI || COMPILE_TEST
 	select SATA_HOST
 	help
 	  This option enables support for the Allwinner sunxi SoC's
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 09/22] ata: ahci_tegra: add compile test support
  2022-01-05  5:17 [PATCH v3 00/22] Improve compile test coverage Damien Le Moal
                   ` (7 preceding siblings ...)
  2022-01-05  5:17 ` [PATCH v3 08/22] ata: ahci_sunxi: " Damien Le Moal
@ 2022-01-05  5:17 ` Damien Le Moal
  2022-01-05  5:17 ` [PATCH v3 10/22] ata: ahci_xgene: " Damien Le Moal
                   ` (12 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Damien Le Moal @ 2022-01-05  5:17 UTC (permalink / raw)
  To: linux-ide; +Cc: Hannes Reinecke

Add Kconfig dependendy on COMPILE_TEST to allow compile tests with
configs that do not enable ARCH_TEGRA.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
---
 drivers/ata/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index db3f65ae1ed5..9def63c7e9ad 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -263,7 +263,7 @@ config AHCI_SUNXI
 
 config AHCI_TEGRA
 	tristate "NVIDIA Tegra AHCI SATA support"
-	depends on ARCH_TEGRA
+	depends on ARCH_TEGRA || COMPILE_TEST
 	select SATA_HOST
 	help
 	  This option enables support for the NVIDIA Tegra SoC's
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 10/22] ata: ahci_xgene: add compile test support
  2022-01-05  5:17 [PATCH v3 00/22] Improve compile test coverage Damien Le Moal
                   ` (8 preceding siblings ...)
  2022-01-05  5:17 ` [PATCH v3 09/22] ata: ahci_tegra: " Damien Le Moal
@ 2022-01-05  5:17 ` Damien Le Moal
  2022-01-05  5:17 ` [PATCH v3 11/22] ata: ahci_seattle: " Damien Le Moal
                   ` (11 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Damien Le Moal @ 2022-01-05  5:17 UTC (permalink / raw)
  To: linux-ide; +Cc: Hannes Reinecke

Add Kconfig dependendy on COMPILE_TEST to allow compile tests with
configs that do not enable PHY_XGENE.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
---
 drivers/ata/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 9def63c7e9ad..1be6a14e46e1 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -273,7 +273,7 @@ config AHCI_TEGRA
 
 config AHCI_XGENE
 	tristate "APM X-Gene 6.0Gbps AHCI SATA host controller support"
-	depends on PHY_XGENE
+	depends on PHY_XGENE || COMPILE_TEST
 	select SATA_HOST
 	help
 	 This option enables support for APM X-Gene SoC SATA host controller.
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 11/22] ata: ahci_seattle: add compile test support
  2022-01-05  5:17 [PATCH v3 00/22] Improve compile test coverage Damien Le Moal
                   ` (9 preceding siblings ...)
  2022-01-05  5:17 ` [PATCH v3 10/22] ata: ahci_xgene: " Damien Le Moal
@ 2022-01-05  5:17 ` Damien Le Moal
  2022-01-05  5:17 ` [PATCH v3 12/22] ata: pata_bk3710: " Damien Le Moal
                   ` (10 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Damien Le Moal @ 2022-01-05  5:17 UTC (permalink / raw)
  To: linux-ide; +Cc: Hannes Reinecke

Add Kconfig dependendy on COMPILE_TEST to allow compile tests with
configs that do not enable ARCH_SEATTLE.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
---
 drivers/ata/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 1be6a14e46e1..8df5b32e6879 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -311,7 +311,7 @@ config SATA_GEMINI
 
 config SATA_AHCI_SEATTLE
 	tristate "AMD Seattle 6.0Gbps AHCI SATA host controller support"
-	depends on ARCH_SEATTLE
+	depends on ARCH_SEATTLE || COMPILE_TEST
 	select SATA_HOST
 	help
 	 This option enables support for AMD Seattle SATA host controller.
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 12/22] ata: pata_bk3710: add compile test support
  2022-01-05  5:17 [PATCH v3 00/22] Improve compile test coverage Damien Le Moal
                   ` (10 preceding siblings ...)
  2022-01-05  5:17 ` [PATCH v3 11/22] ata: ahci_seattle: " Damien Le Moal
@ 2022-01-05  5:17 ` Damien Le Moal
  2022-01-05  5:17 ` [PATCH v3 13/22] ata: pata_cs5535: " Damien Le Moal
                   ` (9 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Damien Le Moal @ 2022-01-05  5:17 UTC (permalink / raw)
  To: linux-ide; +Cc: Hannes Reinecke

Add Kconfig dependendy on COMPILE_TEST to allow compile tests with
configs that do not enable ARCH_DAVINCI.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
---
 drivers/ata/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 8df5b32e6879..b706a3a64b11 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -616,7 +616,7 @@ config PATA_ATP867X
 
 config PATA_BK3710
 	tristate "Palmchip BK3710 PATA support"
-	depends on ARCH_DAVINCI
+	depends on ARCH_DAVINCI || COMPILE_TEST
 	select PATA_TIMINGS
 	help
 	  This option enables support for the integrated IDE controller on
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 13/22] ata: pata_cs5535: add compile test support
  2022-01-05  5:17 [PATCH v3 00/22] Improve compile test coverage Damien Le Moal
                   ` (11 preceding siblings ...)
  2022-01-05  5:17 ` [PATCH v3 12/22] ata: pata_bk3710: " Damien Le Moal
@ 2022-01-05  5:17 ` Damien Le Moal
  2022-01-05  5:17 ` [PATCH v3 14/22] ata: pata_ftide010: " Damien Le Moal
                   ` (8 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Damien Le Moal @ 2022-01-05  5:17 UTC (permalink / raw)
  To: linux-ide; +Cc: Hannes Reinecke

Add Kconfig dependendy on COMPILE_TEST to allow compile tests with
configs that do not have X86_32 enabled.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
---
 drivers/ata/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index b706a3a64b11..daf57a4e8196 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -654,7 +654,7 @@ config PATA_CS5530
 
 config PATA_CS5535
 	tristate "CS5535 PATA support (Experimental)"
-	depends on PCI && X86_32
+	depends on PCI && (X86_32 || COMPILE_TEST)
 	help
 	  This option enables support for the NatSemi/AMD CS5535
 	  companion chip used with the Geode processor family.
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 14/22] ata: pata_ftide010: add compile test support
  2022-01-05  5:17 [PATCH v3 00/22] Improve compile test coverage Damien Le Moal
                   ` (12 preceding siblings ...)
  2022-01-05  5:17 ` [PATCH v3 13/22] ata: pata_cs5535: " Damien Le Moal
@ 2022-01-05  5:17 ` Damien Le Moal
  2022-01-05  5:17 ` [PATCH v3 15/22] ata: pata_imx: " Damien Le Moal
                   ` (7 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Damien Le Moal @ 2022-01-05  5:17 UTC (permalink / raw)
  To: linux-ide; +Cc: Hannes Reinecke

Add Kconfig dependendy on COMPILE_TEST to allow compile tests with
configs that do not enable ARM.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
---
 drivers/ata/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index daf57a4e8196..1b18de61e8df 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -702,7 +702,7 @@ config PATA_EP93XX
 config PATA_FTIDE010
 	tristate "Faraday Technology FTIDE010 PATA support"
 	depends on OF
-	depends on ARM
+	depends on ARM || COMPILE_TEST
 	depends on SATA_GEMINI
 	help
 	  This option enables support for the Faraday FTIDE010
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 15/22] ata: pata_imx: add compile test support
  2022-01-05  5:17 [PATCH v3 00/22] Improve compile test coverage Damien Le Moal
                   ` (13 preceding siblings ...)
  2022-01-05  5:17 ` [PATCH v3 14/22] ata: pata_ftide010: " Damien Le Moal
@ 2022-01-05  5:17 ` Damien Le Moal
  2022-01-05  5:17 ` [PATCH v3 16/22] ata: pata_pxa: " Damien Le Moal
                   ` (6 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Damien Le Moal @ 2022-01-05  5:17 UTC (permalink / raw)
  To: linux-ide; +Cc: Hannes Reinecke

Add Kconfig dependendy on COMPILE_TEST to allow compile tests with
configs that do not enable ARCH_MXC.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
---
 drivers/ata/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 1b18de61e8df..e4e4460cb1fe 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -765,7 +765,7 @@ config PATA_ICSIDE
 
 config PATA_IMX
 	tristate "PATA support for Freescale iMX"
-	depends on ARCH_MXC
+	depends on ARCH_MXC || COMPILE_TEST
 	select PATA_TIMINGS
 	help
 	  This option enables support for the PATA host available on Freescale
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 16/22] ata: pata_pxa: add compile test support
  2022-01-05  5:17 [PATCH v3 00/22] Improve compile test coverage Damien Le Moal
                   ` (14 preceding siblings ...)
  2022-01-05  5:17 ` [PATCH v3 15/22] ata: pata_imx: " Damien Le Moal
@ 2022-01-05  5:17 ` Damien Le Moal
  2022-01-05  5:17 ` [PATCH v3 17/22] ata: pata_legacy: " Damien Le Moal
                   ` (5 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Damien Le Moal @ 2022-01-05  5:17 UTC (permalink / raw)
  To: linux-ide; +Cc: Hannes Reinecke

Add Kconfig dependendy on COMPILE_TEST to allow compile tests with
configs that do not enable ARCH_PXA.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
---
 drivers/ata/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index e4e4460cb1fe..59576f92c730 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -986,7 +986,7 @@ config PATA_VIA
 
 config PATA_PXA
 	tristate "PXA DMA-capable PATA support"
-	depends on ARCH_PXA
+	depends on ARCH_PXA || COMPILE_TEST
 	help
 	  This option enables support for harddrive attached to PXA CPU's bus.
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 17/22] ata: pata_legacy: add compile test support
  2022-01-05  5:17 [PATCH v3 00/22] Improve compile test coverage Damien Le Moal
                   ` (15 preceding siblings ...)
  2022-01-05  5:17 ` [PATCH v3 16/22] ata: pata_pxa: " Damien Le Moal
@ 2022-01-05  5:17 ` Damien Le Moal
  2022-01-05  5:17 ` [PATCH v3 18/22] ata: pata_samsung_cf: " Damien Le Moal
                   ` (4 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Damien Le Moal @ 2022-01-05  5:17 UTC (permalink / raw)
  To: linux-ide; +Cc: Hannes Reinecke

Add Kconfig dependendy on COMPILE_TEST to allow compile tests with
configs that do not enable ISA.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
---
 drivers/ata/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 59576f92c730..490f0856a271 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -1137,7 +1137,7 @@ config PATA_OF_PLATFORM
 
 config PATA_QDI
 	tristate "QDI VLB PATA support"
-	depends on ISA
+	depends on ISA || COMPILE_TEST
 	select PATA_LEGACY
 	help
 	  Support for QDI 6500 and 6580 PATA controllers on VESA local bus.
@@ -1172,7 +1172,7 @@ config PATA_SAMSUNG_CF
 
 config PATA_WINBOND_VLB
 	tristate "Winbond W83759A VLB PATA support (Experimental)"
-	depends on ISA
+	depends on ISA || COMPILE_TEST
 	select PATA_LEGACY
 	help
 	  Support for the Winbond W83759A controller on Vesa Local Bus
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 18/22] ata: pata_samsung_cf: add compile test support
  2022-01-05  5:17 [PATCH v3 00/22] Improve compile test coverage Damien Le Moal
                   ` (16 preceding siblings ...)
  2022-01-05  5:17 ` [PATCH v3 17/22] ata: pata_legacy: " Damien Le Moal
@ 2022-01-05  5:17 ` Damien Le Moal
  2022-01-05  5:17 ` [PATCH v3 19/22] ata: sata_fsl: fix scsi host initialization Damien Le Moal
                   ` (3 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Damien Le Moal @ 2022-01-05  5:17 UTC (permalink / raw)
  To: linux-ide; +Cc: Hannes Reinecke

Add Kconfig dependendy on COMPILE_TEST to allow compile tests with
configs that do not enable SAMSUNG_DEV_IDE.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
---
 drivers/ata/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 490f0856a271..8af5659a7676 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -1162,7 +1162,7 @@ config PATA_RZ1000
 
 config PATA_SAMSUNG_CF
 	tristate "Samsung SoC PATA support"
-	depends on SAMSUNG_DEV_IDE
+	depends on SAMSUNG_DEV_IDE || COMPILE_TEST
 	select PATA_TIMINGS
 	help
 	  This option enables basic support for Samsung's S3C/S5P board
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 19/22] ata: sata_fsl: fix scsi host initialization
  2022-01-05  5:17 [PATCH v3 00/22] Improve compile test coverage Damien Le Moal
                   ` (17 preceding siblings ...)
  2022-01-05  5:17 ` [PATCH v3 18/22] ata: pata_samsung_cf: " Damien Le Moal
@ 2022-01-05  5:17 ` Damien Le Moal
  2022-01-05  5:17 ` [PATCH v3 20/22] ata: sata_fsl: fix cmdhdr_tbl_entry and prde struct definitions Damien Le Moal
                   ` (2 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Damien Le Moal @ 2022-01-05  5:17 UTC (permalink / raw)
  To: linux-ide; +Cc: Hannes Reinecke

When compiling with W=1, the sata_fsl driver compilation throws the
warning:

drivers/ata/sata_fsl.c:1385:22: error: initialized field overwritten
[-Werror=override-init]
 1385 |         .can_queue = SATA_FSL_QUEUE_DEPTH,

This is due to the driver scsi host template initialization overwriting
the can_queue field that is already set using the ATA_NCQ_SHT()
initializer macro, resulting in the same field being initialized twice
in the host template declaration.

To remove this warning, introduce the ATA_SUBBASE_SHT_QD() and
ATA_NCQ_SHT_QD() initialization macros to allow specifying a queue depth
different from the default ATA_DEF_QUEUE using an additional argument to
the macro.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
---
 drivers/ata/sata_fsl.c |  3 +--
 include/linux/libata.h | 11 +++++++++++
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
index 142e65d5efc7..101d4dd79f62 100644
--- a/drivers/ata/sata_fsl.c
+++ b/drivers/ata/sata_fsl.c
@@ -1380,8 +1380,7 @@ static void sata_fsl_host_stop(struct ata_host *host)
  * scsi mid-layer and libata interface structures
  */
 static struct scsi_host_template sata_fsl_sht = {
-	ATA_NCQ_SHT("sata_fsl"),
-	.can_queue = SATA_FSL_QUEUE_DEPTH,
+	ATA_NCQ_SHT_QD("sata_fsl", SATA_FSL_QUEUE_DEPTH),
 	.sg_tablesize = SATA_FSL_MAX_PRD_USABLE,
 	.dma_boundary = ATA_DMA_BOUNDARY,
 };
diff --git a/include/linux/libata.h b/include/linux/libata.h
index ab2d404cde08..cafe360ab3cd 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -1385,6 +1385,12 @@ extern const struct attribute_group *ata_common_sdev_groups[];
 	.tag_alloc_policy	= BLK_TAG_ALLOC_RR,		\
 	.slave_configure	= ata_scsi_slave_config
 
+#define ATA_SUBBASE_SHT_QD(drv_name, drv_qd)			\
+	__ATA_BASE_SHT(drv_name),				\
+	.can_queue		= drv_qd,			\
+	.tag_alloc_policy	= BLK_TAG_ALLOC_RR,		\
+	.slave_configure	= ata_scsi_slave_config
+
 #define ATA_BASE_SHT(drv_name)					\
 	ATA_SUBBASE_SHT(drv_name),				\
 	.sdev_groups		= ata_common_sdev_groups
@@ -1396,6 +1402,11 @@ extern const struct attribute_group *ata_ncq_sdev_groups[];
 	ATA_SUBBASE_SHT(drv_name),				\
 	.sdev_groups		= ata_ncq_sdev_groups,		\
 	.change_queue_depth	= ata_scsi_change_queue_depth
+
+#define ATA_NCQ_SHT_QD(drv_name, drv_qd)			\
+	ATA_SUBBASE_SHT_QD(drv_name, drv_qd),			\
+	.sdev_groups		= ata_ncq_sdev_groups,		\
+	.change_queue_depth	= ata_scsi_change_queue_depth
 #endif
 
 /*
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 20/22] ata: sata_fsl: fix cmdhdr_tbl_entry and prde struct definitions
  2022-01-05  5:17 [PATCH v3 00/22] Improve compile test coverage Damien Le Moal
                   ` (18 preceding siblings ...)
  2022-01-05  5:17 ` [PATCH v3 19/22] ata: sata_fsl: fix scsi host initialization Damien Le Moal
@ 2022-01-05  5:17 ` Damien Le Moal
  2022-01-05  5:17 ` [PATCH v3 21/22] ata: ahci_xgene: use correct type for port mmio address Damien Le Moal
  2022-01-05  5:17 ` [PATCH v3 22/22] ata: fix read_id() ata port operation interface Damien Le Moal
  21 siblings, 0 replies; 24+ messages in thread
From: Damien Le Moal @ 2022-01-05  5:17 UTC (permalink / raw)
  To: linux-ide; +Cc: Hannes Reinecke

The fields of the cmdhdr_tbl_entry structure all store __le32 values,
and so are the dba and ddc_and_ext fields of the prde structure. Define
these fields using the __le32 type to avoid sparse warnings about
incorrect type in assignment.

The debug message in sata_fsl_setup_cmd_hdr_entry() is changed to
display the correct values of the cmdhdr_tbl_entry fields on big endian
systems.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
---
 drivers/ata/sata_fsl.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
index 101d4dd79f62..da0152116d9f 100644
--- a/drivers/ata/sata_fsl.c
+++ b/drivers/ata/sata_fsl.c
@@ -221,10 +221,10 @@ enum {
  * 4 Dwords per command slot, command header size ==  64 Dwords.
  */
 struct cmdhdr_tbl_entry {
-	u32 cda;
-	u32 prde_fis_len;
-	u32 ttl;
-	u32 desc_info;
+	__le32 cda;
+	__le32 prde_fis_len;
+	__le32 ttl;
+	__le32 desc_info;
 };
 
 /*
@@ -259,9 +259,9 @@ struct command_desc {
  */
 
 struct prde {
-	u32 dba;
+	__le32 dba;
 	u8 fill[2 * 4];
-	u32 ddc_and_ext;
+	__le32 ddc_and_ext;
 };
 
 /*
@@ -426,10 +426,10 @@ static void sata_fsl_setup_cmd_hdr_entry(struct ata_port *ap,
 	pp->cmdslot[tag].desc_info = cpu_to_le32(desc_info | (tag & 0x1F));
 
 	ata_port_dbg(ap, "cda=0x%x, prde_fis_len=0x%x, ttl=0x%x, di=0x%x\n",
-		pp->cmdslot[tag].cda,
-		pp->cmdslot[tag].prde_fis_len,
-		pp->cmdslot[tag].ttl, pp->cmdslot[tag].desc_info);
-
+		     le32_to_cpu(pp->cmdslot[tag].cda),
+		     le32_to_cpu(pp->cmdslot[tag].prde_fis_len),
+		     le32_to_cpu(pp->cmdslot[tag].ttl),
+		     le32_to_cpu(pp->cmdslot[tag].desc_info));
 }
 
 static unsigned int sata_fsl_fill_sg(struct ata_queued_cmd *qc, void *cmd_desc,
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 21/22] ata: ahci_xgene: use correct type for port mmio address
  2022-01-05  5:17 [PATCH v3 00/22] Improve compile test coverage Damien Le Moal
                   ` (19 preceding siblings ...)
  2022-01-05  5:17 ` [PATCH v3 20/22] ata: sata_fsl: fix cmdhdr_tbl_entry and prde struct definitions Damien Le Moal
@ 2022-01-05  5:17 ` Damien Le Moal
  2022-01-05  5:17 ` [PATCH v3 22/22] ata: fix read_id() ata port operation interface Damien Le Moal
  21 siblings, 0 replies; 24+ messages in thread
From: Damien Le Moal @ 2022-01-05  5:17 UTC (permalink / raw)
  To: linux-ide; +Cc: Hannes Reinecke

Sparse complains about an incorrect type for port_mmio pointer
variables:

drivers/ata/ahci_xgene.c:196:41: warning: incorrect type in initializer
(different address spaces)
drivers/ata/ahci_xgene.c:196:41:    expected void *port_mmio
drivers/ata/ahci_xgene.c:196:41:    got void [noderef] __iomem *

Fix this by declaring port_mmio as "void __iomem *" instead of "void *".

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
---
 drivers/ata/ahci_xgene.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c
index 4d8a186ec12a..68ec7e9430b2 100644
--- a/drivers/ata/ahci_xgene.c
+++ b/drivers/ata/ahci_xgene.c
@@ -193,7 +193,7 @@ static unsigned int xgene_ahci_qc_issue(struct ata_queued_cmd *qc)
 	struct xgene_ahci_context *ctx = hpriv->plat_data;
 	int rc = 0;
 	u32 port_fbs;
-	void *port_mmio = ahci_port_base(ap);
+	void __iomem *port_mmio = ahci_port_base(ap);
 
 	/*
 	 * Write the pmp value to PxFBS.DEV
@@ -454,7 +454,7 @@ static int xgene_ahci_pmp_softreset(struct ata_link *link, unsigned int *class,
 	int pmp = sata_srst_pmp(link);
 	struct ata_port *ap = link->ap;
 	u32 rc;
-	void *port_mmio = ahci_port_base(ap);
+	void __iomem *port_mmio = ahci_port_base(ap);
 	u32 port_fbs;
 
 	/*
@@ -499,7 +499,7 @@ static int xgene_ahci_softreset(struct ata_link *link, unsigned int *class,
 	struct ata_port *ap = link->ap;
 	struct ahci_host_priv *hpriv = ap->host->private_data;
 	struct xgene_ahci_context *ctx = hpriv->plat_data;
-	void *port_mmio = ahci_port_base(ap);
+	void __iomem *port_mmio = ahci_port_base(ap);
 	u32 port_fbs;
 	u32 port_fbs_save;
 	u32 retry = 1;
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 22/22] ata: fix read_id() ata port operation interface
  2022-01-05  5:17 [PATCH v3 00/22] Improve compile test coverage Damien Le Moal
                   ` (20 preceding siblings ...)
  2022-01-05  5:17 ` [PATCH v3 21/22] ata: ahci_xgene: use correct type for port mmio address Damien Le Moal
@ 2022-01-05  5:17 ` Damien Le Moal
  2022-01-05  7:31   ` Hannes Reinecke
  21 siblings, 1 reply; 24+ messages in thread
From: Damien Le Moal @ 2022-01-05  5:17 UTC (permalink / raw)
  To: linux-ide; +Cc: Hannes Reinecke

Drivers that need to tweak a device IDENTIFY data implement the
read_id() port operation. The IDENTIFY data buffer is passed as an
argument to the read_id() operation for drivers to use. However, when
this operation is called, the IDENTIFY data is not yet converted to CPU
endian and contains le16 words.

Change the interface of the read_id operation to pass a __le16 * pointer
to the IDENTIFY data buffer to clarify the buffer endianness. Fix the
pata_netcell, pata_it821x, ahci_xgene, ahci_ceva and ahci_brcm drivers
implementation of this operation and modify the code to corretly deal
with identify data words manipulation to avoid sparse warnings such as:

drivers/ata/ahci_xgene.c:262:33: warning: invalid assignment: &=
drivers/ata/ahci_xgene.c:262:33:    left side has type unsigned short
drivers/ata/ahci_xgene.c:262:33:    right side has type restricted __le16

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
---
 drivers/ata/ahci_brcm.c    |  2 +-
 drivers/ata/ahci_ceva.c    |  5 ++---
 drivers/ata/ahci_xgene.c   |  2 +-
 drivers/ata/libata-core.c  |  6 +++---
 drivers/ata/pata_it821x.c  | 23 +++++++++++------------
 drivers/ata/pata_netcell.c |  5 +++--
 include/linux/libata.h     |  5 +++--
 7 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/drivers/ata/ahci_brcm.c b/drivers/ata/ahci_brcm.c
index 6e9c5ade4c2e..ba695338927a 100644
--- a/drivers/ata/ahci_brcm.c
+++ b/drivers/ata/ahci_brcm.c
@@ -246,7 +246,7 @@ static void brcm_sata_init(struct brcm_ahci_priv *priv)
 }
 
 static unsigned int brcm_ahci_read_id(struct ata_device *dev,
-				      struct ata_taskfile *tf, u16 *id)
+				      struct ata_taskfile *tf, __le16 *id)
 {
 	struct ata_port *ap = dev->link->ap;
 	struct ata_host *host = ap->host;
diff --git a/drivers/ata/ahci_ceva.c b/drivers/ata/ahci_ceva.c
index e9c7c07fd84c..acf59f51b356 100644
--- a/drivers/ata/ahci_ceva.c
+++ b/drivers/ata/ahci_ceva.c
@@ -92,9 +92,8 @@ struct ceva_ahci_priv {
 };
 
 static unsigned int ceva_ahci_read_id(struct ata_device *dev,
-					struct ata_taskfile *tf, u16 *id)
+				      struct ata_taskfile *tf, __le16 *id)
 {
-	__le16 *__id = (__le16 *)id;
 	u32 err_mask;
 
 	err_mask = ata_do_dev_read_id(dev, tf, id);
@@ -104,7 +103,7 @@ static unsigned int ceva_ahci_read_id(struct ata_device *dev,
 	 * Since CEVA controller does not support device sleep feature, we
 	 * need to clear DEVSLP (bit 8) in word78 of the IDENTIFY DEVICE data.
 	 */
-	__id[ATA_ID_FEATURE_SUPP] &= cpu_to_le16(~(1 << 8));
+	id[ATA_ID_FEATURE_SUPP] &= cpu_to_le16(~(1 << 8));
 
 	return 0;
 }
diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c
index 68ec7e9430b2..8e206379d699 100644
--- a/drivers/ata/ahci_xgene.c
+++ b/drivers/ata/ahci_xgene.c
@@ -237,7 +237,7 @@ static bool xgene_ahci_is_memram_inited(struct xgene_ahci_context *ctx)
  * does not support DEVSLP.
  */
 static unsigned int xgene_ahci_read_id(struct ata_device *dev,
-				       struct ata_taskfile *tf, u16 *id)
+				       struct ata_taskfile *tf, __le16 *id)
 {
 	u32 err_mask;
 
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 9c2947905d1e..67f88027680a 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -1722,7 +1722,7 @@ static u32 ata_pio_mask_no_iordy(const struct ata_device *adev)
  *	this function is wrapped or replaced by the driver
  */
 unsigned int ata_do_dev_read_id(struct ata_device *dev,
-					struct ata_taskfile *tf, u16 *id)
+				struct ata_taskfile *tf, __le16 *id)
 {
 	return ata_exec_internal(dev, tf, NULL, DMA_FROM_DEVICE,
 				     id, sizeof(id[0]) * ATA_ID_WORDS, 0);
@@ -1795,9 +1795,9 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
 	tf.flags |= ATA_TFLAG_POLLING;
 
 	if (ap->ops->read_id)
-		err_mask = ap->ops->read_id(dev, &tf, id);
+		err_mask = ap->ops->read_id(dev, &tf, (__le16 *)id);
 	else
-		err_mask = ata_do_dev_read_id(dev, &tf, id);
+		err_mask = ata_do_dev_read_id(dev, &tf, (__le16 *)id);
 
 	if (err_mask) {
 		if (err_mask & AC_ERR_NODEV_HINT) {
diff --git a/drivers/ata/pata_it821x.c b/drivers/ata/pata_it821x.c
index b77ef0046dbe..8a5b4e0079ab 100644
--- a/drivers/ata/pata_it821x.c
+++ b/drivers/ata/pata_it821x.c
@@ -537,7 +537,7 @@ static void it821x_dev_config(struct ata_device *adev)
  */
 
 static unsigned int it821x_read_id(struct ata_device *adev,
-					struct ata_taskfile *tf, u16 *id)
+				   struct ata_taskfile *tf, __le16 *id)
 {
 	unsigned int err_mask;
 	unsigned char model_num[ATA_ID_PROD_LEN + 1];
@@ -545,21 +545,20 @@ static unsigned int it821x_read_id(struct ata_device *adev,
 	err_mask = ata_do_dev_read_id(adev, tf, id);
 	if (err_mask)
 		return err_mask;
-	ata_id_c_string(id, model_num, ATA_ID_PROD, sizeof(model_num));
+	ata_id_c_string((u16 *)id, model_num, ATA_ID_PROD, sizeof(model_num));
 
-	id[83] &= ~(1 << 12);	/* Cache flush is firmware handled */
-	id[83] &= ~(1 << 13);	/* Ditto for LBA48 flushes */
-	id[84] &= ~(1 << 6);	/* No FUA */
-	id[85] &= ~(1 << 10);	/* No HPA */
-	id[76] = 0;		/* No NCQ/AN etc */
+	id[83] &= cpu_to_le16(~(1 << 12)); /* Cache flush is firmware handled */
+	id[84] &= cpu_to_le16(~(1 << 6));  /* No FUA */
+	id[85] &= cpu_to_le16(~(1 << 10)); /* No HPA */
+	id[76] = 0;			   /* No NCQ/AN etc */
 
 	if (strstr(model_num, "Integrated Technology Express")) {
 		/* Set feature bits the firmware neglects */
-		id[49] |= 0x0300;	/* LBA, DMA */
-		id[83] &= 0x7FFF;
-		id[83] |= 0x4400;	/* Word 83 is valid and LBA48 */
-		id[86] |= 0x0400;	/* LBA48 on */
-		id[ATA_ID_MAJOR_VER] |= 0x1F;
+		id[49] |= cpu_to_le16(0x0300);	/* LBA, DMA */
+		id[83] &= cpu_to_le16(0x7FFF);
+		id[83] |= cpu_to_le16(0x4400);	/* Word 83 is valid and LBA48 */
+		id[86] |= cpu_to_le16(0x0400);	/* LBA48 on */
+		id[ATA_ID_MAJOR_VER] |= cpu_to_le16(0x1F);
 		/* Clear the serial number because it's different each boot
 		   which breaks validation on resume */
 		memset(&id[ATA_ID_SERNO], 0x20, ATA_ID_SERNO_LEN);
diff --git a/drivers/ata/pata_netcell.c b/drivers/ata/pata_netcell.c
index a7ecc1a204b5..06929e77c491 100644
--- a/drivers/ata/pata_netcell.c
+++ b/drivers/ata/pata_netcell.c
@@ -21,12 +21,13 @@
 /* No PIO or DMA methods needed for this device */
 
 static unsigned int netcell_read_id(struct ata_device *adev,
-					struct ata_taskfile *tf, u16 *id)
+				    struct ata_taskfile *tf, __le16 *id)
 {
 	unsigned int err_mask = ata_do_dev_read_id(adev, tf, id);
+
 	/* Firmware forgets to mark words 85-87 valid */
 	if (err_mask == 0)
-		id[ATA_ID_CSF_DEFAULT] |= 0x4000;
+		id[ATA_ID_CSF_DEFAULT] |= cpu_to_le16(0x4000);
 	return err_mask;
 }
 
diff --git a/include/linux/libata.h b/include/linux/libata.h
index cafe360ab3cd..27b693d87e4b 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -884,7 +884,8 @@ struct ata_port_operations {
 	void (*set_piomode)(struct ata_port *ap, struct ata_device *dev);
 	void (*set_dmamode)(struct ata_port *ap, struct ata_device *dev);
 	int  (*set_mode)(struct ata_link *link, struct ata_device **r_failed_dev);
-	unsigned int (*read_id)(struct ata_device *dev, struct ata_taskfile *tf, u16 *id);
+	unsigned int (*read_id)(struct ata_device *dev, struct ata_taskfile *tf,
+				__le16 *id);
 
 	void (*dev_config)(struct ata_device *dev);
 
@@ -1119,7 +1120,7 @@ extern void ata_id_string(const u16 *id, unsigned char *s,
 extern void ata_id_c_string(const u16 *id, unsigned char *s,
 			    unsigned int ofs, unsigned int len);
 extern unsigned int ata_do_dev_read_id(struct ata_device *dev,
-					struct ata_taskfile *tf, u16 *id);
+				       struct ata_taskfile *tf, __le16 *id);
 extern void ata_qc_complete(struct ata_queued_cmd *qc);
 extern u64 ata_qc_get_active(struct ata_port *ap);
 extern void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd);
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [PATCH v3 22/22] ata: fix read_id() ata port operation interface
  2022-01-05  5:17 ` [PATCH v3 22/22] ata: fix read_id() ata port operation interface Damien Le Moal
@ 2022-01-05  7:31   ` Hannes Reinecke
  0 siblings, 0 replies; 24+ messages in thread
From: Hannes Reinecke @ 2022-01-05  7:31 UTC (permalink / raw)
  To: Damien Le Moal, linux-ide

On 1/5/22 06:17, Damien Le Moal wrote:
> Drivers that need to tweak a device IDENTIFY data implement the
> read_id() port operation. The IDENTIFY data buffer is passed as an
> argument to the read_id() operation for drivers to use. However, when
> this operation is called, the IDENTIFY data is not yet converted to CPU
> endian and contains le16 words.
> 
> Change the interface of the read_id operation to pass a __le16 * pointer
> to the IDENTIFY data buffer to clarify the buffer endianness. Fix the
> pata_netcell, pata_it821x, ahci_xgene, ahci_ceva and ahci_brcm drivers
> implementation of this operation and modify the code to corretly deal
> with identify data words manipulation to avoid sparse warnings such as:
> 
> drivers/ata/ahci_xgene.c:262:33: warning: invalid assignment: &=
> drivers/ata/ahci_xgene.c:262:33:    left side has type unsigned short
> drivers/ata/ahci_xgene.c:262:33:    right side has type restricted __le16
> 
> Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
> ---
>   drivers/ata/ahci_brcm.c    |  2 +-
>   drivers/ata/ahci_ceva.c    |  5 ++---
>   drivers/ata/ahci_xgene.c   |  2 +-
>   drivers/ata/libata-core.c  |  6 +++---
>   drivers/ata/pata_it821x.c  | 23 +++++++++++------------
>   drivers/ata/pata_netcell.c |  5 +++--
>   include/linux/libata.h     |  5 +++--
>   7 files changed, 24 insertions(+), 24 deletions(-)
> Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                Kernel Storage Architect
hare@suse.de                              +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2022-01-05  7:31 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-05  5:17 [PATCH v3 00/22] Improve compile test coverage Damien Le Moal
2022-01-05  5:17 ` [PATCH v3 01/22] ata: sata_fsl: add compile test support Damien Le Moal
2022-01-05  5:17 ` [PATCH v3 02/22] ata: ahci_brcm: " Damien Le Moal
2022-01-05  5:17 ` [PATCH v3 03/22] ata: ahci_da850: " Damien Le Moal
2022-01-05  5:17 ` [PATCH v3 04/22] ata: ahci_dm816: " Damien Le Moal
2022-01-05  5:17 ` [PATCH v3 05/22] ata: ahci_st: " Damien Le Moal
2022-01-05  5:17 ` [PATCH v3 06/22] ata: ahci_mtk: " Damien Le Moal
2022-01-05  5:17 ` [PATCH v3 07/22] ata: ahci_mvebu: " Damien Le Moal
2022-01-05  5:17 ` [PATCH v3 08/22] ata: ahci_sunxi: " Damien Le Moal
2022-01-05  5:17 ` [PATCH v3 09/22] ata: ahci_tegra: " Damien Le Moal
2022-01-05  5:17 ` [PATCH v3 10/22] ata: ahci_xgene: " Damien Le Moal
2022-01-05  5:17 ` [PATCH v3 11/22] ata: ahci_seattle: " Damien Le Moal
2022-01-05  5:17 ` [PATCH v3 12/22] ata: pata_bk3710: " Damien Le Moal
2022-01-05  5:17 ` [PATCH v3 13/22] ata: pata_cs5535: " Damien Le Moal
2022-01-05  5:17 ` [PATCH v3 14/22] ata: pata_ftide010: " Damien Le Moal
2022-01-05  5:17 ` [PATCH v3 15/22] ata: pata_imx: " Damien Le Moal
2022-01-05  5:17 ` [PATCH v3 16/22] ata: pata_pxa: " Damien Le Moal
2022-01-05  5:17 ` [PATCH v3 17/22] ata: pata_legacy: " Damien Le Moal
2022-01-05  5:17 ` [PATCH v3 18/22] ata: pata_samsung_cf: " Damien Le Moal
2022-01-05  5:17 ` [PATCH v3 19/22] ata: sata_fsl: fix scsi host initialization Damien Le Moal
2022-01-05  5:17 ` [PATCH v3 20/22] ata: sata_fsl: fix cmdhdr_tbl_entry and prde struct definitions Damien Le Moal
2022-01-05  5:17 ` [PATCH v3 21/22] ata: ahci_xgene: use correct type for port mmio address Damien Le Moal
2022-01-05  5:17 ` [PATCH v3 22/22] ata: fix read_id() ata port operation interface Damien Le Moal
2022-01-05  7:31   ` Hannes Reinecke

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.