From: Linus Torvalds Date: Wed, 15 Nov 2017 22:11:41 +0000 (-0800) Subject: Merge branch 'for-4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata X-Git-Tag: v4.15-rc1~100 X-Git-Url: https://repo.jachan.dev/linux.git/commitdiff_plain/1bc03573e1c9024d4e4be97df4a1e0931edbae2c?hp=-c Merge branch 'for-4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata Pull libata updates from Tejun Heo: "Nothing too interesting or alarming. Other than a new power saving mode addition to ahci and crash fix on a tracepoint, all changes are trivial or device-specific" * 'for-4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata: (22 commits) ahci: imx: Handle increased read failures for IMX53 temperature sensor in low frequency mode. ata: sata_dwc_460ex: Propagate platform device ID to DMA driver ata: fixes kernel crash while tracing ata_eh_link_autopsy event ata: pata_pdc2027x: Fix space before '[' error. libata: fix spelling mistake: 'ambigious' -> 'ambiguous' ata: ceva: Add SMMU support for SATA IP ata: ceva: Correct the suspend and resume logic for SATA ata: ceva: Correct the AXI bus configuration for SATA ports ata: ceva: Add CCI support for SATA if CCI is enabled ata: ceva: Make RxWaterMark value as module parameter ata: ceva: Disable Device Sleep capability ata: ceva: Add gen 3 mode support in driver ata: ceva: Move sata port phy oob settings to device-tree devicetree: bindings: Add sata port phy config parameters in ahci-ceva ata: mark expected switch fall-throughs ata: sata_mv: remove a redundant assignment to pointer ehi ahci: Add support for Cavium's fifth generation SATA controller ata: sata_rcar: Use of_device_get_match_data() helper libata: make ata_port_type const libata: make static arrays const, reduces object code size ... --- 1bc03573e1c9024d4e4be97df4a1e0931edbae2c diff --combined drivers/ata/ahci.c index 9f78bb03bb76,6e26c1c2d18c..5443cb71d7ba --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@@ -57,6 -57,7 +57,7 @@@ enum AHCI_PCI_BAR_STA2X11 = 0, AHCI_PCI_BAR_CAVIUM = 0, AHCI_PCI_BAR_ENMOTUS = 2, + AHCI_PCI_BAR_CAVIUM_GEN5 = 4, AHCI_PCI_BAR_STANDARD = 5, }; @@@ -621,11 -622,8 +622,11 @@@ static void ahci_pci_save_initial_confi static int ahci_pci_reset_controller(struct ata_host *host) { struct pci_dev *pdev = to_pci_dev(host->dev); + int rc; - ahci_reset_controller(host); + rc = ahci_reset_controller(host); + if (rc) + return rc; if (pdev->vendor == PCI_VENDOR_ID_INTEL) { struct ahci_host_priv *hpriv = host->private_data; @@@ -1570,8 -1568,12 +1571,12 @@@ static int ahci_init_one(struct pci_de ahci_pci_bar = AHCI_PCI_BAR_STA2X11; else if (pdev->vendor == 0x1c44 && pdev->device == 0x8000) ahci_pci_bar = AHCI_PCI_BAR_ENMOTUS; - else if (pdev->vendor == 0x177d && pdev->device == 0xa01c) - ahci_pci_bar = AHCI_PCI_BAR_CAVIUM; + else if (pdev->vendor == PCI_VENDOR_ID_CAVIUM) { + if (pdev->device == 0xa01c) + ahci_pci_bar = AHCI_PCI_BAR_CAVIUM; + if (pdev->device == 0xa084) + ahci_pci_bar = AHCI_PCI_BAR_CAVIUM_GEN5; + } /* acquire resources */ rc = pcim_enable_device(pdev); diff --combined drivers/ata/libata-core.c index b8ac4902d312,36ea7b59e88d..2a882929de4a --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@@ -1879,6 -1879,7 +1879,7 @@@ retry switch (class) { case ATA_DEV_SEMB: class = ATA_DEV_ATA; /* some hard drives report SEMB sig */ + /* fall through */ case ATA_DEV_ATA: case ATA_DEV_ZAC: tf.command = ATA_CMD_ID_ATA; @@@ -2975,6 -2976,7 +2976,7 @@@ int ata_bus_probe(struct ata_port *ap case -ENODEV: /* give it just one more chance */ tries[dev->devno] = min(tries[dev->devno], 1); + /* fall through */ case -EIO: if (tries[dev->devno] == 1) { /* This is the last chance, better to slow @@@ -3462,6 -3464,7 +3464,7 @@@ int ata_down_xfermask_limit(struct ata_ case ATA_DNXFER_FORCE_PIO0: pio_mask &= 1; + /* fall through */ case ATA_DNXFER_FORCE_PIO: mwdma_mask = 0; udma_mask = 0; @@@ -3964,6 -3967,7 +3967,7 @@@ int sata_link_scr_lpm(struct ata_link * scontrol &= ~(0x1 << 8); scontrol |= (0x6 << 8); break; + case ATA_LPM_MED_POWER_WITH_DIPM: case ATA_LPM_MIN_POWER: if (ata_link_nr_enabled(link) > 0) /* no restrictions on LPM transitions */ @@@ -5823,7 -5827,7 +5827,7 @@@ void ata_host_resume(struct ata_host *h } #endif - struct device_type ata_port_type = { + const struct device_type ata_port_type = { .name = "ata_port", #ifdef CONFIG_PM .pm = &ata_port_pm_ops, @@@ -5979,8 -5983,9 +5983,8 @@@ struct ata_port *ata_port_alloc(struct INIT_LIST_HEAD(&ap->eh_done_q); init_waitqueue_head(&ap->eh_wait_q); init_completion(&ap->park_req_pending); - setup_deferrable_timer(&ap->fastdrain_timer, - ata_eh_fastdrain_timerfn, - (unsigned long)ap); + timer_setup(&ap->fastdrain_timer, ata_eh_fastdrain_timerfn, + TIMER_DEFERRABLE); ap->cbl = ATA_CBL_NONE; @@@ -6903,7 -6908,7 +6907,7 @@@ static int __init ata_parse_force_one(c return -EINVAL; } if (nr_matches > 1) { - *reason = "ambigious value"; + *reason = "ambiguous value"; return -EINVAL; } diff --combined drivers/ata/libata-eh.c index ece6fd91a947,6d45bfa6d611..11c3137d7b0a --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c @@@ -879,9 -879,9 +879,9 @@@ static int ata_eh_nr_in_flight(struct a return nr; } -void ata_eh_fastdrain_timerfn(unsigned long arg) +void ata_eh_fastdrain_timerfn(struct timer_list *t) { - struct ata_port *ap = (void *)arg; + struct ata_port *ap = from_timer(ap, t, fastdrain_timer); unsigned long flags; int cnt; @@@ -2264,8 -2264,8 +2264,8 @@@ static void ata_eh_link_autopsy(struct if (dev->flags & ATA_DFLAG_DUBIOUS_XFER) eflags |= ATA_EFLAG_DUBIOUS_XFER; ehc->i.action |= ata_eh_speed_down(dev, eflags, all_err_mask); + trace_ata_eh_link_autopsy(dev, ehc->i.action, all_err_mask); } - trace_ata_eh_link_autopsy(dev, ehc->i.action, all_err_mask); DPRINTK("EXIT\n"); } @@@ -3454,9 -3454,9 +3454,9 @@@ static int ata_eh_maybe_retry_flush(str * @r_failed_dev: out parameter for failed device * * Enable SATA Interface power management. This will enable - * Device Interface Power Management (DIPM) for min_power - * policy, and then call driver specific callbacks for - * enabling Host Initiated Power management. + * Device Interface Power Management (DIPM) for min_power and + * medium_power_with_dipm policies, and then call driver specific + * callbacks for enabling Host Initiated Power management. * * LOCKING: * EH context. @@@ -3502,7 -3502,7 +3502,7 @@@ static int ata_eh_set_lpm(struct ata_li hints &= ~ATA_LPM_HIPM; /* disable DIPM before changing link config */ - if (policy != ATA_LPM_MIN_POWER && dipm) { + if (policy < ATA_LPM_MED_POWER_WITH_DIPM && dipm) { err_mask = ata_dev_set_feature(dev, SETFEATURES_SATA_DISABLE, SATA_DIPM); if (err_mask && err_mask != AC_ERR_DEV) { @@@ -3545,7 -3545,7 +3545,7 @@@ /* host config updated, enable DIPM if transitioning to MIN_POWER */ ata_for_each_dev(dev, link, ENABLED) { - if (policy == ATA_LPM_MIN_POWER && !no_dipm && + if (policy >= ATA_LPM_MED_POWER_WITH_DIPM && !no_dipm && ata_id_has_dipm(dev->id)) { err_mask = ata_dev_set_feature(dev, SETFEATURES_SATA_ENABLE, SATA_DIPM); @@@ -3711,9 -3711,11 +3711,11 @@@ static int ata_eh_handle_dev_fail(struc case -ENODEV: /* device missing or wrong IDENTIFY data, schedule probing */ ehc->i.probe_mask |= (1 << dev->devno); + /* fall through */ case -EINVAL: /* give it just one more chance */ ehc->tries[dev->devno] = min(ehc->tries[dev->devno], 1); + /* fall through */ case -EIO: if (ehc->tries[dev->devno] == 1) { /* This is the last chance, better to slow diff --combined drivers/ata/libata.h index 08a245b76417,18bf1e995a18..f953cb4bb1ba --- a/drivers/ata/libata.h +++ b/drivers/ata/libata.h @@@ -51,7 -51,7 +51,7 @@@ extern int atapi_passthru16 extern int libata_fua; extern int libata_noacpi; extern int libata_allow_tpm; - extern struct device_type ata_port_type; + extern const struct device_type ata_port_type; extern struct ata_link *ata_dev_phys_link(struct ata_device *dev); extern void ata_force_cbl(struct ata_port *ap); extern u64 ata_tf_to_lba(const struct ata_taskfile *tf); @@@ -154,7 -154,7 +154,7 @@@ extern void ata_internal_cmd_timed_out( extern void ata_eh_acquire(struct ata_port *ap); extern void ata_eh_release(struct ata_port *ap); extern void ata_scsi_error(struct Scsi_Host *host); -extern void ata_eh_fastdrain_timerfn(unsigned long arg); +extern void ata_eh_fastdrain_timerfn(struct timer_list *t); extern void ata_qc_schedule_eh(struct ata_queued_cmd *qc); extern void ata_dev_disable(struct ata_device *dev); extern void ata_eh_detach_dev(struct ata_device *dev);