summaryrefslogtreecommitdiff
path: root/drivers/ata/libata-core.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2022-03-24 00:35:59 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2022-03-24 00:35:59 +0300
commitc7d4b15372bde442059c7d6415afeba073a09474 (patch)
tree2354ff8fb6d44a70f7959e1ba5bfde70b6db9163 /drivers/ata/libata-core.c
parentd51b1b33c51d147b757f042b4d336603b699f362 (diff)
parentd268afa1ff6f582dede1819fbed7ded7442a406c (diff)
downloadlinux-c7d4b15372bde442059c7d6415afeba073a09474.tar.xz
Merge tag 'ata-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata
Pull ata updates from Damien Le Moal: "For this cycle, no big change but many small fixes and code cleanup to libata, the ahci driver and various pata drivers. In more details: - Code simplification in pata_platform using platform_get_mem_or_io(), from Lad. - Fix read-only arrays declarations as const in pata_atiixp and pata_pdc202xx_old, from Colin. - Various cleanups and code simplification in libata-scsi, from me. - Remove dead code in libata-acpi, from Sergey. - Skip device scan deboune delay for Marvell 88SE9235 adapters (ahci) to speedup boot, from Paul. - Simplify functions declaration and use for functions always returning 0 in libata-core, from Sergey. - Non-fatal error fixes and in the pata_hpt366 and pata_hpt3x2n drivers, from Sergey. - Various code cleanup in the pata_artop, pata_hpt37x, pata_hpt366, pata_hpt3x2n, pata_samsung_cf and sata_rcar drivers, from Sergey. - Some libata-sff and libata-scsi code cleanup (e.g. change functions to return "bool"), from Sergey. - Renae ahci_board_mobile to board_ahci_low_power to be more descriptive of the feature as that is also used on PC and server AHCI adapters, from Mario. - Cleanup of OF match tables, from Geert. - Simplify the pata_pxa driver initialization using platform_get_irq(), from Minghao" * tag 'ata-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: (38 commits) ata: pata_pxa: Use platform_get_irq() to get the interrupt ata: Drop commas after OF match table sentinels ata: ahci: Rename CONFIG_SATA_LPM_MOBILE_POLICY configuration item ata: ahci: Rename `AHCI_HFLAG_IS_MOBILE` ata: ahci: Rename board_ahci_mobile ata: pata_hpt37x: merge transfer mode setting methods ata: libata-sff: use *switch* statement in ata_sff_dev_classify() ata: add/use ata_taskfile::{error|status} fields ata: Kconfig: fix sata gemini compile test condition ata: libata-scsi: use *switch* statements to check SCSI command codes ata: libata-sff: refactor ata_sff_altstatus() ata: libata-sff: refactor ata_sff_set_devctl() ata: libata-sff: make ata_resources_present() return 'bool' ata: pata_hpt3x2n: disable fast interrupts in prereset() method ata: pata_hpt37x: disable fast interrupts in prereset() method ata: pata_hpt366: disable fast interrupts in prereset() method ata: pata_mpc52xx: use GFP_KERNEL ata: sata_rcar: drop unused #define's ata: pata_hpt366: check channel enable bits ata: sata_rcar: make sata_rcar_ata_devchk() return 'bool' ...
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r--drivers/ata/libata-core.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 0c854aebfe0b..cceedde51126 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -1171,7 +1171,7 @@ static int ata_read_native_max_address(struct ata_device *dev, u64 *max_sectors)
ata_dev_warn(dev,
"failed to read native max address (err_mask=0x%x)\n",
err_mask);
- if (err_mask == AC_ERR_DEV && (tf.feature & ATA_ABORTED))
+ if (err_mask == AC_ERR_DEV && (tf.error & ATA_ABORTED))
return -EACCES;
return -EIO;
}
@@ -1235,7 +1235,7 @@ static int ata_set_max_sectors(struct ata_device *dev, u64 new_sectors)
"failed to set max address (err_mask=0x%x)\n",
err_mask);
if (err_mask == AC_ERR_DEV &&
- (tf.feature & (ATA_ABORTED | ATA_IDNF)))
+ (tf.error & (ATA_ABORTED | ATA_IDNF)))
return -EACCES;
return -EIO;
}
@@ -1584,7 +1584,7 @@ unsigned ata_exec_internal_sg(struct ata_device *dev,
/* perform minimal error analysis */
if (qc->flags & ATA_QCFLAG_FAILED) {
- if (qc->result_tf.command & (ATA_ERR | ATA_DF))
+ if (qc->result_tf.status & (ATA_ERR | ATA_DF))
qc->err_mask |= AC_ERR_DEV;
if (!qc->err_mask)
@@ -1593,7 +1593,7 @@ unsigned ata_exec_internal_sg(struct ata_device *dev,
if (qc->err_mask & ~AC_ERR_OTHER)
qc->err_mask &= ~AC_ERR_OTHER;
} else if (qc->tf.command == ATA_CMD_REQ_SENSE_DATA) {
- qc->result_tf.command |= ATA_SENSE;
+ qc->result_tf.status |= ATA_SENSE;
}
/* finish up */
@@ -1813,7 +1813,7 @@ retry:
return 0;
}
- if ((err_mask == AC_ERR_DEV) && (tf.feature & ATA_ABORTED)) {
+ if ((err_mask == AC_ERR_DEV) && (tf.error & ATA_ABORTED)) {
/* Device or controller might have reported
* the wrong device class. Give a shot at the
* other IDENTIFY if the current one is
@@ -3569,7 +3569,7 @@ EXPORT_SYMBOL_GPL(ata_wait_after_reset);
* Kernel thread context (may sleep)
*
* RETURNS:
- * 0 on success, -errno otherwise.
+ * Always 0.
*/
int ata_std_prereset(struct ata_link *link, unsigned long deadline)
{
@@ -4384,7 +4384,7 @@ static unsigned int ata_dev_init_params(struct ata_device *dev,
/* A clean abort indicates an original or just out of spec drive
and we should continue as we issue the setup based on the
drive reported working geometry */
- if (err_mask == AC_ERR_DEV && (tf.feature & ATA_ABORTED))
+ if (err_mask == AC_ERR_DEV && (tf.error & ATA_ABORTED))
err_mask = 0;
return err_mask;
@@ -5179,10 +5179,9 @@ EXPORT_SYMBOL_GPL(ata_sas_port_resume);
*
* Suspend @host. Actual operation is performed by port suspend.
*/
-int ata_host_suspend(struct ata_host *host, pm_message_t mesg)
+void ata_host_suspend(struct ata_host *host, pm_message_t mesg)
{
host->dev->power.power_state = mesg;
- return 0;
}
EXPORT_SYMBOL_GPL(ata_host_suspend);
@@ -6099,11 +6098,8 @@ EXPORT_SYMBOL_GPL(ata_pci_device_do_resume);
int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg)
{
struct ata_host *host = pci_get_drvdata(pdev);
- int rc = 0;
- rc = ata_host_suspend(host, mesg);
- if (rc)
- return rc;
+ ata_host_suspend(host, mesg);
ata_pci_device_do_suspend(pdev, mesg);