summaryrefslogtreecommitdiff
path: root/drivers/ata/ahci.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2022-01-18 10:14:49 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2022-01-18 10:14:49 +0200
commitfe81ba137ebcc7f236780996a0b375732c07e85c (patch)
tree7b7739f753e0b706ce93e86adc9ea5df39285882 /drivers/ata/ahci.c
parent3bf6a9e36e441714928d73a5adbc59562eb7ef19 (diff)
parent237fe8885a3fdab169bf670790c9f40046af45d3 (diff)
downloadlinux-fe81ba137ebcc7f236780996a0b375732c07e85c.tar.gz
Merge tag 'ata-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata
Pull ATA updates from Damien Le Moal: "A larger than usual set of changes for this cycle. The bulk of the changes are part of a rework of libata messages and debugging features from Hannes. In more detail, the changes are as follows. - Small code cleanups in the pata_ali driver (unnecessary variable initialization and simplified return statement, from Jason and Colin. - Switch to using struct_group() in the sata_fsl driver, from Kees. - Convert many sysfs attribute show functions to use sysfs_emit() instead of snprintf(), from me. - sata_dwc_460ex driver code cleanups, from Andy. - Improve DMA setup and remove superfluous error message in libahci_platform, from Andy - A small code cleanup in libata to use min() instead of open coding test, from Changcheng. - Rework of libata messages from Hannes. This is especially focused on replacing compile time defined debugging messages (DPRINTK() and VPRINTK()) with regular dynamic debugging messages (pr_debug()) and traceipoint events. Both libata-core and many drivers are updated to have a consistent debugging level control for all drivers. - Extend compile test support to as many drivers as possible in ATA Kconfig to improve compile test coverage, from me. - Fixes to avoid compile time warnings (W=1) and sparse warnings in sata_fsl and ahci_xgene drivers, from me. - Fix the interface of the read_id() port operation method to clarify that the data buffer passed as an argument is little endian. This avoids sparse warnings in the pata_netcell, pata_it821x, ahci_xgene, ahci_cevaxi and ahci_brcm drivers. From me. - Small code cleanup in the pata_octeon_cf driver, from Minghao. - Improved IRQ configuration code in pata_of_platform, from Lad. - Simplified implementation of __ata_scsi_queuecmd(), from Wenchao. - Debounce delay flag renaming, from Paul. - Add support for AMD A85 FCH (Hudson D4) AHCI adapters, from Paul" * tag 'ata-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: (106 commits) ata: pata_ali: remove redundant return statement ata: ahci: Add support for AMD A85 FCH (Hudson D4) ata: libata: Rename link flag ATA_LFLAG_NO_DB_DELAY ata: libata-scsi: simplify __ata_scsi_queuecmd() ata: pata_of_platform: Use platform_get_irq_optional() to get the interrupt ata: pata_samsung_cf: add compile test support ata: pata_pxa: add compile test support ata: pata_imx: add compile test support ata: pata_ftide010: add compile test support ata: pata_cs5535: add compile test support ata: pata_octeon_cf: remove redundant val variable ata: fix read_id() ata port operation interface ata: ahci_xgene: use correct type for port mmio address ata: sata_fsl: fix cmdhdr_tbl_entry and prde struct definitions ata: sata_fsl: fix scsi host initialization ata: pata_bk3710: add compile test support ata: ahci_seattle: add compile test support ata: ahci_xgene: add compile test support ata: ahci_tegra: add compile test support ata: ahci_sunxi: add compile test support ...
Diffstat (limited to 'drivers/ata/ahci.c')
-rw-r--r--drivers/ata/ahci.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 1e1167e725a4..ab5811ef5a53 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -51,6 +51,7 @@ enum board_ids {
board_ahci,
board_ahci_ign_iferr,
board_ahci_mobile,
+ board_ahci_no_debounce_delay,
board_ahci_nomsi,
board_ahci_noncq,
board_ahci_nosntf,
@@ -141,6 +142,13 @@ static const struct ata_port_info ahci_port_info[] = {
.udma_mask = ATA_UDMA6,
.port_ops = &ahci_ops,
},
+ [board_ahci_no_debounce_delay] = {
+ .flags = AHCI_FLAG_COMMON,
+ .link_flags = ATA_LFLAG_NO_DEBOUNCE_DELAY,
+ .pio_mask = ATA_PIO4,
+ .udma_mask = ATA_UDMA6,
+ .port_ops = &ahci_ops,
+ },
[board_ahci_nomsi] = {
AHCI_HFLAGS (AHCI_HFLAG_NO_MSI),
.flags = AHCI_FLAG_COMMON,
@@ -437,6 +445,7 @@ static const struct pci_device_id ahci_pci_tbl[] = {
board_ahci_al },
/* AMD */
{ PCI_VDEVICE(AMD, 0x7800), board_ahci }, /* AMD Hudson-2 */
+ { PCI_VDEVICE(AMD, 0x7801), board_ahci_no_debounce_delay }, /* AMD Hudson-2 (AHCI mode) */
{ PCI_VDEVICE(AMD, 0x7900), board_ahci }, /* AMD CZ */
{ PCI_VDEVICE(AMD, 0x7901), board_ahci_mobile }, /* AMD Green Sardine */
/* AMD is using RAID class only for ahci controllers */
@@ -684,7 +693,7 @@ static void ahci_pci_init_controller(struct ata_host *host)
/* clear port IRQ */
tmp = readl(port_mmio + PORT_IRQ_STAT);
- VPRINTK("PORT_IRQ_STAT 0x%x\n", tmp);
+ dev_dbg(&pdev->dev, "PORT_IRQ_STAT 0x%x\n", tmp);
if (tmp)
writel(tmp, port_mmio + PORT_IRQ_STAT);
}
@@ -700,8 +709,6 @@ static int ahci_vt8251_hardreset(struct ata_link *link, unsigned int *class,
bool online;
int rc;
- DPRINTK("ENTER\n");
-
hpriv->stop_engine(ap);
rc = sata_link_hardreset(link, sata_ehc_deb_timing(&link->eh_context),
@@ -709,8 +716,6 @@ static int ahci_vt8251_hardreset(struct ata_link *link, unsigned int *class,
hpriv->start_engine(ap);
- DPRINTK("EXIT, rc=%d, class=%u\n", rc, *class);
-
/* vt8251 doesn't clear BSY on signature FIS reception,
* request follow-up softreset.
*/
@@ -790,8 +795,6 @@ static int ahci_avn_hardreset(struct ata_link *link, unsigned int *class,
bool online;
int rc, i;
- DPRINTK("ENTER\n");
-
hpriv->stop_engine(ap);
for (i = 0; i < 2; i++) {
@@ -829,7 +832,6 @@ static int ahci_avn_hardreset(struct ata_link *link, unsigned int *class,
if (online)
*class = ahci_dev_classify(ap);
- DPRINTK("EXIT, rc=%d, class=%u\n", rc, *class);
return rc;
}
@@ -1476,7 +1478,6 @@ static irqreturn_t ahci_thunderx_irq_handler(int irq, void *dev_instance)
u32 irq_stat, irq_masked;
unsigned int handled = 1;
- VPRINTK("ENTER\n");
hpriv = host->private_data;
mmio = hpriv->mmio;
irq_stat = readl(mmio + HOST_IRQ_STAT);
@@ -1493,7 +1494,6 @@ static irqreturn_t ahci_thunderx_irq_handler(int irq, void *dev_instance)
irq_stat = readl(mmio + HOST_IRQ_STAT);
spin_unlock(&host->lock);
} while (irq_stat);
- VPRINTK("EXIT\n");
return IRQ_RETVAL(handled);
}
@@ -1657,7 +1657,7 @@ static ssize_t remapped_nvme_show(struct device *dev,
struct ata_host *host = dev_get_drvdata(dev);
struct ahci_host_priv *hpriv = host->private_data;
- return sprintf(buf, "%u\n", hpriv->remapped_nvme);
+ return sysfs_emit(buf, "%u\n", hpriv->remapped_nvme);
}
static DEVICE_ATTR_RO(remapped_nvme);
@@ -1673,8 +1673,6 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
int n_ports, i, rc;
int ahci_pci_bar = AHCI_PCI_BAR_STANDARD;
- VPRINTK("ENTER\n");
-
WARN_ON((int)ATA_MAX_QUEUE > AHCI_MAX_CMDS);
ata_print_version_once(&pdev->dev, DRV_VERSION);