Commit eac7e072 authored by Tejun Heo's avatar Tejun Heo

Revert "ata: ahci_platform: allow disabling of hotplug to save power"

This reverts commit aece27a2.

Causes boot failure on some devices.

 http://lore.kernel.org/r/CA+G9fYuKW_jCFZPqG4tz=QY9ROfHO38KiCp9XTA+KaDOFVtcqQ@mail.gmail.comSigned-off-by: default avatarTejun Heo <tj@kernel.org>
parent 11c29146
...@@ -68,13 +68,8 @@ static int ahci_probe(struct platform_device *pdev) ...@@ -68,13 +68,8 @@ static int ahci_probe(struct platform_device *pdev)
return rc; return rc;
} }
#ifdef CONFIG_PM_SLEEP static SIMPLE_DEV_PM_OPS(ahci_pm_ops, ahci_platform_suspend,
static const struct dev_pm_ops ahci_pm_ops = { ahci_platform_resume);
SET_SYSTEM_SLEEP_PM_OPS(ahci_platform_suspend, ahci_platform_resume)
SET_RUNTIME_PM_OPS(ahci_platform_runtime_suspend,
ahci_platform_runtime_resume, NULL)
};
#endif
static const struct of_device_id ahci_of_match[] = { static const struct of_device_id ahci_of_match[] = {
{ .compatible = "generic-ahci", }, { .compatible = "generic-ahci", },
...@@ -103,9 +98,7 @@ static struct platform_driver ahci_driver = { ...@@ -103,9 +98,7 @@ static struct platform_driver ahci_driver = {
.name = DRV_NAME, .name = DRV_NAME,
.of_match_table = ahci_of_match, .of_match_table = ahci_of_match,
.acpi_match_table = ahci_acpi_match, .acpi_match_table = ahci_acpi_match,
#ifdef CONFIG_PM_SLEEP
.pm = &ahci_pm_ops, .pm = &ahci_pm_ops,
#endif
}, },
}; };
module_platform_driver(ahci_driver); module_platform_driver(ahci_driver);
......
...@@ -257,7 +257,7 @@ static void ahci_platform_put_resources(struct device *dev, void *res) ...@@ -257,7 +257,7 @@ static void ahci_platform_put_resources(struct device *dev, void *res)
int c; int c;
if (hpriv->got_runtime_pm) { if (hpriv->got_runtime_pm) {
pm_runtime_allow(dev); pm_runtime_put_sync(dev);
pm_runtime_disable(dev); pm_runtime_disable(dev);
} }
...@@ -477,10 +477,8 @@ struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev) ...@@ -477,10 +477,8 @@ struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev)
if (rc == -EPROBE_DEFER) if (rc == -EPROBE_DEFER)
goto err_out; goto err_out;
} }
pm_runtime_set_active(dev);
pm_runtime_enable(dev); pm_runtime_enable(dev);
pm_runtime_forbid(dev); pm_runtime_get_sync(dev);
hpriv->got_runtime_pm = true; hpriv->got_runtime_pm = true;
devres_remove_group(dev, NULL); devres_remove_group(dev, NULL);
...@@ -709,21 +707,6 @@ int ahci_platform_resume_host(struct device *dev) ...@@ -709,21 +707,6 @@ int ahci_platform_resume_host(struct device *dev)
} }
EXPORT_SYMBOL_GPL(ahci_platform_resume_host); EXPORT_SYMBOL_GPL(ahci_platform_resume_host);
static int _ahci_platform_suspend(struct device *dev)
{
struct ata_host *host = dev_get_drvdata(dev);
struct ahci_host_priv *hpriv = host->private_data;
int rc;
rc = ahci_platform_suspend_host(dev);
if (rc)
return rc;
ahci_platform_disable_resources(hpriv);
return 0;
}
/** /**
* ahci_platform_suspend - Suspend an ahci-platform device * ahci_platform_suspend - Suspend an ahci-platform device
* @dev: the platform device to suspend * @dev: the platform device to suspend
...@@ -735,45 +718,20 @@ static int _ahci_platform_suspend(struct device *dev) ...@@ -735,45 +718,20 @@ static int _ahci_platform_suspend(struct device *dev)
* 0 on success otherwise a negative error code * 0 on success otherwise a negative error code
*/ */
int ahci_platform_suspend(struct device *dev) int ahci_platform_suspend(struct device *dev)
{
return _ahci_platform_suspend(dev);
}
EXPORT_SYMBOL_GPL(ahci_platform_suspend);
/**
* ahci_platform_runtime_suspend - Runtime suspend an ahci-platform device
* @dev: the platform device to suspend
*
* This function suspends the host associated with the device, followed by
* disabling all the resources of the device.
*
* RETURNS:
* 0 on success otherwise a negative error code
*/
int ahci_platform_runtime_suspend(struct device *dev)
{
return _ahci_platform_suspend(dev);
}
EXPORT_SYMBOL_GPL(ahci_platform_runtime_suspend);
static int _ahci_platform_resume(struct device *dev)
{ {
struct ata_host *host = dev_get_drvdata(dev); struct ata_host *host = dev_get_drvdata(dev);
struct ahci_host_priv *hpriv = host->private_data; struct ahci_host_priv *hpriv = host->private_data;
int rc; int rc;
rc = ahci_platform_enable_resources(hpriv); rc = ahci_platform_suspend_host(dev);
if (rc) if (rc)
return rc; return rc;
rc = ahci_platform_resume_host(dev); ahci_platform_disable_resources(hpriv);
if (rc) {
ahci_platform_disable_resources(hpriv);
return rc;
}
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(ahci_platform_suspend);
/** /**
* ahci_platform_resume - Resume an ahci-platform device * ahci_platform_resume - Resume an ahci-platform device
...@@ -787,37 +745,31 @@ static int _ahci_platform_resume(struct device *dev) ...@@ -787,37 +745,31 @@ static int _ahci_platform_resume(struct device *dev)
*/ */
int ahci_platform_resume(struct device *dev) int ahci_platform_resume(struct device *dev)
{ {
struct ata_host *host = dev_get_drvdata(dev);
struct ahci_host_priv *hpriv = host->private_data;
int rc; int rc;
rc = _ahci_platform_resume(dev); rc = ahci_platform_enable_resources(hpriv);
if (rc) if (rc)
return rc; return rc;
rc = ahci_platform_resume_host(dev);
if (rc)
goto disable_resources;
/* We resumed so update PM runtime state */ /* We resumed so update PM runtime state */
pm_runtime_disable(dev); pm_runtime_disable(dev);
pm_runtime_set_active(dev); pm_runtime_set_active(dev);
pm_runtime_enable(dev); pm_runtime_enable(dev);
return 0; return 0;
}
EXPORT_SYMBOL_GPL(ahci_platform_resume);
/** disable_resources:
* ahci_platform_runtime_resume - Runtime resume an ahci-platform device ahci_platform_disable_resources(hpriv);
* @dev: the platform device to resume
*
* This function enables all the resources of the device followed by
* resuming the host associated with the device.
*
* RETURNS:
* 0 on success otherwise a negative error code
*/
int ahci_platform_runtime_resume(struct device *dev)
{
return _ahci_platform_resume(dev);
}
EXPORT_SYMBOL_GPL(ahci_platform_runtime_resume);
return rc;
}
EXPORT_SYMBOL_GPL(ahci_platform_resume);
#endif #endif
MODULE_DESCRIPTION("AHCI SATA platform library"); MODULE_DESCRIPTION("AHCI SATA platform library");
......
...@@ -42,7 +42,5 @@ int ahci_platform_suspend_host(struct device *dev); ...@@ -42,7 +42,5 @@ int ahci_platform_suspend_host(struct device *dev);
int ahci_platform_resume_host(struct device *dev); int ahci_platform_resume_host(struct device *dev);
int ahci_platform_suspend(struct device *dev); int ahci_platform_suspend(struct device *dev);
int ahci_platform_resume(struct device *dev); int ahci_platform_resume(struct device *dev);
int ahci_platform_runtime_suspend(struct device *dev);
int ahci_platform_runtime_resume(struct device *dev);
#endif /* _AHCI_PLATFORM_H */ #endif /* _AHCI_PLATFORM_H */
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