summaryrefslogtreecommitdiff
path: root/drivers/ata
AgeCommit message (Collapse)AuthorFilesLines
2022-02-23ata: pata_hpt37x: disable primary channel on HPT371Sergey Shtylyov1-0/+14
The HPT371 chip physically has only one channel, the secondary one, however the primary channel registers do exist! Thus we have to manually disable the non-existing channel if the BIOS hasn't done this already. Similarly to the pata_hpt3x2n driver, always disable the primary channel. Fixes: 669a5db411d8 ("[libata] Add a bunch of PATA drivers.") Cc: stable@vger.kernel.org Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru> Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2022-02-22ata: pata_hpt37x: fix PCI clock detectionSergey Shtylyov1-2/+2
The f_CNT register (at the PCI config. address 0x78) is 16-bit, not 8-bit! The bug was there from the very start... :-( Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru> Fixes: 669a5db411d8 ("[libata] Add a bunch of PATA drivers.") Cc: stable@vger.kernel.org Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2022-02-08ata: libata-core: Disable TRIM on M88V29Zoltán Böszörményi1-0/+1
This device is a CF card, or possibly an SSD in CF form factor. It supports NCQ and high speed DMA. While it also advertises TRIM support, I/O errors are reported when the discard mount option fstrim is used. TRIM also fails when disabling NCQ and not just as an NCQ command. TRIM must be disabled for this device. Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com> Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2022-02-08ata: sata_fsl: fix sscanf() and sysfs_emit() format stringsDamien Le Moal1-9/+7
Use the %u format for unsigned int parameters handling with sscanf() and sysfs_emit() to avoid compilation warnings. In fsl_sata_rx_watermark_store(), the call to sscanf() to parse a single argument is replaced with a call to kstrtouint(). While at it, also replace the printk(KERN_ERR) calls with dev_err() calls and fix blank lines in fsl_sata_rx_watermark_store(). Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2022-02-07ata: libata-core: Fix ata_dev_config_cpr()Damien Le Moal1-8/+6
The concurrent positioning ranges log page 47h is a general purpose log page and not a subpage of the indentify device log. Using ata_identify_page_supported() to test for concurrent positioning ranges support is thus wrong. ata_log_supported() must be used. Furthermore, unlike other advanced ATA features (e.g. NCQ priority), accesses to the concurrent positioning ranges log page are not gated by a feature bit from the device IDENTIFY data. Since many older drives react badly to the READ LOG EXT and/or READ LOG DMA EXT commands isued to read device log pages, avoid problems with older drives by limiting the concurrent positioning ranges support detection to drives implementing at least the ACS-4 ATA standard (major version 11). This additional condition effectively turns ata_dev_config_cpr() into a nop for older drives, avoiding problems in the field. Fixes: fe22e1c2f705 ("libata: support concurrent positioning ranges log") BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215519 Cc: stable@vger.kernel.org Reviewed-by: Hannes Reinecke <hare@suse.de> Tested-by: Abderraouf Adjal <adjal.arf@gmail.com> Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2022-02-04ata: libata-core: Introduce ATA_HORKAGE_NO_LOG_DIR horkageAnton Lundin1-0/+10
06f6c4c6c3e8 ("ata: libata: add missing ata_identify_page_supported() calls") introduced additional calls to ata_identify_page_supported(), thus also adding indirectly accesses to the device log directory log page through ata_log_supported(). Reading this log page causes SATADOM-ML 3ME devices to lock up. Introduce the horkage flag ATA_HORKAGE_NO_LOG_DIR to prevent accesses to the log directory in ata_log_supported() and add a blacklist entry with this flag for "SATADOM-ML 3ME" devices. Fixes: 636f6e2af4fb ("libata: add horkage for missing Identify Device log") Cc: stable@vger.kernel.org # v5.10+ Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2022-01-27ata: pata_platform: Fix a NULL pointer dereference in __pata_platform_probe()Zhou Qingyang1-0/+2
In __pata_platform_probe(), devm_kzalloc() is assigned to ap->ops and there is a dereference of it right after that, which could introduce a NULL pointer dereference bug. Fix this by adding a NULL check of ap->ops. This bug was found by a static analyzer. Builds with 'make allyesconfig' show no new warnings, and our static analyzer no longer warns about this code. Fixes: f3d5e4f18dba ("ata: pata_of_platform: Allow to use 16-bit wide data transfer") Signed-off-by: Zhou Qingyang <zhou1615@umn.edu> Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
2022-01-21ata: pata_octeon_cf: fix call to trace_ata_bmdma_stop()Damien Le Moal1-1/+1
The first argument of trace_ata_bmdma_stop() must be a pointer to a struct ata_port, not to a struct ata_queued_cmd. Reported-by: Linux Kernel Functional Testing <lkft@linaro.org> Fixes: d3e140f2b008 ("ata: pata_octeon_cf: Drop pointless VPRINTK() calls and convert the remaining one") Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
2022-01-14ata: pata_ali: remove redundant return statementColin Ian King1-1/+1
A return statement is unnecessarily complicated, currently value in variable mask is bitwise-masked and the variable is being updated and then returned. Just updating the mask is all that is required as the following statement is a return. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2022-01-14ata: ahci: Add support for AMD A85 FCH (Hudson D4)Paul Menzel1-0/+9
Add support for the AMD A85 FCH (Hudson D4) AHCI adapter. Since this adapter does not require the default 200 ms debounce delay in sata_link_resume(), create a new board board_ahci_no_debounce_delay with the link flag ATA_LFLAG_NO_DEBOUNCE_DELAY, and, for now, configure the AMD A85 FCH (Hudson D4) to use it. On the ASUS F2A85-M PRO it reduces the Linux kernel boot time by the expected 200 ms from 787 ms to 585 ms. Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de> Cc: Tejun Heo <tj@kernel.org> Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2022-01-14ata: libata: Rename link flag ATA_LFLAG_NO_DB_DELAYPaul Menzel2-2/+2
Rename the link flag ATA_LFLAG_NO_DB_DELAY to ATA_LFLAG_NO_DEBOUNCE_DELAY. The new name is longer, but clearer. Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de> Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2022-01-14ata: libata-scsi: simplify __ata_scsi_queuecmd()Wenchao Hao1-24/+21
This patch cleans up the code of __ata_scsi_queuecmd(). Since each branch of the "if" condition check that scmd->cmd_len is not zero, move this check out of the "if" to simplify the conditions being checked in the "else" branch. While at it, avoid the if-else-if-else structure using if-else if structure and remove the redundant rc local variable. This patch does not change the function logic. Signed-off-by: Wenchao Hao <haowenchao@huawei.com> Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2022-01-14ata: pata_of_platform: Use platform_get_irq_optional() to get the interruptLad Prabhakar1-3/+12
platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq_optional(). Note the code does not set the IRQ flags as this is handled automatically for DT. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2022-01-14ata: pata_samsung_cf: add compile test supportDamien Le Moal1-1/+1
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>
2022-01-14ata: pata_pxa: add compile test supportDamien Le Moal1-1/+1
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>
2022-01-14ata: pata_imx: add compile test supportDamien Le Moal1-1/+1
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>
2022-01-14ata: pata_ftide010: add compile test supportDamien Le Moal1-1/+1
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>
2022-01-14ata: pata_cs5535: add compile test supportDamien Le Moal1-1/+1
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>
2022-01-14ata: pata_octeon_cf: remove redundant val variableMinghao Chi1-5/+1
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>
2022-01-14ata: fix read_id() ata port operation interfaceDamien Le Moal6-22/+21
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>
2022-01-14ata: ahci_xgene: use correct type for port mmio addressDamien Le Moal1-3/+3
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>
2022-01-14ata: sata_fsl: fix cmdhdr_tbl_entry and prde struct definitionsDamien Le Moal1-10/+10
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>
2022-01-14ata: sata_fsl: fix scsi host initializationDamien Le Moal1-2/+1
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>
2022-01-14ata: pata_bk3710: add compile test supportDamien Le Moal1-1/+1
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>
2022-01-14ata: ahci_seattle: add compile test supportDamien Le Moal1-1/+1
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>
2022-01-14ata: ahci_xgene: add compile test supportDamien Le Moal1-1/+1
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>
2022-01-14ata: ahci_tegra: add compile test supportDamien Le Moal1-1/+1
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>
2022-01-14ata: ahci_sunxi: add compile test supportDamien Le Moal1-1/+1
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>
2022-01-14ata: ahci_mvebu: add compile test supportDamien Le Moal1-1/+1
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>
2022-01-14ata: ahci_mtk: add compile test supportDamien Le Moal1-1/+1
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>
2022-01-05ata: ahci_dm816: add compile test supportDamien Le Moal1-1/+1
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>
2022-01-05ata: ahci_da850: add compile test supportDamien Le Moal1-1/+1
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>
2022-01-05ata: ahci_brcm: add compile test supportDamien Le Moal1-1/+1
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>
2022-01-05ata: sata_fsl: add compile test supportDamien Le Moal1-1/+1
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>
2022-01-05ata: sata_dwc_460ex: Remove debug compile optionsHannes Reinecke2-20/+0
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>
2022-01-05ata: sata_dwc_460ex: remove 'check_status' argumentHannes Reinecke1-16/+13
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>
2022-01-05ata: sata_dwc_460ex: drop DEBUG_NCQHannes Reinecke1-28/+0
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>
2022-01-05ata: libata-scsi: rework ata_dump_status to avoid using pr_cont()Hannes Reinecke1-28/+23
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>
2022-01-05ata: pata_hpt366: convert pr_warn() callsHannes Reinecke1-4/+1
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>
2022-01-05ata: sata_gemini: convert pr_err() callsHannes Reinecke1-2/+2
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>
2022-01-05ata: pata_hpt3x2n: convert pr_XXX() callsHannes Reinecke1-7/+5
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>
2022-01-05ata: pata_octeon_cf: Replace pr_XXX() calls with structured loggingHannes Reinecke1-2/+2
Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2022-01-05ata: pata_hpt37x: convert pr_XXX() callsHannes Reinecke1-10/+10
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>
2022-01-05ata: sata_mv: convert remaining printk() to structured loggingHannes Reinecke1-14/+16
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>
2022-01-05ata: sata_sx4: convert printk() callsHannes Reinecke1-4/+5
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>
2022-01-05ata: pata_sil680: convert printk() callsHannes Reinecke1-4/+4
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>
2022-01-05ata: pata_serverworks: convert printk() callsHannes Reinecke1-2/+2
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>
2022-01-05ata: pata_rz1000: convert printk() callsHannes Reinecke1-2/+2
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>
2022-01-05ata: pata_marvell: convert printk() callsHannes Reinecke1-7/+2
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>
2022-01-05ata: pata_it821x: convert printk() callsHannes Reinecke1-19/+24
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>