|
@@ -393,6 +393,9 @@ static ssize_t ahci_show_em_supported(struct device *dev,
|
|
|
*
|
|
|
* If inconsistent, config values are fixed up by this function.
|
|
|
*
|
|
|
+ * If it is not set already this function sets hpriv->start_engine to
|
|
|
+ * ahci_start_engine.
|
|
|
+ *
|
|
|
* LOCKING:
|
|
|
* None.
|
|
|
*/
|
|
@@ -499,6 +502,9 @@ void ahci_save_initial_config(struct device *dev,
|
|
|
hpriv->cap = cap;
|
|
|
hpriv->cap2 = cap2;
|
|
|
hpriv->port_map = port_map;
|
|
|
+
|
|
|
+ if (!hpriv->start_engine)
|
|
|
+ hpriv->start_engine = ahci_start_engine;
|
|
|
}
|
|
|
EXPORT_SYMBOL_GPL(ahci_save_initial_config);
|
|
|
|
|
@@ -765,7 +771,7 @@ static void ahci_start_port(struct ata_port *ap)
|
|
|
|
|
|
/* enable DMA */
|
|
|
if (!(hpriv->flags & AHCI_HFLAG_DELAY_ENGINE))
|
|
|
- ahci_start_engine(ap);
|
|
|
+ hpriv->start_engine(ap);
|
|
|
|
|
|
/* turn on LEDs */
|
|
|
if (ap->flags & ATA_FLAG_EM) {
|
|
@@ -1234,7 +1240,7 @@ int ahci_kick_engine(struct ata_port *ap)
|
|
|
|
|
|
/* restart engine */
|
|
|
out_restart:
|
|
|
- ahci_start_engine(ap);
|
|
|
+ hpriv->start_engine(ap);
|
|
|
return rc;
|
|
|
}
|
|
|
EXPORT_SYMBOL_GPL(ahci_kick_engine);
|
|
@@ -1426,6 +1432,7 @@ static int ahci_hardreset(struct ata_link *link, unsigned int *class,
|
|
|
const unsigned long *timing = sata_ehc_deb_timing(&link->eh_context);
|
|
|
struct ata_port *ap = link->ap;
|
|
|
struct ahci_port_priv *pp = ap->private_data;
|
|
|
+ struct ahci_host_priv *hpriv = ap->host->private_data;
|
|
|
u8 *d2h_fis = pp->rx_fis + RX_FIS_D2H_REG;
|
|
|
struct ata_taskfile tf;
|
|
|
bool online;
|
|
@@ -1443,7 +1450,7 @@ static int ahci_hardreset(struct ata_link *link, unsigned int *class,
|
|
|
rc = sata_link_hardreset(link, timing, deadline, &online,
|
|
|
ahci_check_ready);
|
|
|
|
|
|
- ahci_start_engine(ap);
|
|
|
+ hpriv->start_engine(ap);
|
|
|
|
|
|
if (online)
|
|
|
*class = ahci_dev_classify(ap);
|
|
@@ -2007,10 +2014,12 @@ static void ahci_thaw(struct ata_port *ap)
|
|
|
|
|
|
void ahci_error_handler(struct ata_port *ap)
|
|
|
{
|
|
|
+ struct ahci_host_priv *hpriv = ap->host->private_data;
|
|
|
+
|
|
|
if (!(ap->pflags & ATA_PFLAG_FROZEN)) {
|
|
|
/* restart engine */
|
|
|
ahci_stop_engine(ap);
|
|
|
- ahci_start_engine(ap);
|
|
|
+ hpriv->start_engine(ap);
|
|
|
}
|
|
|
|
|
|
sata_pmp_error_handler(ap);
|
|
@@ -2031,6 +2040,7 @@ static void ahci_post_internal_cmd(struct ata_queued_cmd *qc)
|
|
|
|
|
|
static void ahci_set_aggressive_devslp(struct ata_port *ap, bool sleep)
|
|
|
{
|
|
|
+ struct ahci_host_priv *hpriv = ap->host->private_data;
|
|
|
void __iomem *port_mmio = ahci_port_base(ap);
|
|
|
struct ata_device *dev = ap->link.device;
|
|
|
u32 devslp, dm, dito, mdat, deto;
|
|
@@ -2094,7 +2104,7 @@ static void ahci_set_aggressive_devslp(struct ata_port *ap, bool sleep)
|
|
|
PORT_DEVSLP_ADSE);
|
|
|
writel(devslp, port_mmio + PORT_DEVSLP);
|
|
|
|
|
|
- ahci_start_engine(ap);
|
|
|
+ hpriv->start_engine(ap);
|
|
|
|
|
|
/* enable device sleep feature for the drive */
|
|
|
err_mask = ata_dev_set_feature(dev,
|
|
@@ -2106,6 +2116,7 @@ static void ahci_set_aggressive_devslp(struct ata_port *ap, bool sleep)
|
|
|
|
|
|
static void ahci_enable_fbs(struct ata_port *ap)
|
|
|
{
|
|
|
+ struct ahci_host_priv *hpriv = ap->host->private_data;
|
|
|
struct ahci_port_priv *pp = ap->private_data;
|
|
|
void __iomem *port_mmio = ahci_port_base(ap);
|
|
|
u32 fbs;
|
|
@@ -2134,11 +2145,12 @@ static void ahci_enable_fbs(struct ata_port *ap)
|
|
|
} else
|
|
|
dev_err(ap->host->dev, "Failed to enable FBS\n");
|
|
|
|
|
|
- ahci_start_engine(ap);
|
|
|
+ hpriv->start_engine(ap);
|
|
|
}
|
|
|
|
|
|
static void ahci_disable_fbs(struct ata_port *ap)
|
|
|
{
|
|
|
+ struct ahci_host_priv *hpriv = ap->host->private_data;
|
|
|
struct ahci_port_priv *pp = ap->private_data;
|
|
|
void __iomem *port_mmio = ahci_port_base(ap);
|
|
|
u32 fbs;
|
|
@@ -2166,7 +2178,7 @@ static void ahci_disable_fbs(struct ata_port *ap)
|
|
|
pp->fbs_enabled = false;
|
|
|
}
|
|
|
|
|
|
- ahci_start_engine(ap);
|
|
|
+ hpriv->start_engine(ap);
|
|
|
}
|
|
|
|
|
|
static void ahci_pmp_attach(struct ata_port *ap)
|