Commit 357397a1 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata

Pull libata changes from Tejun Heo:
 "Two interesting changes.

   - libata acpi handling has been restructured so that the association
     between ata devices and ACPI handles are less convoluted.  This
     change shouldn't change visible behavior.

   - Queued TRIM support, which enables sending TRIM to the device
     without draining in-flight RW commands, is added.  Currently only
     enabled for ahci (and likely to stay that way for the foreseeable
     future).

  Other changes are driver-specific updates / fixes"

* 'for-3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata:
  libata: bugfix: Remove __le32 in ata_tf_to_fis()
  libata: acpi: Remove ata_dev_acpi_handle stub in libata.h
  libata: Add support for queued DSM TRIM
  libata: Add support for SEND/RECEIVE FPDMA QUEUED
  libata: Add H2D FIS "auxiliary" port flag
  libata: Populate host-to-device FIS "auxiliary" field
  ata: acpi: rework the ata acpi bind support
  sata, highbank: send extra clock cycles in SGPIO patterns
  sata, highbank: set tx_atten override bits
  devicetree: create a separate binding description for sata_highbank
  drivers/ata/sata_rcar.c: simplify use of devm_ioremap_resource
  sata highbank: enable 64-bit DMA mask when using LPAE
  ata: pata_samsung_cf: add missing __iomem annotation
  ata: pata_arasan: Staticize local symbols
  sata_mv: Remove unneeded CONFIG_HAVE_CLK ifdefs
  ata: use dev_get_platdata()
  sata_mv: Remove unneeded forward declaration
  libata: acpi: remove dead code for ata_acpi_(un)bind
  libata: move 'struct ata_taskfile' and friends from ata.h to libata.h
parents 9ee52a16 86a565e6
...@@ -4,27 +4,17 @@ SATA nodes are defined to describe on-chip Serial ATA controllers. ...@@ -4,27 +4,17 @@ SATA nodes are defined to describe on-chip Serial ATA controllers.
Each SATA controller should have its own node. Each SATA controller should have its own node.
Required properties: Required properties:
- compatible : compatible list, contains "calxeda,hb-ahci" or "snps,spear-ahci" - compatible : compatible list, contains "snps,spear-ahci"
- interrupts : <interrupt mapping for SATA IRQ> - interrupts : <interrupt mapping for SATA IRQ>
- reg : <registers mapping> - reg : <registers mapping>
Optional properties: Optional properties:
- calxeda,port-phys: phandle-combophy and lane assignment, which maps each
SATA port to a combophy and a lane within that
combophy
- calxeda,sgpio-gpio: phandle-gpio bank, bit offset, and default on or off,
which indicates that the driver supports SGPIO
indicator lights using the indicated GPIOs
- calxeda,led-order : a u32 array that map port numbers to offsets within the
SGPIO bitstream.
- dma-coherent : Present if dma operations are coherent - dma-coherent : Present if dma operations are coherent
Example: Example:
sata@ffe08000 { sata@ffe08000 {
compatible = "calxeda,hb-ahci"; compatible = "snps,spear-ahci";
reg = <0xffe08000 0x1000>; reg = <0xffe08000 0x1000>;
interrupts = <115>; interrupts = <115>;
calxeda,port-phys = <&combophy5 0 &combophy0 0 &combophy0 1
&combophy0 2 &combophy0 3>;
}; };
* Calxeda AHCI SATA Controller
SATA nodes are defined to describe on-chip Serial ATA controllers.
The Calxeda SATA controller mostly conforms to the AHCI interface
with some special extensions to add functionality.
Each SATA controller should have its own node.
Required properties:
- compatible : compatible list, contains "calxeda,hb-ahci"
- interrupts : <interrupt mapping for SATA IRQ>
- reg : <registers mapping>
Optional properties:
- dma-coherent : Present if dma operations are coherent
- calxeda,port-phys : phandle-combophy and lane assignment, which maps each
SATA port to a combophy and a lane within that
combophy
- calxeda,sgpio-gpio: phandle-gpio bank, bit offset, and default on or off,
which indicates that the driver supports SGPIO
indicator lights using the indicated GPIOs
- calxeda,led-order : a u32 array that map port numbers to offsets within the
SGPIO bitstream.
- calxeda,tx-atten : a u32 array that contains TX attenuation override
codes, one per port. The upper 3 bytes are always
0 and thus ignored.
- calxeda,pre-clocks : a u32 that indicates the number of additional clock
cycles to transmit before sending an SGPIO pattern
- calxeda,post-clocks: a u32 that indicates the number of additional clock
cycles to transmit after sending an SGPIO pattern
Example:
sata@ffe08000 {
compatible = "calxeda,hb-ahci";
reg = <0xffe08000 0x1000>;
interrupts = <115>;
dma-coherent;
calxeda,port-phys = <&combophy5 0 &combophy0 0 &combophy0 1
&combophy0 2 &combophy0 3>;
calxeda,sgpio-gpio =<&gpioh 5 1 &gpioh 6 1 &gpioh 7 1>;
calxeda,led-order = <4 0 1 2 3>;
calxeda,tx-atten = <0xff 22 0xff 0xff 23>;
calxeda,pre-clocks = <10>;
calxeda,post-clocks = <0>;
};
...@@ -1295,6 +1295,14 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1295,6 +1295,14 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
*/ */
if (!(hpriv->flags & AHCI_HFLAG_NO_FPDMA_AA)) if (!(hpriv->flags & AHCI_HFLAG_NO_FPDMA_AA))
pi.flags |= ATA_FLAG_FPDMA_AA; pi.flags |= ATA_FLAG_FPDMA_AA;
/*
* All AHCI controllers should be forward-compatible
* with the new auxiliary field. This code should be
* conditionalized if any buggy AHCI controllers are
* encountered.
*/
pi.flags |= ATA_FLAG_FPDMA_AUX;
} }
if (hpriv->cap & HOST_CAP_PMP) if (hpriv->cap & HOST_CAP_PMP)
......
This diff is collapsed.
...@@ -569,10 +569,10 @@ void ata_tf_to_fis(const struct ata_taskfile *tf, u8 pmp, int is_cmd, u8 *fis) ...@@ -569,10 +569,10 @@ void ata_tf_to_fis(const struct ata_taskfile *tf, u8 pmp, int is_cmd, u8 *fis)
fis[14] = 0; fis[14] = 0;
fis[15] = tf->ctl; fis[15] = tf->ctl;
fis[16] = 0; fis[16] = tf->auxiliary & 0xff;
fis[17] = 0; fis[17] = (tf->auxiliary >> 8) & 0xff;
fis[18] = 0; fis[18] = (tf->auxiliary >> 16) & 0xff;
fis[19] = 0; fis[19] = (tf->auxiliary >> 24) & 0xff;
} }
/** /**
...@@ -2139,6 +2139,22 @@ static int ata_dev_config_ncq(struct ata_device *dev, ...@@ -2139,6 +2139,22 @@ static int ata_dev_config_ncq(struct ata_device *dev,
else else
snprintf(desc, desc_sz, "NCQ (depth %d/%d)%s", hdepth, snprintf(desc, desc_sz, "NCQ (depth %d/%d)%s", hdepth,
ddepth, aa_desc); ddepth, aa_desc);
if ((ap->flags & ATA_FLAG_FPDMA_AUX) &&
ata_id_has_ncq_send_and_recv(dev->id)) {
err_mask = ata_read_log_page(dev, ATA_LOG_NCQ_SEND_RECV,
0, ap->sector_buf, 1);
if (err_mask) {
ata_dev_dbg(dev,
"failed to get NCQ Send/Recv Log Emask 0x%x\n",
err_mask);
} else {
dev->flags |= ATA_DFLAG_NCQ_SEND_RECV;
memcpy(dev->ncq_send_recv_cmds, ap->sector_buf,
ATA_LOG_NCQ_SEND_RECV_SIZE);
}
}
return 0; return 0;
} }
...@@ -6150,8 +6166,6 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht) ...@@ -6150,8 +6166,6 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht)
if (rc) if (rc)
goto err_tadd; goto err_tadd;
ata_acpi_hotplug_init(host);
/* set cable, sata_spd_limit and report */ /* set cable, sata_spd_limit and report */
for (i = 0; i < host->n_ports; i++) { for (i = 0; i < host->n_ports; i++) {
struct ata_port *ap = host->ports[i]; struct ata_port *ap = host->ports[i];
...@@ -6632,8 +6646,6 @@ static int __init ata_init(void) ...@@ -6632,8 +6646,6 @@ static int __init ata_init(void)
ata_parse_force_param(); ata_parse_force_param();
ata_acpi_register();
rc = ata_sff_init(); rc = ata_sff_init();
if (rc) { if (rc) {
kfree(ata_force_tbl); kfree(ata_force_tbl);
...@@ -6660,7 +6672,6 @@ static void __exit ata_exit(void) ...@@ -6660,7 +6672,6 @@ static void __exit ata_exit(void)
ata_release_transport(ata_scsi_transport_template); ata_release_transport(ata_scsi_transport_template);
libata_transport_exit(); libata_transport_exit();
ata_sff_exit(); ata_sff_exit();
ata_acpi_unregister();
kfree(ata_force_tbl); kfree(ata_force_tbl);
} }
......
...@@ -49,7 +49,6 @@ ...@@ -49,7 +49,6 @@
#include <linux/hdreg.h> #include <linux/hdreg.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <linux/suspend.h> #include <linux/suspend.h>
#include <linux/pm_qos.h>
#include <asm/unaligned.h> #include <asm/unaligned.h>
#include "libata.h" #include "libata.h"
...@@ -3100,12 +3099,25 @@ static unsigned int ata_scsi_write_same_xlat(struct ata_queued_cmd *qc) ...@@ -3100,12 +3099,25 @@ static unsigned int ata_scsi_write_same_xlat(struct ata_queued_cmd *qc)
buf = page_address(sg_page(scsi_sglist(scmd))); buf = page_address(sg_page(scsi_sglist(scmd)));
size = ata_set_lba_range_entries(buf, 512, block, n_block); size = ata_set_lba_range_entries(buf, 512, block, n_block);
tf->protocol = ATA_PROT_DMA; if (ata_ncq_enabled(dev) && ata_fpdma_dsm_supported(dev)) {
tf->hob_feature = 0; /* Newer devices support queued TRIM commands */
tf->feature = ATA_DSM_TRIM; tf->protocol = ATA_PROT_NCQ;
tf->hob_nsect = (size / 512) >> 8; tf->command = ATA_CMD_FPDMA_SEND;
tf->nsect = size / 512; tf->hob_nsect = ATA_SUBCMD_FPDMA_SEND_DSM & 0x1f;
tf->command = ATA_CMD_DSM; tf->nsect = qc->tag << 3;
tf->hob_feature = (size / 512) >> 8;
tf->feature = size / 512;
tf->auxiliary = 1;
} else {
tf->protocol = ATA_PROT_DMA;
tf->hob_feature = 0;
tf->feature = ATA_DSM_TRIM;
tf->hob_nsect = (size / 512) >> 8;
tf->nsect = size / 512;
tf->command = ATA_CMD_DSM;
}
tf->flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE | ATA_TFLAG_LBA48 | tf->flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE | ATA_TFLAG_LBA48 |
ATA_TFLAG_WRITE; ATA_TFLAG_WRITE;
...@@ -3667,9 +3679,7 @@ void ata_scsi_scan_host(struct ata_port *ap, int sync) ...@@ -3667,9 +3679,7 @@ void ata_scsi_scan_host(struct ata_port *ap, int sync)
if (!IS_ERR(sdev)) { if (!IS_ERR(sdev)) {
dev->sdev = sdev; dev->sdev = sdev;
scsi_device_put(sdev); scsi_device_put(sdev);
if (zpodd_dev_enabled(dev)) ata_scsi_acpi_bind(dev);
dev_pm_qos_expose_flags(
&sdev->sdev_gendev, 0);
} else { } else {
dev->sdev = NULL; dev->sdev = NULL;
} }
...@@ -3757,6 +3767,8 @@ static void ata_scsi_remove_dev(struct ata_device *dev) ...@@ -3757,6 +3767,8 @@ static void ata_scsi_remove_dev(struct ata_device *dev)
struct scsi_device *sdev; struct scsi_device *sdev;
unsigned long flags; unsigned long flags;
ata_scsi_acpi_unbind(dev);
/* Alas, we need to grab scan_mutex to ensure SCSI device /* Alas, we need to grab scan_mutex to ensure SCSI device
* state doesn't change underneath us and thus * state doesn't change underneath us and thus
* scsi_device_get() always succeeds. The mutex locking can * scsi_device_get() always succeeds. The mutex locking can
...@@ -3766,9 +3778,6 @@ static void ata_scsi_remove_dev(struct ata_device *dev) ...@@ -3766,9 +3778,6 @@ static void ata_scsi_remove_dev(struct ata_device *dev)
mutex_lock(&ap->scsi_host->scan_mutex); mutex_lock(&ap->scsi_host->scan_mutex);
spin_lock_irqsave(ap->lock, flags); spin_lock_irqsave(ap->lock, flags);
if (zpodd_dev_enabled(dev))
zpodd_exit(dev);
/* clearing dev->sdev is protected by host lock */ /* clearing dev->sdev is protected by host lock */
sdev = dev->sdev; sdev = dev->sdev;
dev->sdev = NULL; dev->sdev = NULL;
...@@ -3818,6 +3827,9 @@ static void ata_scsi_handle_link_detach(struct ata_link *link) ...@@ -3818,6 +3827,9 @@ static void ata_scsi_handle_link_detach(struct ata_link *link)
dev->flags &= ~ATA_DFLAG_DETACHED; dev->flags &= ~ATA_DFLAG_DETACHED;
spin_unlock_irqrestore(ap->lock, flags); spin_unlock_irqrestore(ap->lock, flags);
if (zpodd_dev_enabled(dev))
zpodd_exit(dev);
ata_scsi_remove_dev(dev); ata_scsi_remove_dev(dev);
} }
} }
......
...@@ -287,6 +287,7 @@ int ata_tport_add(struct device *parent, ...@@ -287,6 +287,7 @@ int ata_tport_add(struct device *parent,
dev->release = ata_tport_release; dev->release = ata_tport_release;
dev_set_name(dev, "ata%d", ap->print_id); dev_set_name(dev, "ata%d", ap->print_id);
transport_setup_device(dev); transport_setup_device(dev);
ata_acpi_bind_port(ap);
error = device_add(dev); error = device_add(dev);
if (error) { if (error) {
goto tport_err; goto tport_err;
...@@ -644,6 +645,7 @@ static int ata_tdev_add(struct ata_device *ata_dev) ...@@ -644,6 +645,7 @@ static int ata_tdev_add(struct ata_device *ata_dev)
dev_set_name(dev, "dev%d.%d.0", ap->print_id, link->pmp); dev_set_name(dev, "dev%d.%d.0", ap->print_id, link->pmp);
transport_setup_device(dev); transport_setup_device(dev);
ata_acpi_bind_dev(ata_dev);
error = device_add(dev); error = device_add(dev);
if (error) { if (error) {
ata_tdev_free(ata_dev); ata_tdev_free(ata_dev);
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#include <linux/cdrom.h> #include <linux/cdrom.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/pm_qos.h>
#include <scsi/scsi_device.h> #include <scsi/scsi_device.h>
#include "libata.h" #include "libata.h"
...@@ -190,8 +191,8 @@ void zpodd_enable_run_wake(struct ata_device *dev) ...@@ -190,8 +191,8 @@ void zpodd_enable_run_wake(struct ata_device *dev)
sdev_disable_disk_events(dev->sdev); sdev_disable_disk_events(dev->sdev);
zpodd->powered_off = true; zpodd->powered_off = true;
device_set_run_wake(&dev->sdev->sdev_gendev, true); device_set_run_wake(&dev->tdev, true);
acpi_pm_device_run_wake(&dev->sdev->sdev_gendev, true); acpi_pm_device_run_wake(&dev->tdev, true);
} }
/* Disable runtime wake capability if it is enabled */ /* Disable runtime wake capability if it is enabled */
...@@ -200,8 +201,8 @@ void zpodd_disable_run_wake(struct ata_device *dev) ...@@ -200,8 +201,8 @@ void zpodd_disable_run_wake(struct ata_device *dev)
struct zpodd *zpodd = dev->zpodd; struct zpodd *zpodd = dev->zpodd;
if (zpodd->powered_off) { if (zpodd->powered_off) {
acpi_pm_device_run_wake(&dev->sdev->sdev_gendev, false); acpi_pm_device_run_wake(&dev->tdev, false);
device_set_run_wake(&dev->sdev->sdev_gendev, false); device_set_run_wake(&dev->tdev, false);
} }
} }
...@@ -262,7 +263,7 @@ static void ata_acpi_add_pm_notifier(struct ata_device *dev) ...@@ -262,7 +263,7 @@ static void ata_acpi_add_pm_notifier(struct ata_device *dev)
static void ata_acpi_remove_pm_notifier(struct ata_device *dev) static void ata_acpi_remove_pm_notifier(struct ata_device *dev)
{ {
acpi_handle handle = DEVICE_ACPI_HANDLE(&dev->sdev->sdev_gendev); acpi_handle handle = ata_dev_acpi_handle(dev);
acpi_remove_notify_handler(handle, ACPI_SYSTEM_NOTIFY, zpodd_wake_dev); acpi_remove_notify_handler(handle, ACPI_SYSTEM_NOTIFY, zpodd_wake_dev);
} }
...@@ -290,6 +291,7 @@ void zpodd_init(struct ata_device *dev) ...@@ -290,6 +291,7 @@ void zpodd_init(struct ata_device *dev)
ata_acpi_add_pm_notifier(dev); ata_acpi_add_pm_notifier(dev);
zpodd->dev = dev; zpodd->dev = dev;
dev->zpodd = zpodd; dev->zpodd = zpodd;
dev_pm_qos_expose_flags(&dev->tdev, 0);
} }
void zpodd_exit(struct ata_device *dev) void zpodd_exit(struct ata_device *dev)
......
...@@ -118,11 +118,11 @@ extern void ata_acpi_on_resume(struct ata_port *ap); ...@@ -118,11 +118,11 @@ extern void ata_acpi_on_resume(struct ata_port *ap);
extern int ata_acpi_on_devcfg(struct ata_device *dev); extern int ata_acpi_on_devcfg(struct ata_device *dev);
extern void ata_acpi_on_disable(struct ata_device *dev); extern void ata_acpi_on_disable(struct ata_device *dev);
extern void ata_acpi_set_state(struct ata_port *ap, pm_message_t state); extern void ata_acpi_set_state(struct ata_port *ap, pm_message_t state);
extern int ata_acpi_register(void); extern void ata_acpi_bind_port(struct ata_port *ap);
extern void ata_acpi_unregister(void); extern void ata_acpi_bind_dev(struct ata_device *dev);
extern void ata_acpi_bind(struct ata_device *dev); extern acpi_handle ata_dev_acpi_handle(struct ata_device *dev);
extern void ata_acpi_unbind(struct ata_device *dev); extern void ata_scsi_acpi_bind(struct ata_device *dev);
extern void ata_acpi_hotplug_init(struct ata_host *host); extern void ata_scsi_acpi_unbind(struct ata_device *dev);
#else #else
static inline void ata_acpi_dissociate(struct ata_host *host) { } static inline void ata_acpi_dissociate(struct ata_host *host) { }
static inline int ata_acpi_on_suspend(struct ata_port *ap) { return 0; } static inline int ata_acpi_on_suspend(struct ata_port *ap) { return 0; }
...@@ -131,11 +131,10 @@ static inline int ata_acpi_on_devcfg(struct ata_device *dev) { return 0; } ...@@ -131,11 +131,10 @@ static inline int ata_acpi_on_devcfg(struct ata_device *dev) { return 0; }
static inline void ata_acpi_on_disable(struct ata_device *dev) { } static inline void ata_acpi_on_disable(struct ata_device *dev) { }
static inline void ata_acpi_set_state(struct ata_port *ap, static inline void ata_acpi_set_state(struct ata_port *ap,
pm_message_t state) { } pm_message_t state) { }
static inline int ata_acpi_register(void) { return 0; } static inline void ata_acpi_bind_port(struct ata_port *ap) {}
static inline void ata_acpi_unregister(void) { } static inline void ata_acpi_bind_dev(struct ata_device *dev) {}
static inline void ata_acpi_bind(struct ata_device *dev) { } static inline void ata_scsi_acpi_bind(struct ata_device *dev) {}
static inline void ata_acpi_unbind(struct ata_device *dev) { } static inline void ata_scsi_acpi_unbind(struct ata_device *dev) {}
static inline void ata_acpi_hotplug_init(struct ata_host *host) {}
#endif #endif
/* libata-scsi.c */ /* libata-scsi.c */
......
...@@ -39,7 +39,7 @@ static int pacpi_pre_reset(struct ata_link *link, unsigned long deadline) ...@@ -39,7 +39,7 @@ static int pacpi_pre_reset(struct ata_link *link, unsigned long deadline)
{ {
struct ata_port *ap = link->ap; struct ata_port *ap = link->ap;
struct pata_acpi *acpi = ap->private_data; struct pata_acpi *acpi = ap->private_data;
if (ata_ap_acpi_handle(ap) == NULL || ata_acpi_gtm(ap, &acpi->gtm) < 0) if (ACPI_HANDLE(&ap->tdev) == NULL || ata_acpi_gtm(ap, &acpi->gtm) < 0)
return -ENODEV; return -ENODEV;
return ata_sff_prereset(link, deadline); return ata_sff_prereset(link, deadline);
...@@ -195,7 +195,7 @@ static int pacpi_port_start(struct ata_port *ap) ...@@ -195,7 +195,7 @@ static int pacpi_port_start(struct ata_port *ap)
struct pci_dev *pdev = to_pci_dev(ap->host->dev); struct pci_dev *pdev = to_pci_dev(ap->host->dev);
struct pata_acpi *acpi; struct pata_acpi *acpi;
if (ata_ap_acpi_handle(ap) == NULL) if (ACPI_HANDLE(&ap->tdev) == NULL)
return -ENODEV; return -ENODEV;
acpi = ap->private_data = devm_kzalloc(&pdev->dev, sizeof(struct pata_acpi), GFP_KERNEL); acpi = ap->private_data = devm_kzalloc(&pdev->dev, sizeof(struct pata_acpi), GFP_KERNEL);
......
...@@ -654,7 +654,7 @@ static void arasan_cf_freeze(struct ata_port *ap) ...@@ -654,7 +654,7 @@ static void arasan_cf_freeze(struct ata_port *ap)
ata_sff_freeze(ap); ata_sff_freeze(ap);
} }
void arasan_cf_error_handler(struct ata_port *ap) static void arasan_cf_error_handler(struct ata_port *ap)
{ {
struct arasan_cf_dev *acdev = ap->host->private_data; struct arasan_cf_dev *acdev = ap->host->private_data;
...@@ -683,7 +683,7 @@ static void arasan_cf_dma_start(struct arasan_cf_dev *acdev) ...@@ -683,7 +683,7 @@ static void arasan_cf_dma_start(struct arasan_cf_dev *acdev)
ata_sff_queue_work(&acdev->work); ata_sff_queue_work(&acdev->work);
} }
unsigned int arasan_cf_qc_issue(struct ata_queued_cmd *qc) static unsigned int arasan_cf_qc_issue(struct ata_queued_cmd *qc)
{ {
struct ata_port *ap = qc->ap; struct ata_port *ap = qc->ap;
struct arasan_cf_dev *acdev = ap->host->private_data; struct arasan_cf_dev *acdev = ap->host->private_data;
......
...@@ -271,7 +271,7 @@ static int __init pata_at32_probe(struct platform_device *pdev) ...@@ -271,7 +271,7 @@ static int __init pata_at32_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct at32_ide_info *info; struct at32_ide_info *info;
struct ide_platform_data *board = pdev->dev.platform_data; struct ide_platform_data *board = dev_get_platdata(&pdev->dev);
struct resource *res; struct resource *res;
int irq; int irq;
......
...@@ -315,7 +315,7 @@ static struct ata_port_operations pata_at91_port_ops = { ...@@ -315,7 +315,7 @@ static struct ata_port_operations pata_at91_port_ops = {
static int pata_at91_probe(struct platform_device *pdev) static int pata_at91_probe(struct platform_device *pdev)
{ {
struct at91_cf_data *board = pdev->dev.platform_data; struct at91_cf_data *board = dev_get_platdata(&pdev->dev);
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct at91_ide_info *info; struct at91_ide_info *info;
struct resource *mem_res; struct resource *mem_res;
......
...@@ -48,7 +48,7 @@ static unsigned int ixp4xx_mmio_data_xfer(struct ata_device *dev, ...@@ -48,7 +48,7 @@ static unsigned int ixp4xx_mmio_data_xfer(struct ata_device *dev,
u16 *buf16 = (u16 *) buf; u16 *buf16 = (u16 *) buf;
struct ata_port *ap = dev->link->ap; struct ata_port *ap = dev->link->ap;
void __iomem *mmio = ap->ioaddr.data_addr; void __iomem *mmio = ap->ioaddr.data_addr;
struct ixp4xx_pata_data *data = ap->host->dev->platform_data; struct ixp4xx_pata_data *data = dev_get_platdata(ap->host->dev);
/* set the expansion bus in 16bit mode and restore /* set the expansion bus in 16bit mode and restore
* 8 bit mode after the transaction. * 8 bit mode after the transaction.
...@@ -143,7 +143,7 @@ static int ixp4xx_pata_probe(struct platform_device *pdev) ...@@ -143,7 +143,7 @@ static int ixp4xx_pata_probe(struct platform_device *pdev)
struct resource *cs0, *cs1; struct resource *cs0, *cs1;
struct ata_host *host; struct ata_host *host;
struct ata_port *ap; struct ata_port *ap;
struct ixp4xx_pata_data *data = pdev->dev.platform_data; struct ixp4xx_pata_data *data = dev_get_platdata(&pdev->dev);
cs0 = platform_get_resource(pdev, IORESOURCE_MEM, 0); cs0 = platform_get_resource(pdev, IORESOURCE_MEM, 0);
cs1 = platform_get_resource(pdev, IORESOURCE_MEM, 1); cs1 = platform_get_resource(pdev, IORESOURCE_MEM, 1);
......
...@@ -1037,7 +1037,7 @@ static void octeon_cf_shutdown(struct device *dev) ...@@ -1037,7 +1037,7 @@ static void octeon_cf_shutdown(struct device *dev)
union cvmx_mio_boot_dma_cfgx dma_cfg; union cvmx_mio_boot_dma_cfgx dma_cfg;
union cvmx_mio_boot_dma_intx dma_int; union cvmx_mio_boot_dma_intx dma_int;
struct octeon_cf_port *cf_port = dev->platform_data; struct octeon_cf_port *cf_port = dev_get_platdata(dev);
if (cf_port->dma_base) { if (cf_port->dma_base) {
/* Stop and clear the dma engine. */ /* Stop and clear the dma engine. */
......
...@@ -180,7 +180,7 @@ static int pata_platform_probe(struct platform_device *pdev) ...@@ -180,7 +180,7 @@ static int pata_platform_probe(struct platform_device *pdev)
struct resource *io_res; struct resource *io_res;
struct resource *ctl_res; struct resource *ctl_res;
struct resource *irq_res; struct resource *irq_res;
struct pata_platform_info *pp_info = pdev->dev.platform_data; struct pata_platform_info *pp_info = dev_get_platdata(&pdev->dev);
/* /*
* Simple resource validation .. * Simple resource validation ..
......
...@@ -238,7 +238,7 @@ static int pxa_ata_probe(struct platform_device *pdev) ...@@ -238,7 +238,7 @@ static int pxa_ata_probe(struct platform_device *pdev)
struct resource *ctl_res; struct resource *ctl_res;
struct resource *dma_res; struct resource *dma_res;
struct resource *irq_res; struct resource *irq_res;
struct pata_pxa_pdata *pdata = pdev->dev.platform_data; struct pata_pxa_pdata *pdata = dev_get_platdata(&pdev->dev);
int ret = 0; int ret = 0;
/* /*
......
...@@ -241,8 +241,8 @@ static u8 pata_s3c_check_altstatus(struct ata_port *ap) ...@@ -241,8 +241,8 @@ static u8 pata_s3c_check_altstatus(struct ata_port *ap)
/* /*
* pata_s3c_data_xfer - Transfer data by PIO * pata_s3c_data_xfer - Transfer data by PIO
*/ */
unsigned int pata_s3c_data_xfer(struct ata_device *dev, unsigned char *buf, static unsigned int pata_s3c_data_xfer(struct ata_device *dev,
unsigned int buflen, int rw) unsigned char *buf, unsigned int buflen, int rw)
{ {
struct ata_port *ap = dev->link->ap; struct ata_port *ap = dev->link->ap;
struct s3c_ide_info *info = ap->host->private_data; struct s3c_ide_info *info = ap->host->private_data;
...@@ -418,7 +418,7 @@ static struct ata_port_operations pata_s5p_port_ops = { ...@@ -418,7 +418,7 @@ static struct ata_port_operations pata_s5p_port_ops = {
.set_piomode = pata_s3c_set_piomode, .set_piomode = pata_s3c_set_piomode,
}; };
static void pata_s3c_enable(void *s3c_ide_regbase, bool state) static void pata_s3c_enable(void __iomem *s3c_ide_regbase, bool state)
{ {
u32 temp = readl(s3c_ide_regbase + S3C_ATA_CTRL); u32 temp = readl(s3c_ide_regbase + S3C_ATA_CTRL);
temp = state ? (temp | 1) : (temp & ~1); temp = state ? (temp | 1) : (temp & ~1);
...@@ -475,7 +475,7 @@ static void pata_s3c_hwinit(struct s3c_ide_info *info, ...@@ -475,7 +475,7 @@ static void pata_s3c_hwinit(struct s3c_ide_info *info,
static int __init pata_s3c_probe(struct platform_device *pdev) static int __init pata_s3c_probe(struct platform_device *pdev)
{ {
struct s3c_ide_platdata *pdata = pdev->dev.platform_data; struct s3c_ide_platdata *pdata = dev_get_platdata(&pdev->dev);
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct s3c_ide_info *info; struct s3c_ide_info *info;
struct resource *res; struct resource *res;
...@@ -617,7 +617,7 @@ static int pata_s3c_resume(struct device *dev) ...@@ -617,7 +617,7 @@ static int pata_s3c_resume(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct ata_host *host = platform_get_drvdata(pdev); struct ata_host *host = platform_get_drvdata(pdev);
struct s3c_ide_platdata *pdata = pdev->dev.platform_data; struct s3c_ide_platdata *pdata = dev_get_platdata(&pdev->dev);
struct s3c_ide_info *info = host->private_data; struct s3c_ide_info *info = host->private_data;
pata_s3c_hwinit(info, pdata); pata_s3c_hwinit(info, pdata);
......
...@@ -46,14 +46,19 @@ ...@@ -46,14 +46,19 @@
#define CR_BUSY 0x0001 #define CR_BUSY 0x0001
#define CR_START 0x0001 #define CR_START 0x0001
#define CR_WR_RDN 0x0002 #define CR_WR_RDN 0x0002
#define CPHY_TX_INPUT_STS 0x2001
#define CPHY_RX_INPUT_STS 0x2002 #define CPHY_RX_INPUT_STS 0x2002
#define CPHY_SATA_OVERRIDE 0x4000 #define CPHY_SATA_TX_OVERRIDE 0x8000
#define CPHY_OVERRIDE 0x2005 #define CPHY_SATA_RX_OVERRIDE 0x4000
#define CPHY_TX_OVERRIDE 0x2004
#define CPHY_RX_OVERRIDE 0x2005
#define SPHY_LANE 0x100 #define SPHY_LANE 0x100
#define SPHY_HALF_RATE 0x0001 #define SPHY_HALF_RATE 0x0001
#define CPHY_SATA_DPLL_MODE 0x0700 #define CPHY_SATA_DPLL_MODE 0x0700
#define CPHY_SATA_DPLL_SHIFT 8 #define CPHY_SATA_DPLL_SHIFT 8
#define CPHY_SATA_DPLL_RESET (1 << 11) #define CPHY_SATA_DPLL_RESET (1 << 11)
#define CPHY_SATA_TX_ATTEN 0x1c00
#define CPHY_SATA_TX_ATTEN_SHIFT 10
#define CPHY_PHY_COUNT 6 #define CPHY_PHY_COUNT 6
#define CPHY_LANE_COUNT 4 #define CPHY_LANE_COUNT 4
#define CPHY_PORT_COUNT (CPHY_PHY_COUNT * CPHY_LANE_COUNT) #define CPHY_PORT_COUNT (CPHY_PHY_COUNT * CPHY_LANE_COUNT)
...@@ -66,6 +71,7 @@ struct phy_lane_info { ...@@ -66,6 +71,7 @@ struct phy_lane_info {
void __iomem *phy_base; void __iomem *phy_base;
u8 lane_mapping; u8 lane_mapping;
u8 phy_devs; u8 phy_devs;
u8 tx_atten;
}; };
static struct phy_lane_info port_data[CPHY_PORT_COUNT]; static struct phy_lane_info port_data[CPHY_PORT_COUNT];
...@@ -76,9 +82,11 @@ static DEFINE_SPINLOCK(sgpio_lock); ...@@ -76,9 +82,11 @@ static DEFINE_SPINLOCK(sgpio_lock);
#define SGPIO_PINS 3 #define SGPIO_PINS 3
#define SGPIO_PORTS 8 #define SGPIO_PORTS 8
/* can be cast as an ahci_host_priv for compatibility with most functions */
struct ecx_plat_data { struct ecx_plat_data {
u32 n_ports; u32 n_ports;
/* number of extra clocks that the SGPIO PIC controller expects */
u32 pre_clocks;
u32 post_clocks;
unsigned sgpio_gpio[SGPIO_PINS]; unsigned sgpio_gpio[SGPIO_PINS];
u32 sgpio_pattern; u32 sgpio_pattern;
u32 port_to_sgpio[SGPIO_PORTS]; u32 port_to_sgpio[SGPIO_PORTS];
...@@ -155,6 +163,9 @@ static ssize_t ecx_transmit_led_message(struct ata_port *ap, u32 state, ...@@ -155,6 +163,9 @@ static ssize_t ecx_transmit_led_message(struct ata_port *ap, u32 state,
spin_lock_irqsave(&sgpio_lock, flags); spin_lock_irqsave(&sgpio_lock, flags);
ecx_parse_sgpio(pdata, ap->port_no, state); ecx_parse_sgpio(pdata, ap->port_no, state);
sgpio_out = pdata->sgpio_pattern; sgpio_out = pdata->sgpio_pattern;
for (i = 0; i < pdata->pre_clocks; i++)
ecx_led_cycle_clock(pdata);
gpio_set_value(pdata->sgpio_gpio[SLOAD], 1); gpio_set_value(pdata->sgpio_gpio[SLOAD], 1);
ecx_led_cycle_clock(pdata); ecx_led_cycle_clock(pdata);
gpio_set_value(pdata->sgpio_gpio[SLOAD], 0); gpio_set_value(pdata->sgpio_gpio[SLOAD], 0);
...@@ -167,6 +178,8 @@ static ssize_t ecx_transmit_led_message(struct ata_port *ap, u32 state, ...@@ -167,6 +178,8 @@ static ssize_t ecx_transmit_led_message(struct ata_port *ap, u32 state,
sgpio_out >>= 1; sgpio_out >>= 1;
ecx_led_cycle_clock(pdata); ecx_led_cycle_clock(pdata);
} }
for (i = 0; i < pdata->post_clocks; i++)
ecx_led_cycle_clock(pdata);
/* save off new led state for port/slot */ /* save off new led state for port/slot */
emp->led_state = state; emp->led_state = state;
...@@ -201,6 +214,11 @@ static void highbank_set_em_messages(struct device *dev, ...@@ -201,6 +214,11 @@ static void highbank_set_em_messages(struct device *dev,
of_property_read_u32_array(np, "calxeda,led-order", of_property_read_u32_array(np, "calxeda,led-order",
pdata->port_to_sgpio, pdata->port_to_sgpio,
pdata->n_ports); pdata->n_ports);
if (of_property_read_u32(np, "calxeda,pre-clocks", &pdata->pre_clocks))
pdata->pre_clocks = 0;
if (of_property_read_u32(np, "calxeda,post-clocks",
&pdata->post_clocks))
pdata->post_clocks = 0;
/* store em_loc */ /* store em_loc */
hpriv->em_loc = 0; hpriv->em_loc = 0;
...@@ -259,8 +277,27 @@ static void highbank_cphy_disable_overrides(u8 sata_port) ...@@ -259,8 +277,27 @@ static void highbank_cphy_disable_overrides(u8 sata_port)
if (unlikely(port_data[sata_port].phy_base == NULL)) if (unlikely(port_data[sata_port].phy_base == NULL))
return; return;
tmp = combo_phy_read(sata_port, CPHY_RX_INPUT_STS + lane * SPHY_LANE); tmp = combo_phy_read(sata_port, CPHY_RX_INPUT_STS + lane * SPHY_LANE);
tmp &= ~CPHY_SATA_OVERRIDE; tmp &= ~CPHY_SATA_RX_OVERRIDE;
combo_phy_write(sata_port, CPHY_OVERRIDE + lane * SPHY_LANE, tmp); combo_phy_write(sata_port, CPHY_RX_OVERRIDE + lane * SPHY_LANE, tmp);
}
static void cphy_override_tx_attenuation(u8 sata_port, u32 val)
{
u8 lane = port_data[sata_port].lane_mapping;
u32 tmp;
if (val & 0x8)
return;
tmp = combo_phy_read(sata_port, CPHY_TX_INPUT_STS + lane * SPHY_LANE);
tmp &= ~CPHY_SATA_TX_OVERRIDE;
combo_phy_write(sata_port, CPHY_TX_OVERRIDE + lane * SPHY_LANE, tmp);
tmp |= CPHY_SATA_TX_OVERRIDE;
combo_phy_write(sata_port, CPHY_TX_OVERRIDE + lane * SPHY_LANE, tmp);
tmp |= (val << CPHY_SATA_TX_ATTEN_SHIFT) & CPHY_SATA_TX_ATTEN;
combo_phy_write(sata_port, CPHY_TX_OVERRIDE + lane * SPHY_LANE, tmp);
} }
static void cphy_override_rx_mode(u8 sata_port, u32 val) static void cphy_override_rx_mode(u8 sata_port, u32 val)
...@@ -268,21 +305,21 @@ static void cphy_override_rx_mode(u8 sata_port, u32 val) ...@@ -268,21 +305,21 @@ static void cphy_override_rx_mode(u8 sata_port, u32 val)
u8 lane = port_data[sata_port].lane_mapping; u8 lane = port_data[sata_port].lane_mapping;
u32 tmp; u32 tmp;
tmp = combo_phy_read(sata_port, CPHY_RX_INPUT_STS + lane * SPHY_LANE); tmp = combo_phy_read(sata_port, CPHY_RX_INPUT_STS + lane * SPHY_LANE);
tmp &= ~CPHY_SATA_OVERRIDE; tmp &= ~CPHY_SATA_RX_OVERRIDE;
combo_phy_write(sata_port, CPHY_OVERRIDE + lane * SPHY_LANE, tmp); combo_phy_write(sata_port, CPHY_RX_OVERRIDE + lane * SPHY_LANE, tmp);
tmp |= CPHY_SATA_OVERRIDE; tmp |= CPHY_SATA_RX_OVERRIDE;
combo_phy_write(sata_port, CPHY_OVERRIDE + lane * SPHY_LANE, tmp); combo_phy_write(sata_port, CPHY_RX_OVERRIDE + lane * SPHY_LANE, tmp);
tmp &= ~CPHY_SATA_DPLL_MODE; tmp &= ~CPHY_SATA_DPLL_MODE;
tmp |= val << CPHY_SATA_DPLL_SHIFT; tmp |= val << CPHY_SATA_DPLL_SHIFT;
combo_phy_write(sata_port, CPHY_OVERRIDE + lane * SPHY_LANE, tmp); combo_phy_write(sata_port, CPHY_RX_OVERRIDE + lane * SPHY_LANE, tmp);
tmp |= CPHY_SATA_DPLL_RESET; tmp |= CPHY_SATA_DPLL_RESET;
combo_phy_write(sata_port, CPHY_OVERRIDE + lane * SPHY_LANE, tmp); combo_phy_write(sata_port, CPHY_RX_OVERRIDE + lane * SPHY_LANE, tmp);
tmp &= ~CPHY_SATA_DPLL_RESET; tmp &= ~CPHY_SATA_DPLL_RESET;
combo_phy_write(sata_port, CPHY_OVERRIDE + lane * SPHY_LANE, tmp); combo_phy_write(sata_port, CPHY_RX_OVERRIDE + lane * SPHY_LANE, tmp);
msleep(15); msleep(15);
} }
...@@ -299,16 +336,20 @@ static void highbank_cphy_override_lane(u8 sata_port) ...@@ -299,16 +336,20 @@ static void highbank_cphy_override_lane(u8 sata_port)
lane * SPHY_LANE); lane * SPHY_LANE);
} while ((tmp & SPHY_HALF_RATE) && (k++ < 1000)); } while ((tmp & SPHY_HALF_RATE) && (k++ < 1000));
cphy_override_rx_mode(sata_port, 3); cphy_override_rx_mode(sata_port, 3);
cphy_override_tx_attenuation(sata_port, port_data[sata_port].tx_atten);
} }
static int highbank_initialize_phys(struct device *dev, void __iomem *addr) static int highbank_initialize_phys(struct device *dev, void __iomem *addr)
{ {
struct device_node *sata_node = dev->of_node; struct device_node *sata_node = dev->of_node;
int phy_count = 0, phy, port = 0; int phy_count = 0, phy, port = 0, i;
void __iomem *cphy_base[CPHY_PHY_COUNT]; void __iomem *cphy_base[CPHY_PHY_COUNT];
struct device_node *phy_nodes[CPHY_PHY_COUNT]; struct device_node *phy_nodes[CPHY_PHY_COUNT];
u32 tx_atten[CPHY_PORT_COUNT];
memset(port_data, 0, sizeof(struct phy_lane_info) * CPHY_PORT_COUNT); memset(port_data, 0, sizeof(struct phy_lane_info) * CPHY_PORT_COUNT);
memset(phy_nodes, 0, sizeof(struct device_node*) * CPHY_PHY_COUNT); memset(phy_nodes, 0, sizeof(struct device_node*) * CPHY_PHY_COUNT);
memset(tx_atten, 0xff, CPHY_PORT_COUNT);
do { do {
u32 tmp; u32 tmp;
...@@ -336,6 +377,10 @@ static int highbank_initialize_phys(struct device *dev, void __iomem *addr) ...@@ -336,6 +377,10 @@ static int highbank_initialize_phys(struct device *dev, void __iomem *addr)
of_node_put(phy_data.np); of_node_put(phy_data.np);
port += 1; port += 1;
} while (port < CPHY_PORT_COUNT); } while (port < CPHY_PORT_COUNT);
of_property_read_u32_array(sata_node, "calxeda,tx-atten",
tx_atten, port);
for (i = 0; i < port; i++)
port_data[i].tx_atten = (u8) tx_atten[i];
return 0; return 0;
} }
...@@ -479,6 +524,9 @@ static int ahci_highbank_probe(struct platform_device *pdev) ...@@ -479,6 +524,9 @@ static int ahci_highbank_probe(struct platform_device *pdev)
if (hpriv->cap & HOST_CAP_PMP) if (hpriv->cap & HOST_CAP_PMP)
pi.flags |= ATA_FLAG_PMP; pi.flags |= ATA_FLAG_PMP;
if (hpriv->cap & HOST_CAP_64)
dma_set_coherent_mask(dev, DMA_BIT_MASK(64));
/* CAP.NP sometimes indicate the index of the last enabled /* CAP.NP sometimes indicate the index of the last enabled
* port, at other times, that of the last possible port, so * port, at other times, that of the last possible port, so
* determining the maximum port number requires looking at * determining the maximum port number requires looking at
......
...@@ -553,10 +553,15 @@ struct mv_host_priv { ...@@ -553,10 +553,15 @@ struct mv_host_priv {
u32 irq_mask_offset; u32 irq_mask_offset;
u32 unmask_all_irqs; u32 unmask_all_irqs;
#if defined(CONFIG_HAVE_CLK) /*
* Needed on some devices that require their clocks to be enabled.
* These are optional: if the platform device does not have any
* clocks, they won't be used. Also, if the underlying hardware
* does not support the common clock framework (CONFIG_HAVE_CLK=n),
* all the clock operations become no-ops (see clk.h).
*/
struct clk *clk; struct clk *clk;
struct clk **port_clks; struct clk **port_clks;
#endif
/* /*
* These consistent DMA memory pools give us guaranteed * These consistent DMA memory pools give us guaranteed
* alignment for hardware-accessed data structures, * alignment for hardware-accessed data structures,
...@@ -4032,9 +4037,7 @@ static int mv_platform_probe(struct platform_device *pdev) ...@@ -4032,9 +4037,7 @@ static int mv_platform_probe(struct platform_device *pdev)
struct resource *res; struct resource *res;
int n_ports = 0, irq = 0; int n_ports = 0, irq = 0;
int rc; int rc;
#if defined(CONFIG_HAVE_CLK)
int port; int port;
#endif
ata_print_version_once(&pdev->dev, DRV_VERSION); ata_print_version_once(&pdev->dev, DRV_VERSION);
...@@ -4058,7 +4061,7 @@ static int mv_platform_probe(struct platform_device *pdev) ...@@ -4058,7 +4061,7 @@ static int mv_platform_probe(struct platform_device *pdev)
of_property_read_u32(pdev->dev.of_node, "nr-ports", &n_ports); of_property_read_u32(pdev->dev.of_node, "nr-ports", &n_ports);
irq = irq_of_parse_and_map(pdev->dev.of_node, 0); irq = irq_of_parse_and_map(pdev->dev.of_node, 0);
} else { } else {
mv_platform_data = pdev->dev.platform_data; mv_platform_data = dev_get_platdata(&pdev->dev);
n_ports = mv_platform_data->n_ports; n_ports = mv_platform_data->n_ports;
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
} }
...@@ -4068,13 +4071,11 @@ static int mv_platform_probe(struct platform_device *pdev) ...@@ -4068,13 +4071,11 @@ static int mv_platform_probe(struct platform_device *pdev)
if (!host || !hpriv) if (!host || !hpriv)
return -ENOMEM; return -ENOMEM;
#if defined(CONFIG_HAVE_CLK)
hpriv->port_clks = devm_kzalloc(&pdev->dev, hpriv->port_clks = devm_kzalloc(&pdev->dev,
sizeof(struct clk *) * n_ports, sizeof(struct clk *) * n_ports,
GFP_KERNEL); GFP_KERNEL);
if (!hpriv->port_clks) if (!hpriv->port_clks)
return -ENOMEM; return -ENOMEM;
#endif
host->private_data = hpriv; host->private_data = hpriv;
hpriv->n_ports = n_ports; hpriv->n_ports = n_ports;
hpriv->board_idx = chip_soc; hpriv->board_idx = chip_soc;
...@@ -4084,7 +4085,6 @@ static int mv_platform_probe(struct platform_device *pdev) ...@@ -4084,7 +4085,6 @@ static int mv_platform_probe(struct platform_device *pdev)
resource_size(res)); resource_size(res));
hpriv->base -= SATAHC0_REG_BASE; hpriv->base -= SATAHC0_REG_BASE;
#if defined(CONFIG_HAVE_CLK)
hpriv->clk = clk_get(&pdev->dev, NULL); hpriv->clk = clk_get(&pdev->dev, NULL);
if (IS_ERR(hpriv->clk)) if (IS_ERR(hpriv->clk))
dev_notice(&pdev->dev, "cannot get optional clkdev\n"); dev_notice(&pdev->dev, "cannot get optional clkdev\n");
...@@ -4098,7 +4098,6 @@ static int mv_platform_probe(struct platform_device *pdev) ...@@ -4098,7 +4098,6 @@ static int mv_platform_probe(struct platform_device *pdev)
if (!IS_ERR(hpriv->port_clks[port])) if (!IS_ERR(hpriv->port_clks[port]))
clk_prepare_enable(hpriv->port_clks[port]); clk_prepare_enable(hpriv->port_clks[port]);
} }
#endif
/* /*
* (Re-)program MBUS remapping windows if we are asked to. * (Re-)program MBUS remapping windows if we are asked to.
...@@ -4124,7 +4123,6 @@ static int mv_platform_probe(struct platform_device *pdev) ...@@ -4124,7 +4123,6 @@ static int mv_platform_probe(struct platform_device *pdev)
return 0; return 0;
err: err:
#if defined(CONFIG_HAVE_CLK)
if (!IS_ERR(hpriv->clk)) { if (!IS_ERR(hpriv->clk)) {
clk_disable_unprepare(hpriv->clk); clk_disable_unprepare(hpriv->clk);
clk_put(hpriv->clk); clk_put(hpriv->clk);
...@@ -4135,7 +4133,6 @@ static int mv_platform_probe(struct platform_device *pdev) ...@@ -4135,7 +4133,6 @@ static int mv_platform_probe(struct platform_device *pdev)
clk_put(hpriv->port_clks[port]); clk_put(hpriv->port_clks[port]);
} }
} }
#endif
return rc; return rc;
} }
...@@ -4151,13 +4148,10 @@ static int mv_platform_probe(struct platform_device *pdev) ...@@ -4151,13 +4148,10 @@ static int mv_platform_probe(struct platform_device *pdev)
static int mv_platform_remove(struct platform_device *pdev) static int mv_platform_remove(struct platform_device *pdev)
{ {
struct ata_host *host = platform_get_drvdata(pdev); struct ata_host *host = platform_get_drvdata(pdev);
#if defined(CONFIG_HAVE_CLK)
struct mv_host_priv *hpriv = host->private_data; struct mv_host_priv *hpriv = host->private_data;
int port; int port;
#endif
ata_host_detach(host); ata_host_detach(host);
#if defined(CONFIG_HAVE_CLK)
if (!IS_ERR(hpriv->clk)) { if (!IS_ERR(hpriv->clk)) {
clk_disable_unprepare(hpriv->clk); clk_disable_unprepare(hpriv->clk);
clk_put(hpriv->clk); clk_put(hpriv->clk);
...@@ -4168,7 +4162,6 @@ static int mv_platform_remove(struct platform_device *pdev) ...@@ -4168,7 +4162,6 @@ static int mv_platform_remove(struct platform_device *pdev)
clk_put(hpriv->port_clks[port]); clk_put(hpriv->port_clks[port]);
} }
} }
#endif
return 0; return 0;
} }
...@@ -4428,9 +4421,6 @@ static int mv_pci_device_resume(struct pci_dev *pdev) ...@@ -4428,9 +4421,6 @@ static int mv_pci_device_resume(struct pci_dev *pdev)
#endif #endif
#endif #endif
static int mv_platform_probe(struct platform_device *pdev);
static int mv_platform_remove(struct platform_device *pdev);
static int __init mv_init(void) static int __init mv_init(void)
{ {
int rc = -ENODEV; int rc = -ENODEV;
......
...@@ -778,10 +778,6 @@ static int sata_rcar_probe(struct platform_device *pdev) ...@@ -778,10 +778,6 @@ static int sata_rcar_probe(struct platform_device *pdev)
int irq; int irq;
int ret = 0; int ret = 0;
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (mem == NULL)
return -EINVAL;
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq <= 0) if (irq <= 0)
return -EINVAL; return -EINVAL;
...@@ -807,6 +803,7 @@ static int sata_rcar_probe(struct platform_device *pdev) ...@@ -807,6 +803,7 @@ static int sata_rcar_probe(struct platform_device *pdev)
host->private_data = priv; host->private_data = priv;
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
priv->base = devm_ioremap_resource(&pdev->dev, mem); priv->base = devm_ioremap_resource(&pdev->dev, mem);
if (IS_ERR(priv->base)) { if (IS_ERR(priv->base)) {
ret = PTR_ERR(priv->base); ret = PTR_ERR(priv->base);
......
...@@ -68,28 +68,6 @@ static struct scsi_host_sg_pool scsi_sg_pools[] = { ...@@ -68,28 +68,6 @@ static struct scsi_host_sg_pool scsi_sg_pools[] = {
struct kmem_cache *scsi_sdb_cache; struct kmem_cache *scsi_sdb_cache;
#ifdef CONFIG_ACPI
#include <acpi/acpi_bus.h>
static bool acpi_scsi_bus_match(struct device *dev)
{
return dev->bus == &scsi_bus_type;
}
int scsi_register_acpi_bus_type(struct acpi_bus_type *bus)
{
bus->match = acpi_scsi_bus_match;
return register_acpi_bus_type(bus);
}
EXPORT_SYMBOL_GPL(scsi_register_acpi_bus_type);
void scsi_unregister_acpi_bus_type(struct acpi_bus_type *bus)
{
unregister_acpi_bus_type(bus);
}
EXPORT_SYMBOL_GPL(scsi_unregister_acpi_bus_type);
#endif
/* /*
* When to reinvoke queueing after a resource shortage. It's 3 msecs to * When to reinvoke queueing after a resource shortage. It's 3 msecs to
* not change behaviour from the previous unplug mechanism, experimentation * not change behaviour from the previous unplug mechanism, experimentation
......
...@@ -239,6 +239,8 @@ enum { ...@@ -239,6 +239,8 @@ enum {
ATA_CMD_WRITE_QUEUED_FUA_EXT = 0x3E, ATA_CMD_WRITE_QUEUED_FUA_EXT = 0x3E,
ATA_CMD_FPDMA_READ = 0x60, ATA_CMD_FPDMA_READ = 0x60,
ATA_CMD_FPDMA_WRITE = 0x61, ATA_CMD_FPDMA_WRITE = 0x61,
ATA_CMD_FPDMA_SEND = 0x64,
ATA_CMD_FPDMA_RECV = 0x65,
ATA_CMD_PIO_READ = 0x20, ATA_CMD_PIO_READ = 0x20,
ATA_CMD_PIO_READ_EXT = 0x24, ATA_CMD_PIO_READ_EXT = 0x24,
ATA_CMD_PIO_WRITE = 0x30, ATA_CMD_PIO_WRITE = 0x30,
...@@ -293,8 +295,13 @@ enum { ...@@ -293,8 +295,13 @@ enum {
/* marked obsolete in the ATA/ATAPI-7 spec */ /* marked obsolete in the ATA/ATAPI-7 spec */
ATA_CMD_RESTORE = 0x10, ATA_CMD_RESTORE = 0x10,
/* Subcmds for ATA_CMD_FPDMA_SEND */
ATA_SUBCMD_FPDMA_SEND_DSM = 0x00,
ATA_SUBCMD_FPDMA_SEND_WR_LOG_DMA_EXT = 0x02,
/* READ_LOG_EXT pages */ /* READ_LOG_EXT pages */
ATA_LOG_SATA_NCQ = 0x10, ATA_LOG_SATA_NCQ = 0x10,
ATA_LOG_NCQ_SEND_RECV = 0x13,
ATA_LOG_SATA_ID_DEV_DATA = 0x30, ATA_LOG_SATA_ID_DEV_DATA = 0x30,
ATA_LOG_SATA_SETTINGS = 0x08, ATA_LOG_SATA_SETTINGS = 0x08,
ATA_LOG_DEVSLP_OFFSET = 0x30, ATA_LOG_DEVSLP_OFFSET = 0x30,
...@@ -305,6 +312,15 @@ enum { ...@@ -305,6 +312,15 @@ enum {
ATA_LOG_DEVSLP_VALID = 0x07, ATA_LOG_DEVSLP_VALID = 0x07,
ATA_LOG_DEVSLP_VALID_MASK = 0x80, ATA_LOG_DEVSLP_VALID_MASK = 0x80,
/* NCQ send and receive log */
ATA_LOG_NCQ_SEND_RECV_SUBCMDS_OFFSET = 0x00,
ATA_LOG_NCQ_SEND_RECV_SUBCMDS_DSM = (1 << 0),
ATA_LOG_NCQ_SEND_RECV_DSM_OFFSET = 0x04,
ATA_LOG_NCQ_SEND_RECV_DSM_TRIM = (1 << 0),
ATA_LOG_NCQ_SEND_RECV_RD_LOG_OFFSET = 0x08,
ATA_LOG_NCQ_SEND_RECV_WR_LOG_OFFSET = 0x0C,
ATA_LOG_NCQ_SEND_RECV_SIZE = 0x10,
/* READ/WRITE LONG (obsolete) */ /* READ/WRITE LONG (obsolete) */
ATA_CMD_READ_LONG = 0x22, ATA_CMD_READ_LONG = 0x22,
ATA_CMD_READ_LONG_ONCE = 0x23, ATA_CMD_READ_LONG_ONCE = 0x23,
...@@ -446,22 +462,6 @@ enum { ...@@ -446,22 +462,6 @@ enum {
SERR_TRANS_ST_ERROR = (1 << 24), /* Transport state trans. error */ SERR_TRANS_ST_ERROR = (1 << 24), /* Transport state trans. error */
SERR_UNRECOG_FIS = (1 << 25), /* Unrecognized FIS */ SERR_UNRECOG_FIS = (1 << 25), /* Unrecognized FIS */
SERR_DEV_XCHG = (1 << 26), /* device exchanged */ SERR_DEV_XCHG = (1 << 26), /* device exchanged */
/* struct ata_taskfile flags */
ATA_TFLAG_LBA48 = (1 << 0), /* enable 48-bit LBA and "HOB" */
ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */
ATA_TFLAG_DEVICE = (1 << 2), /* enable r/w to device reg */
ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */
ATA_TFLAG_LBA = (1 << 4), /* enable LBA */
ATA_TFLAG_FUA = (1 << 5), /* enable FUA */
ATA_TFLAG_POLLING = (1 << 6), /* set nIEN to 1 and use polling */
/* protocol flags */
ATA_PROT_FLAG_PIO = (1 << 0), /* is PIO */
ATA_PROT_FLAG_DMA = (1 << 1), /* is DMA */
ATA_PROT_FLAG_DATA = ATA_PROT_FLAG_PIO | ATA_PROT_FLAG_DMA,
ATA_PROT_FLAG_NCQ = (1 << 2), /* is NCQ */
ATA_PROT_FLAG_ATAPI = (1 << 3), /* is ATAPI */
}; };
enum ata_tf_protocols { enum ata_tf_protocols {
...@@ -488,83 +488,6 @@ struct ata_bmdma_prd { ...@@ -488,83 +488,6 @@ struct ata_bmdma_prd {
__le32 flags_len; __le32 flags_len;
}; };
struct ata_taskfile {
unsigned long flags; /* ATA_TFLAG_xxx */
u8 protocol; /* ATA_PROT_xxx */
u8 ctl; /* control reg */
u8 hob_feature; /* additional data */
u8 hob_nsect; /* to support LBA48 */
u8 hob_lbal;
u8 hob_lbam;
u8 hob_lbah;
u8 feature;
u8 nsect;
u8 lbal;
u8 lbam;
u8 lbah;
u8 device;
u8 command; /* IO operation */
};
/*
* protocol tests
*/
static inline unsigned int ata_prot_flags(u8 prot)
{
switch (prot) {
case ATA_PROT_NODATA:
return 0;
case ATA_PROT_PIO:
return ATA_PROT_FLAG_PIO;
case ATA_PROT_DMA:
return ATA_PROT_FLAG_DMA;
case ATA_PROT_NCQ:
return ATA_PROT_FLAG_DMA | ATA_PROT_FLAG_NCQ;
case ATAPI_PROT_NODATA:
return ATA_PROT_FLAG_ATAPI;
case ATAPI_PROT_PIO:
return ATA_PROT_FLAG_ATAPI | ATA_PROT_FLAG_PIO;
case ATAPI_PROT_DMA:
return ATA_PROT_FLAG_ATAPI | ATA_PROT_FLAG_DMA;
}
return 0;
}
static inline int ata_is_atapi(u8 prot)
{
return ata_prot_flags(prot) & ATA_PROT_FLAG_ATAPI;
}
static inline int ata_is_nodata(u8 prot)
{
return !(ata_prot_flags(prot) & ATA_PROT_FLAG_DATA);
}
static inline int ata_is_pio(u8 prot)
{
return ata_prot_flags(prot) & ATA_PROT_FLAG_PIO;
}
static inline int ata_is_dma(u8 prot)
{
return ata_prot_flags(prot) & ATA_PROT_FLAG_DMA;
}
static inline int ata_is_ncq(u8 prot)
{
return ata_prot_flags(prot) & ATA_PROT_FLAG_NCQ;
}
static inline int ata_is_data(u8 prot)
{
return ata_prot_flags(prot) & ATA_PROT_FLAG_DATA;
}
/* /*
* id tests * id tests
*/ */
...@@ -865,6 +788,11 @@ static inline int ata_id_rotation_rate(const u16 *id) ...@@ -865,6 +788,11 @@ static inline int ata_id_rotation_rate(const u16 *id)
return val; return val;
} }
static inline bool ata_id_has_ncq_send_and_recv(const u16 *id)
{
return id[ATA_ID_SATA_CAPABILITY_2] & BIT(6);
}
static inline bool ata_id_has_trim(const u16 *id) static inline bool ata_id_has_trim(const u16 *id)
{ {
if (ata_id_major_version(id) >= 7 && if (ata_id_major_version(id) >= 7 &&
...@@ -1060,15 +988,6 @@ static inline unsigned ata_set_lba_range_entries(void *_buffer, ...@@ -1060,15 +988,6 @@ static inline unsigned ata_set_lba_range_entries(void *_buffer,
return used_bytes; return used_bytes;
} }
static inline int is_multi_taskfile(struct ata_taskfile *tf)
{
return (tf->command == ATA_CMD_READ_MULTI) ||
(tf->command == ATA_CMD_WRITE_MULTI) ||
(tf->command == ATA_CMD_READ_MULTI_EXT) ||
(tf->command == ATA_CMD_WRITE_MULTI_EXT) ||
(tf->command == ATA_CMD_WRITE_MULTI_FUA_EXT);
}
static inline bool ata_ok(u8 status) static inline bool ata_ok(u8 status)
{ {
return ((status & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ | ATA_ERR)) return ((status & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ | ATA_ERR))
......
...@@ -138,6 +138,22 @@ enum { ...@@ -138,6 +138,22 @@ enum {
ATA_SHT_THIS_ID = -1, ATA_SHT_THIS_ID = -1,
ATA_SHT_USE_CLUSTERING = 1, ATA_SHT_USE_CLUSTERING = 1,
/* struct ata_taskfile flags */
ATA_TFLAG_LBA48 = (1 << 0), /* enable 48-bit LBA and "HOB" */
ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */
ATA_TFLAG_DEVICE = (1 << 2), /* enable r/w to device reg */
ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */
ATA_TFLAG_LBA = (1 << 4), /* enable LBA */
ATA_TFLAG_FUA = (1 << 5), /* enable FUA */
ATA_TFLAG_POLLING = (1 << 6), /* set nIEN to 1 and use polling */
/* protocol flags */
ATA_PROT_FLAG_PIO = (1 << 0), /* is PIO */
ATA_PROT_FLAG_DMA = (1 << 1), /* is DMA */
ATA_PROT_FLAG_DATA = ATA_PROT_FLAG_PIO | ATA_PROT_FLAG_DMA,
ATA_PROT_FLAG_NCQ = (1 << 2), /* is NCQ */
ATA_PROT_FLAG_ATAPI = (1 << 3), /* is ATAPI */
/* struct ata_device stuff */ /* struct ata_device stuff */
ATA_DFLAG_LBA = (1 << 0), /* device supports LBA */ ATA_DFLAG_LBA = (1 << 0), /* device supports LBA */
ATA_DFLAG_LBA48 = (1 << 1), /* device supports LBA48 */ ATA_DFLAG_LBA48 = (1 << 1), /* device supports LBA48 */
...@@ -156,6 +172,7 @@ enum { ...@@ -156,6 +172,7 @@ enum {
ATA_DFLAG_DUBIOUS_XFER = (1 << 16), /* data transfer not verified */ ATA_DFLAG_DUBIOUS_XFER = (1 << 16), /* data transfer not verified */
ATA_DFLAG_NO_UNLOAD = (1 << 17), /* device doesn't support unload */ ATA_DFLAG_NO_UNLOAD = (1 << 17), /* device doesn't support unload */
ATA_DFLAG_UNLOCK_HPA = (1 << 18), /* unlock HPA */ ATA_DFLAG_UNLOCK_HPA = (1 << 18), /* unlock HPA */
ATA_DFLAG_NCQ_SEND_RECV = (1 << 19), /* device supports NCQ SEND and RECV */
ATA_DFLAG_INIT_MASK = (1 << 24) - 1, ATA_DFLAG_INIT_MASK = (1 << 24) - 1,
ATA_DFLAG_DETACH = (1 << 24), ATA_DFLAG_DETACH = (1 << 24),
...@@ -207,6 +224,7 @@ enum { ...@@ -207,6 +224,7 @@ enum {
ATA_FLAG_ACPI_SATA = (1 << 17), /* need native SATA ACPI layout */ ATA_FLAG_ACPI_SATA = (1 << 17), /* need native SATA ACPI layout */
ATA_FLAG_AN = (1 << 18), /* controller supports AN */ ATA_FLAG_AN = (1 << 18), /* controller supports AN */
ATA_FLAG_PMP = (1 << 19), /* controller supports PMP */ ATA_FLAG_PMP = (1 << 19), /* controller supports PMP */
ATA_FLAG_FPDMA_AUX = (1 << 20), /* controller supports H2DFIS aux field */
ATA_FLAG_EM = (1 << 21), /* driver supports enclosure ATA_FLAG_EM = (1 << 21), /* driver supports enclosure
* management */ * management */
ATA_FLAG_SW_ACTIVITY = (1 << 22), /* driver supports sw activity ATA_FLAG_SW_ACTIVITY = (1 << 22), /* driver supports sw activity
...@@ -518,6 +536,33 @@ enum sw_activity { ...@@ -518,6 +536,33 @@ enum sw_activity {
BLINK_OFF, BLINK_OFF,
}; };
struct ata_taskfile {
unsigned long flags; /* ATA_TFLAG_xxx */
u8 protocol; /* ATA_PROT_xxx */
u8 ctl; /* control reg */
u8 hob_feature; /* additional data */
u8 hob_nsect; /* to support LBA48 */
u8 hob_lbal;
u8 hob_lbam;
u8 hob_lbah;
u8 feature;
u8 nsect;
u8 lbal;
u8 lbam;
u8 lbah;
u8 device;
u8 command; /* IO operation */
u32 auxiliary; /* auxiliary field */
/* from SATA 3.1 and */
/* ATA-8 ACS-3 */
};
#ifdef CONFIG_ATA_SFF #ifdef CONFIG_ATA_SFF
struct ata_ioports { struct ata_ioports {
void __iomem *cmd_addr; void __iomem *cmd_addr;
...@@ -660,6 +705,9 @@ struct ata_device { ...@@ -660,6 +705,9 @@ struct ata_device {
/* DEVSLP Timing Variables from Identify Device Data Log */ /* DEVSLP Timing Variables from Identify Device Data Log */
u8 devslp_timing[ATA_LOG_DEVSLP_SIZE]; u8 devslp_timing[ATA_LOG_DEVSLP_SIZE];
/* NCQ send and receive log subcommand support */
u8 ncq_send_recv_cmds[ATA_LOG_NCQ_SEND_RECV_SIZE];
/* error history */ /* error history */
int spdn_cnt; int spdn_cnt;
/* ering is CLEAR_END, read comment above CLEAR_END */ /* ering is CLEAR_END, read comment above CLEAR_END */
...@@ -959,6 +1007,69 @@ extern const unsigned long sata_deb_timing_long[]; ...@@ -959,6 +1007,69 @@ extern const unsigned long sata_deb_timing_long[];
extern struct ata_port_operations ata_dummy_port_ops; extern struct ata_port_operations ata_dummy_port_ops;
extern const struct ata_port_info ata_dummy_port_info; extern const struct ata_port_info ata_dummy_port_info;
/*
* protocol tests
*/
static inline unsigned int ata_prot_flags(u8 prot)
{
switch (prot) {
case ATA_PROT_NODATA:
return 0;
case ATA_PROT_PIO:
return ATA_PROT_FLAG_PIO;
case ATA_PROT_DMA:
return ATA_PROT_FLAG_DMA;
case ATA_PROT_NCQ:
return ATA_PROT_FLAG_DMA | ATA_PROT_FLAG_NCQ;
case ATAPI_PROT_NODATA:
return ATA_PROT_FLAG_ATAPI;
case ATAPI_PROT_PIO:
return ATA_PROT_FLAG_ATAPI | ATA_PROT_FLAG_PIO;
case ATAPI_PROT_DMA:
return ATA_PROT_FLAG_ATAPI | ATA_PROT_FLAG_DMA;
}
return 0;
}
static inline int ata_is_atapi(u8 prot)
{
return ata_prot_flags(prot) & ATA_PROT_FLAG_ATAPI;
}
static inline int ata_is_nodata(u8 prot)
{
return !(ata_prot_flags(prot) & ATA_PROT_FLAG_DATA);
}
static inline int ata_is_pio(u8 prot)
{
return ata_prot_flags(prot) & ATA_PROT_FLAG_PIO;
}
static inline int ata_is_dma(u8 prot)
{
return ata_prot_flags(prot) & ATA_PROT_FLAG_DMA;
}
static inline int ata_is_ncq(u8 prot)
{
return ata_prot_flags(prot) & ATA_PROT_FLAG_NCQ;
}
static inline int ata_is_data(u8 prot)
{
return ata_prot_flags(prot) & ATA_PROT_FLAG_DATA;
}
static inline int is_multi_taskfile(struct ata_taskfile *tf)
{
return (tf->command == ATA_CMD_READ_MULTI) ||
(tf->command == ATA_CMD_WRITE_MULTI) ||
(tf->command == ATA_CMD_READ_MULTI_EXT) ||
(tf->command == ATA_CMD_WRITE_MULTI_EXT) ||
(tf->command == ATA_CMD_WRITE_MULTI_FUA_EXT);
}
static inline const unsigned long * static inline const unsigned long *
sata_ehc_deb_timing(struct ata_eh_context *ehc) sata_ehc_deb_timing(struct ata_eh_context *ehc)
{ {
...@@ -1142,8 +1253,6 @@ int ata_acpi_stm(struct ata_port *ap, const struct ata_acpi_gtm *stm); ...@@ -1142,8 +1253,6 @@ int ata_acpi_stm(struct ata_port *ap, const struct ata_acpi_gtm *stm);
int ata_acpi_gtm(struct ata_port *ap, struct ata_acpi_gtm *stm); int ata_acpi_gtm(struct ata_port *ap, struct ata_acpi_gtm *stm);
unsigned long ata_acpi_gtm_xfermask(struct ata_device *dev, unsigned long ata_acpi_gtm_xfermask(struct ata_device *dev,
const struct ata_acpi_gtm *gtm); const struct ata_acpi_gtm *gtm);
acpi_handle ata_ap_acpi_handle(struct ata_port *ap);
acpi_handle ata_dev_acpi_handle(struct ata_device *dev);
int ata_acpi_cbl_80wire(struct ata_port *ap, const struct ata_acpi_gtm *gtm); int ata_acpi_cbl_80wire(struct ata_port *ap, const struct ata_acpi_gtm *gtm);
#else #else
static inline const struct ata_acpi_gtm *ata_acpi_init_gtm(struct ata_port *ap) static inline const struct ata_acpi_gtm *ata_acpi_init_gtm(struct ata_port *ap)
...@@ -1497,6 +1606,13 @@ static inline int ata_ncq_enabled(struct ata_device *dev) ...@@ -1497,6 +1606,13 @@ static inline int ata_ncq_enabled(struct ata_device *dev)
ATA_DFLAG_NCQ)) == ATA_DFLAG_NCQ; ATA_DFLAG_NCQ)) == ATA_DFLAG_NCQ;
} }
static inline bool ata_fpdma_dsm_supported(struct ata_device *dev)
{
return (dev->flags & ATA_DFLAG_NCQ_SEND_RECV) &&
(dev->ncq_send_recv_cmds[ATA_LOG_NCQ_SEND_RECV_DSM_OFFSET] &
ATA_LOG_NCQ_SEND_RECV_DSM_TRIM);
}
static inline void ata_qc_set_polling(struct ata_queued_cmd *qc) static inline void ata_qc_set_polling(struct ata_queued_cmd *qc)
{ {
qc->tf.ctl |= ATA_NIEN; qc->tf.ctl |= ATA_NIEN;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment