platform/kernel/linux-starfive.git
2 years agoata: pata_pxa: add compile test support
Damien Le Moal [Tue, 4 Jan 2022 06:35:57 +0000 (15:35 +0900)]
ata: pata_pxa: add compile test support

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>
2 years agoata: pata_imx: add compile test support
Damien Le Moal [Tue, 4 Jan 2022 06:31:34 +0000 (15:31 +0900)]
ata: pata_imx: add compile test support

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>
2 years agoata: pata_ftide010: add compile test support
Damien Le Moal [Tue, 4 Jan 2022 06:24:52 +0000 (15:24 +0900)]
ata: pata_ftide010: add compile test support

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>
2 years agoata: pata_cs5535: add compile test support
Damien Le Moal [Tue, 4 Jan 2022 06:19:30 +0000 (15:19 +0900)]
ata: pata_cs5535: add compile test support

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

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
2 years agoata: pata_octeon_cf: remove redundant val variable
Minghao Chi [Tue, 4 Jan 2022 11:25:45 +0000 (11:25 +0000)]
ata: pata_octeon_cf: remove redundant val variable

Return value from DIV_ROUND_UP() directly instead
of taking this in another redundant variable.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Signed-off-by: CGEL ZTE <cgel.zte@gmail.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: fix read_id() ata port operation interface
Damien Le Moal [Tue, 4 Jan 2022 08:54:18 +0000 (17:54 +0900)]
ata: fix read_id() ata port operation interface

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>
Reviewed-by: Hannes Reinecke <hare@suse.de>
2 years agoata: ahci_xgene: use correct type for port mmio address
Damien Le Moal [Tue, 4 Jan 2022 08:49:54 +0000 (17:49 +0900)]
ata: ahci_xgene: use correct type for port mmio address

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>
2 years agoata: sata_fsl: fix cmdhdr_tbl_entry and prde struct definitions
Damien Le Moal [Tue, 4 Jan 2022 10:04:49 +0000 (19:04 +0900)]
ata: sata_fsl: fix cmdhdr_tbl_entry and prde struct definitions

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>
2 years agoata: sata_fsl: fix scsi host initialization
Damien Le Moal [Tue, 4 Jan 2022 07:14:46 +0000 (16:14 +0900)]
ata: sata_fsl: fix scsi host initialization

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>
2 years agoata: pata_bk3710: add compile test support
Damien Le Moal [Tue, 4 Jan 2022 06:17:42 +0000 (15:17 +0900)]
ata: pata_bk3710: add compile test support

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>
2 years agoata: ahci_seattle: add compile test support
Damien Le Moal [Tue, 4 Jan 2022 06:11:15 +0000 (15:11 +0900)]
ata: ahci_seattle: add compile test support

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>
2 years agoata: ahci_xgene: add compile test support
Damien Le Moal [Tue, 4 Jan 2022 06:09:23 +0000 (15:09 +0900)]
ata: ahci_xgene: add compile test support

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>
2 years agoata: ahci_tegra: add compile test support
Damien Le Moal [Tue, 4 Jan 2022 06:08:01 +0000 (15:08 +0900)]
ata: ahci_tegra: add compile test support

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>
2 years agoata: ahci_sunxi: add compile test support
Damien Le Moal [Tue, 4 Jan 2022 06:06:12 +0000 (15:06 +0900)]
ata: ahci_sunxi: add compile test support

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>
2 years agoata: ahci_mvebu: add compile test support
Damien Le Moal [Tue, 4 Jan 2022 06:01:01 +0000 (15:01 +0900)]
ata: ahci_mvebu: add compile test support

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>
2 years agoata: ahci_mtk: add compile test support
Damien Le Moal [Tue, 4 Jan 2022 05:59:00 +0000 (14:59 +0900)]
ata: ahci_mtk: add compile test support

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>
2 years agoata: ahci_dm816: add compile test support
Damien Le Moal [Tue, 4 Jan 2022 05:53:49 +0000 (14:53 +0900)]
ata: ahci_dm816: add compile test support

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>
2 years agoata: ahci_da850: add compile test support
Damien Le Moal [Tue, 4 Jan 2022 05:51:43 +0000 (14:51 +0900)]
ata: ahci_da850: add compile test support

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>
2 years agoata: ahci_brcm: add compile test support
Damien Le Moal [Tue, 4 Jan 2022 05:48:17 +0000 (14:48 +0900)]
ata: ahci_brcm: add compile test support

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>
2 years agoata: sata_fsl: add compile test support
Damien Le Moal [Tue, 4 Jan 2022 04:46:18 +0000 (13:46 +0900)]
ata: sata_fsl: add compile test support

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>
2 years agoata: sata_dwc_460ex: Remove debug compile options
Hannes Reinecke [Tue, 21 Dec 2021 07:21:31 +0000 (08:21 +0100)]
ata: sata_dwc_460ex: Remove debug compile options

Driver has been converted to dynamic debugging, so the compile-time
options don't have any functionality left.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: sata_dwc_460ex: remove 'check_status' argument
Hannes Reinecke [Tue, 21 Dec 2021 07:21:30 +0000 (08:21 +0100)]
ata: sata_dwc_460ex: remove 'check_status' argument

Remove the 'check_status' argument from sata_dwc_qc_complete() and
sata_dwc_dma_xfer_complete() as it has no functionality.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: sata_dwc_460ex: drop DEBUG_NCQ
Hannes Reinecke [Tue, 21 Dec 2021 07:21:29 +0000 (08:21 +0100)]
ata: sata_dwc_460ex: drop DEBUG_NCQ

Obsolete, and has been converted to tracepoints.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: libata-scsi: rework ata_dump_status to avoid using pr_cont()
Hannes Reinecke [Tue, 21 Dec 2021 07:21:28 +0000 (08:21 +0100)]
ata: libata-scsi: rework ata_dump_status to avoid using pr_cont()

pr_cont() has the problem that individual calls will be disrupted
under high load, causing each call to end up on a single line and
thereby mangling the output.
So rework ata_dump_status() to have just one call to ata_port_warn()
and avoid this problem.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: pata_hpt366: convert pr_warn() calls
Hannes Reinecke [Tue, 21 Dec 2021 07:21:27 +0000 (08:21 +0100)]
ata: pata_hpt366: convert pr_warn() calls

Convert pr_warn() calls to ata_dev_warn()

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: sata_gemini: convert pr_err() calls
Hannes Reinecke [Tue, 21 Dec 2021 07:21:26 +0000 (08:21 +0100)]
ata: sata_gemini: convert pr_err() calls

Convert pr_err() calls to dev_err()

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: pata_hpt3x2n: convert pr_XXX() calls
Hannes Reinecke [Tue, 21 Dec 2021 07:21:25 +0000 (08:21 +0100)]
ata: pata_hpt3x2n: convert pr_XXX() calls

Convert pr_XXX() calls to structured logging.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: pata_octeon_cf: Replace pr_XXX() calls with structured logging
Hannes Reinecke [Tue, 21 Dec 2021 07:21:24 +0000 (08:21 +0100)]
ata: pata_octeon_cf: Replace pr_XXX() calls with structured logging

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: pata_hpt37x: convert pr_XXX() calls
Hannes Reinecke [Tue, 21 Dec 2021 07:21:23 +0000 (08:21 +0100)]
ata: pata_hpt37x: convert pr_XXX() calls

Convert pr_XXX() calls to structured logging.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: sata_mv: convert remaining printk() to structured logging
Hannes Reinecke [Tue, 21 Dec 2021 07:21:22 +0000 (08:21 +0100)]
ata: sata_mv: convert remaining printk() to structured logging

Refactor the .reset_hc() callback and convert the remaining printk()
calls to structured logging.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: sata_sx4: convert printk() calls
Hannes Reinecke [Tue, 21 Dec 2021 07:21:21 +0000 (08:21 +0100)]
ata: sata_sx4: convert printk() calls

Convert printk() calls to structured logging.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: pata_sil680: convert printk() calls
Hannes Reinecke [Tue, 21 Dec 2021 07:21:20 +0000 (08:21 +0100)]
ata: pata_sil680: convert printk() calls

Convert printk() calls to structured logging.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: pata_serverworks: convert printk() calls
Hannes Reinecke [Tue, 21 Dec 2021 07:21:19 +0000 (08:21 +0100)]
ata: pata_serverworks: convert printk() calls

Convert printk() calls to structured logging.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: pata_rz1000: convert printk() calls
Hannes Reinecke [Tue, 21 Dec 2021 07:21:18 +0000 (08:21 +0100)]
ata: pata_rz1000: convert printk() calls

Convert printk() calls to structured logging.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: pata_marvell: convert printk() calls
Hannes Reinecke [Tue, 21 Dec 2021 07:21:17 +0000 (08:21 +0100)]
ata: pata_marvell: convert printk() calls

Convert the printk() call to structured logging and
drop the pointless PCI bar debug messages.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: pata_it821x: convert printk() calls
Hannes Reinecke [Tue, 21 Dec 2021 07:21:16 +0000 (08:21 +0100)]
ata: pata_it821x: convert printk() calls

Convert printk() calls to structured logging.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: pata_cypress: convert printk() calls
Hannes Reinecke [Tue, 21 Dec 2021 07:21:15 +0000 (08:21 +0100)]
ata: pata_cypress: convert printk() calls

Convert printk() calls to structured logging.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: pata_cs5536: convert printk() calls
Hannes Reinecke [Tue, 21 Dec 2021 07:21:14 +0000 (08:21 +0100)]
ata: pata_cs5536: convert printk() calls

Convert printk() calls to structured logging.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: pata_cs5520: convert printk() calls
Hannes Reinecke [Tue, 21 Dec 2021 07:21:13 +0000 (08:21 +0100)]
ata: pata_cs5520: convert printk() calls

Convert printk() calls to structured logging.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: pata_cmd64x: convert printk() calls
Hannes Reinecke [Tue, 21 Dec 2021 07:21:12 +0000 (08:21 +0100)]
ata: pata_cmd64x: convert printk() calls

Convert printk() calls to structured logging.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: pata_cmd640: convert printk() calls
Hannes Reinecke [Tue, 21 Dec 2021 07:21:11 +0000 (08:21 +0100)]
ata: pata_cmd640: convert printk() calls

Convert printk() calls to structured logging.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: pata_atp867x: convert printk() calls
Hannes Reinecke [Tue, 21 Dec 2021 07:21:10 +0000 (08:21 +0100)]
ata: pata_atp867x: convert printk() calls

Convert printk() calls to structured logging.

[Damien]
Fix ata_port_dbg() format in atp867x_check_ports() to avoid compile
warnings with 32-bits arch.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: libata: remove debug compilation switches
Hannes Reinecke [Tue, 21 Dec 2021 07:21:09 +0000 (08:21 +0100)]
ata: libata: remove debug compilation switches

Unused now, so remove and drop any references to them.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: libata: remove 'new' ata message handling
Hannes Reinecke [Tue, 21 Dec 2021 07:21:08 +0000 (08:21 +0100)]
ata: libata: remove 'new' ata message handling

Remove the remaining bits for the 'new' ata message handling.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: libata: drop ata_msg_drv()
Hannes Reinecke [Tue, 21 Dec 2021 07:21:07 +0000 (08:21 +0100)]
ata: libata: drop ata_msg_drv()

Callers are already protected by ata_dev_print_info(), so no need
to have an additional configuration parameter here.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: libata: drop ata_msg_info()
Hannes Reinecke [Tue, 21 Dec 2021 07:21:06 +0000 (08:21 +0100)]
ata: libata: drop ata_msg_info()

Convert the sole caller to ata_dev_dbg() and remove the definition.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: libata: drop ata_msg_probe()
Hannes Reinecke [Tue, 21 Dec 2021 07:21:05 +0000 (08:21 +0100)]
ata: libata: drop ata_msg_probe()

All callsites have been converted to dynamic debugging.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: libata: drop ata_msg_warn()
Hannes Reinecke [Tue, 21 Dec 2021 07:21:04 +0000 (08:21 +0100)]
ata: libata: drop ata_msg_warn()

The WARN level was always enabled, so drop ata_msg_warn().

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: libata: drop ata_msg_malloc()
Hannes Reinecke [Tue, 21 Dec 2021 07:21:03 +0000 (08:21 +0100)]
ata: libata: drop ata_msg_malloc()

Unused.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: libata: drop ata_msg_ctl()
Hannes Reinecke [Tue, 21 Dec 2021 07:21:02 +0000 (08:21 +0100)]
ata: libata: drop ata_msg_ctl()

The one caller have been converted to dynamic debugging.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: libata: drop ata_msg_error() and ata_msg_intr()
Hannes Reinecke [Tue, 21 Dec 2021 07:21:01 +0000 (08:21 +0100)]
ata: libata: drop ata_msg_error() and ata_msg_intr()

Unused.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: sata_sx4: add module parameter 'dimm_test'
Hannes Reinecke [Tue, 21 Dec 2021 07:21:00 +0000 (08:21 +0100)]
ata: sata_sx4: add module parameter 'dimm_test'

Add module parameter 'dimm_test' to enable DIMM testing during startup.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: sata_sx4: Drop pointless VPRINTK() calls and convert the remaining ones
Hannes Reinecke [Tue, 21 Dec 2021 07:20:59 +0000 (08:20 +0100)]
ata: sata_sx4: Drop pointless VPRINTK() calls and convert the remaining ones

Drop pointless VPRINTK() calls for setting up SG tables
and convert the remaining calls to structured logging.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: sata_sil: Drop pointless VPRINTK() calls
Hannes Reinecke [Tue, 21 Dec 2021 07:20:58 +0000 (08:20 +0100)]
ata: sata_sil: Drop pointless VPRINTK() calls

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: sata_fsl: convert VPRINTK() calls to ata_port_dbg()
Hannes Reinecke [Tue, 21 Dec 2021 07:20:57 +0000 (08:20 +0100)]
ata: sata_fsl: convert VPRINTK() calls to ata_port_dbg()

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: sata_nv: drop pointless VPRINTK() calls and convert remaining ones
Hannes Reinecke [Tue, 21 Dec 2021 07:20:56 +0000 (08:20 +0100)]
ata: sata_nv: drop pointless VPRINTK() calls and convert remaining ones

Quite some information from the VPRINTK() is already covered by
tracepoints, so remove the pointless calls and convert the remaining
ones to structured logging.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: sata_mv: Drop pointless VPRINTK() call and convert the remaining one
Hannes Reinecke [Tue, 21 Dec 2021 07:20:55 +0000 (08:20 +0100)]
ata: sata_mv: Drop pointless VPRINTK() call and convert the remaining one

Drop pointless VPRINTK() call and convert the remaining one to dev_dbg().

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: sata_inic162x: Drop pointless VPRINTK() calls
Hannes Reinecke [Tue, 21 Dec 2021 07:20:54 +0000 (08:20 +0100)]
ata: sata_inic162x: Drop pointless VPRINTK() calls

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: sata_rcar: Drop pointless VPRINTK() calls
Hannes Reinecke [Tue, 21 Dec 2021 07:20:53 +0000 (08:20 +0100)]
ata: sata_rcar: Drop pointless VPRINTK() calls

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: sata_qstor: Drop pointless VPRINTK() calls
Hannes Reinecke [Tue, 21 Dec 2021 07:20:52 +0000 (08:20 +0100)]
ata: sata_qstor: Drop pointless VPRINTK() calls

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: sata_promise: Drop pointless VPRINTK() calls and convert the remaining ones
Hannes Reinecke [Tue, 21 Dec 2021 07:20:51 +0000 (08:20 +0100)]
ata: sata_promise: Drop pointless VPRINTK() calls and convert the remaining ones

Drop pointless VPRINTK() calls for entering and existing interrupt
routines and convert the remaining calls to ata_port_dbg().

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: pata_via: Drop pointless VPRINTK() calls
Hannes Reinecke [Tue, 21 Dec 2021 07:20:50 +0000 (08:20 +0100)]
ata: pata_via: Drop pointless VPRINTK() calls

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: pata_octeon_cf: Drop pointless VPRINTK() calls and convert the remaining one
Hannes Reinecke [Tue, 21 Dec 2021 07:20:49 +0000 (08:20 +0100)]
ata: pata_octeon_cf: Drop pointless VPRINTK() calls and convert the remaining one

Drop pointless VPRINTK() calls and convert the remaining calls to
the existing bmdma tracepoint.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: pdc_adma: Drop pointless VPRINTK() calls and remove disabled NCQ debugging
Hannes Reinecke [Tue, 21 Dec 2021 07:20:48 +0000 (08:20 +0100)]
ata: pdc_adma: Drop pointless VPRINTK() calls and remove disabled NCQ debugging

Drop pointless VPRINTK() calls for entering routines and setting up sg
tables. And while we're at it, remove the disabled debugging messages.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: ahci: Drop pointless VPRINTK() calls and convert the remaining ones
Hannes Reinecke [Tue, 21 Dec 2021 07:20:47 +0000 (08:20 +0100)]
ata: ahci: Drop pointless VPRINTK() calls and convert the remaining ones

Drop pointless VPRINTK() calls for entering and existing interrupt
routines and convert the remaining calls to dev_dbg().

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: libata: remove pointless VPRINTK() calls
Hannes Reinecke [Tue, 21 Dec 2021 07:20:46 +0000 (08:20 +0100)]
ata: libata: remove pointless VPRINTK() calls

Most of the information is already covered by tracepoints
(if not downright pointless), so remove the VPRINTK() calls.
And while we're at it, remove ata_scsi_dump_cdb(), too,
as this information can be retrieved from scsi tracing.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: pata_pdc2027x: Replace PDPRINTK() with standard ata logging
Hannes Reinecke [Tue, 21 Dec 2021 07:20:45 +0000 (08:20 +0100)]
ata: pata_pdc2027x: Replace PDPRINTK() with standard ata logging

Use standard ata logging macros instead of the hand-crafted
PDPRINTK and remove duplicate logging messages.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: sata_qstor: replace DPRINTK() with dev_dbg()
Hannes Reinecke [Tue, 21 Dec 2021 07:20:44 +0000 (08:20 +0100)]
ata: sata_qstor: replace DPRINTK() with dev_dbg()

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: sata_rcar: replace DPRINTK() with ata_port_dbg()
Hannes Reinecke [Tue, 21 Dec 2021 07:20:43 +0000 (08:20 +0100)]
ata: sata_rcar: replace DPRINTK() with ata_port_dbg()

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: sata_fsl: move DPRINTK to ata debugging
Hannes Reinecke [Tue, 21 Dec 2021 07:20:42 +0000 (08:20 +0100)]
ata: sata_fsl: move DPRINTK to ata debugging

Replace all DPRINTK calls with the ata_XXX_dbg functions.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: pdc_adma: Remove DPRINTK call
Hannes Reinecke [Tue, 21 Dec 2021 07:20:41 +0000 (08:20 +0100)]
ata: pdc_adma: Remove DPRINTK call

The DPRINTK call doesn't print information which isn't already covered
by tracepoints later on.
Remove it.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: pata_octeon_cf: remove DPRINTK() macro in interrupt context
Hannes Reinecke [Tue, 21 Dec 2021 07:20:40 +0000 (08:20 +0100)]
ata: pata_octeon_cf: remove DPRINTK() macro in interrupt context

There is only so much information to be glanced when the interrupt
routine is called and exited, so remove these DPRINTK() calls.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: sata_mv: replace DPRINTK with dynamic debugging
Hannes Reinecke [Tue, 21 Dec 2021 07:20:39 +0000 (08:20 +0100)]
ata: sata_mv: replace DPRINTK with dynamic debugging

Move the DPRINTK calls over to dynamic debugging.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: sata_mv: kill 'port' argument in mv_dump_all_regs()
Hannes Reinecke [Tue, 21 Dec 2021 07:20:38 +0000 (08:20 +0100)]
ata: sata_mv: kill 'port' argument in mv_dump_all_regs()

Always '-1', so drop it and simplify the function.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: libata: move DPRINTK to ata debugging
Hannes Reinecke [Tue, 21 Dec 2021 07:20:37 +0000 (08:20 +0100)]
ata: libata: move DPRINTK to ata debugging

Replace all DPRINTK calls with ata_dev_dbg().

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: libata: revamp ata_get_cmd_descript()
Hannes Reinecke [Tue, 21 Dec 2021 07:20:36 +0000 (08:20 +0100)]
ata: libata: revamp ata_get_cmd_descript()

Rename ata_get_cmd_descrip() to ata_get_cmd_name() and simplify
it to return "unknown" instead of NULL.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: libata: move ata_{port,link,dev}_dbg to standard pr_XXX() macros
Hannes Reinecke [Tue, 21 Dec 2021 07:20:35 +0000 (08:20 +0100)]
ata: libata: move ata_{port,link,dev}_dbg to standard pr_XXX() macros

Use standard pr_{debug,info,notice,warn,err} macros instead of the
hand-crafted printk helpers.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: libata: add tracepoints for ATA error handling
Hannes Reinecke [Tue, 21 Dec 2021 07:20:34 +0000 (08:20 +0100)]
ata: libata: add tracepoints for ATA error handling

Add tracepoints for ATA error handling.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: libata-scsi: drop DPRINTK calls for cdb translation
Hannes Reinecke [Tue, 21 Dec 2021 07:20:33 +0000 (08:20 +0100)]
ata: libata-scsi: drop DPRINTK calls for cdb translation

Drop DPRINTK calls for cdb translation as they are already covered
by other traces, and also drop the DPRINTK calls in ata_scsi_hotplug().

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: libata-sff: tracepoints for HSM state machine
Hannes Reinecke [Tue, 21 Dec 2021 07:20:32 +0000 (08:20 +0100)]
ata: libata-sff: tracepoints for HSM state machine

Add tracepoints for the HSM state machine and drop DPRINTK calls

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: libata: tracepoints for bus-master DMA
Hannes Reinecke [Tue, 21 Dec 2021 07:20:31 +0000 (08:20 +0100)]
ata: libata: tracepoints for bus-master DMA

Add tracepoints for bus-master DMA and taskfile related functions.
That allows us to drop the relevant DPRINTK() calls.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: libata: add qc_prep tracepoint
Hannes Reinecke [Tue, 21 Dec 2021 07:20:30 +0000 (08:20 +0100)]
ata: libata: add qc_prep tracepoint

Convert the existing ata_qc_issue() tracepoint into a template,
and add tracepoints for ata_qc_prep() and ata_qc_issue() based
on that template.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: libata: add reset tracepoints
Hannes Reinecke [Tue, 21 Dec 2021 07:20:29 +0000 (08:20 +0100)]
ata: libata: add reset tracepoints

To follow the flow of control we should be using tracepoints, as
they will tie in with the actual I/O flow and deliver a better
overview about what it happening.
This patch adds tracepoints for hard reset, soft reset, and postreset
and adds them in the libata-eh control flow.
With that we can drop the reset DPRINTK calls in the various drivers.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: libata: sanitize ATA_HORKAGE_DUMP_ID
Hannes Reinecke [Tue, 21 Dec 2021 07:20:28 +0000 (08:20 +0100)]
ata: libata: sanitize ATA_HORKAGE_DUMP_ID

With moving ata_dev_dbg() over to dynamic debugging ATA_HORKAGE_DUMP_ID
will now print out the raw IDENTIFY data without a header unless
explicitly enable via dyndebug.
So move the logging level up to INFO and have the header printed
always.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: libata: move ata_dump_id() to dynamic debugging
Hannes Reinecke [Tue, 21 Dec 2021 07:20:27 +0000 (08:20 +0100)]
ata: libata: move ata_dump_id() to dynamic debugging

Use ata_dev_dbg() to print out the information in ata_dump_id()
and remove the ata_msg_probe() conditional.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: libata: Add ata_port_classify() helper
Hannes Reinecke [Tue, 21 Dec 2021 07:20:26 +0000 (08:20 +0100)]
ata: libata: Add ata_port_classify() helper

Add an ata_port_classify() helper to print out the results from
the device classification and remove the debugging statements
from ata_dev_classify().

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: libata: whitespace cleanup
Hannes Reinecke [Tue, 21 Dec 2021 07:20:25 +0000 (08:20 +0100)]
ata: libata: whitespace cleanup

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: libata: remove pointless debugging messages
Hannes Reinecke [Tue, 21 Dec 2021 07:20:24 +0000 (08:20 +0100)]
ata: libata: remove pointless debugging messages

Debugging messages in pci init functions or sg setup are pretty
much pointless, as the workflow pretty much decides what happened.
So drop them.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: libata: use min() to make code cleaner
Changcheng Deng [Mon, 20 Dec 2021 11:33:58 +0000 (11:33 +0000)]
ata: libata: use min() to make code cleaner

Use min() in order to make code cleaner.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Changcheng Deng <deng.changcheng@zte.com.cn>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: libahci_platform: Get rid of dup message when IRQ can't be retrieved
Andy Shevchenko [Fri, 17 Dec 2021 11:28:32 +0000 (13:28 +0200)]
ata: libahci_platform: Get rid of dup message when IRQ can't be retrieved

platform_get_irq() will print a message when it fails.
No need to repeat this.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: libahci_platform: Remove bogus 32-bit DMA mask attempt
Andy Shevchenko [Thu, 9 Dec 2021 14:59:37 +0000 (16:59 +0200)]
ata: libahci_platform: Remove bogus 32-bit DMA mask attempt

If 64-bit mask attempt fails, the 32-bit will fail by the very same reason.
Don't even try the latter. It's a continuation of the changes that contains,
e.g. dcc02c19cc06 ("sata_sil24: use dma_set_mask_and_coherent").

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: sata_dwc_460ex: Remove unused forward declaration
Andy Shevchenko [Thu, 9 Dec 2021 14:35:19 +0000 (16:35 +0200)]
ata: sata_dwc_460ex: Remove unused forward declaration

sata_dwc_port_stop() is not used before being defined,
remove redundant forward declaration.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: sata_dwc_460ex: Use temporary variable for struct device
Andy Shevchenko [Thu, 9 Dec 2021 14:35:18 +0000 (16:35 +0200)]
ata: sata_dwc_460ex: Use temporary variable for struct device

Use temporary variable for struct device to make code neater.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: sata_dwc_460ex: Use devm_platform_*ioremap_resource() APIs
Andy Shevchenko [Thu, 9 Dec 2021 14:35:17 +0000 (16:35 +0200)]
ata: sata_dwc_460ex: Use devm_platform_*ioremap_resource() APIs

Use devm_platform_get_and_ioremap_resource() and
devm_platform_ioremap_resource() APIs instead of their
open coded analogues.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: sata_fsl: use sysfs_emit()
Damien Le Moal [Thu, 2 Dec 2021 06:05:03 +0000 (15:05 +0900)]
ata: sata_fsl: use sysfs_emit()

Use sysfs_emit() instead of sprintf() in fsl_sata_intr_coalescing_show()
and fsl_sata_rx_watermark_show().

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: ahci: use sysfs_emit()
Damien Le Moal [Thu, 2 Dec 2021 06:02:17 +0000 (15:02 +0900)]
ata: ahci: use sysfs_emit()

Use sysfs_emit() instead of sprintf in remapped_nvme_show().

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: libata-scsi: use sysfs_emit()
Damien Le Moal [Thu, 2 Dec 2021 05:56:47 +0000 (14:56 +0900)]
ata: libata-scsi: use sysfs_emit()

Use sysfs_emit() instead of snprintf() in ata_scsi_park_show().

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: libata-sata: use sysfs_emit()
Damien Le Moal [Thu, 2 Dec 2021 05:52:57 +0000 (14:52 +0900)]
ata: libata-sata: use sysfs_emit()

Use sysfs_emit() instead of snprintf() in sysfs attibute show()
functions.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: sata_fsl: Use struct_group() for memcpy() region
Kees Cook [Thu, 18 Nov 2021 18:38:07 +0000 (10:38 -0800)]
ata: sata_fsl: Use struct_group() for memcpy() region

In preparation for FORTIFY_SOURCE performing compile-time and run-time
field bounds checking for memcpy(), memmove(), and memset(), avoid
intentionally writing across neighboring fields.

Use struct_group() in struct command_desc around members acmd and fill,
so they can be referenced together. This will allow memset(), memcpy(),
and sizeof() to more easily reason about sizes, improve readability,
and avoid future warnings about writing beyond the end of acmd:

In function 'fortify_memset_chk',
    inlined from 'sata_fsl_qc_prep' at drivers/ata/sata_fsl.c:534:3:
./include/linux/fortify-string.h:199:4: warning: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Wattribute-warning]
  199 |    __write_overflow_field();
      |    ^~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2 years agoata: pata_ali: no need to initialise statics to 0
Jason Wang [Sat, 13 Nov 2021 06:26:14 +0000 (14:26 +0800)]
ata: pata_ali: no need to initialise statics to 0

Static variables do not need to be initialized to 0.

Signed-off-by: Jason Wang <wangborong@cdjrlc.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>