提交 562f0c2d 编写于 作者: T Tejun Heo 提交者: Jeff Garzik

libata-acpi: add new hooks ata_acpi_dissociate() and ata_acpi_on_disable()

Add two hooks - ata_acpi_dissociate() which is called during driver
detach after the whole host is shutdown and ata_acpi_on_disable()
which is called when a device is disabled.
Signed-off-by: NTejun heo <htejun@gmail.com>
Signed-off-by: NJeff Garzik <jeff@garzik.org>
上级 7f9ad9b8
...@@ -187,6 +187,21 @@ void ata_acpi_associate(struct ata_host *host) ...@@ -187,6 +187,21 @@ void ata_acpi_associate(struct ata_host *host)
} }
} }
/**
* ata_acpi_dissociate - dissociate ATA host from ACPI objects
* @host: target ATA host
*
* This function is called during driver detach after the whole host
* is shut down.
*
* LOCKING:
* EH context.
*/
void ata_acpi_dissociate(struct ata_host *host)
{
/* nada */
}
/** /**
* ata_acpi_gtm - execute _GTM * ata_acpi_gtm - execute _GTM
* @ap: target ATA port * @ap: target ATA port
...@@ -716,3 +731,16 @@ int ata_acpi_on_devcfg(struct ata_device *dev) ...@@ -716,3 +731,16 @@ int ata_acpi_on_devcfg(struct ata_device *dev)
dev->flags |= ATA_DFLAG_ACPI_FAILED; dev->flags |= ATA_DFLAG_ACPI_FAILED;
return rc; return rc;
} }
/**
* ata_acpi_on_disable - ATA ACPI hook called when a device is disabled
* @dev: target ATA device
*
* This function is called when @dev is about to be disabled.
*
* LOCKING:
* EH context.
*/
void ata_acpi_on_disable(struct ata_device *dev)
{
}
...@@ -622,6 +622,7 @@ void ata_dev_disable(struct ata_device *dev) ...@@ -622,6 +622,7 @@ void ata_dev_disable(struct ata_device *dev)
if (ata_dev_enabled(dev)) { if (ata_dev_enabled(dev)) {
if (ata_msg_drv(dev->link->ap)) if (ata_msg_drv(dev->link->ap))
ata_dev_printk(dev, KERN_WARNING, "disabled\n"); ata_dev_printk(dev, KERN_WARNING, "disabled\n");
ata_acpi_on_disable(dev);
ata_down_xfermask_limit(dev, ATA_DNXFER_FORCE_PIO0 | ata_down_xfermask_limit(dev, ATA_DNXFER_FORCE_PIO0 |
ATA_DNXFER_QUIET); ATA_DNXFER_QUIET);
dev->class++; dev->class++;
...@@ -7249,6 +7250,9 @@ void ata_host_detach(struct ata_host *host) ...@@ -7249,6 +7250,9 @@ void ata_host_detach(struct ata_host *host)
for (i = 0; i < host->n_ports; i++) for (i = 0; i < host->n_ports; i++)
ata_port_detach(host->ports[i]); ata_port_detach(host->ports[i]);
/* the host is dead now, dissociate ACPI */
ata_acpi_dissociate(host);
} }
/** /**
......
...@@ -108,15 +108,19 @@ extern void ata_lpm_schedule(struct ata_port *ap, enum link_pm); ...@@ -108,15 +108,19 @@ extern void ata_lpm_schedule(struct ata_port *ap, enum link_pm);
#ifdef CONFIG_ATA_ACPI #ifdef CONFIG_ATA_ACPI
extern void ata_acpi_associate_sata_port(struct ata_port *ap); extern void ata_acpi_associate_sata_port(struct ata_port *ap);
extern void ata_acpi_associate(struct ata_host *host); extern void ata_acpi_associate(struct ata_host *host);
extern void ata_acpi_dissociate(struct ata_host *host);
extern int ata_acpi_on_suspend(struct ata_port *ap); extern int ata_acpi_on_suspend(struct ata_port *ap);
extern void ata_acpi_on_resume(struct ata_port *ap); extern void ata_acpi_on_resume(struct ata_port *ap);
extern int ata_acpi_on_devcfg(struct ata_device *adev); extern int ata_acpi_on_devcfg(struct ata_device *dev);
extern void ata_acpi_on_disable(struct ata_device *dev);
#else #else
static inline void ata_acpi_associate_sata_port(struct ata_port *ap) { } static inline void ata_acpi_associate_sata_port(struct ata_port *ap) { }
static inline void ata_acpi_associate(struct ata_host *host) { } static inline void ata_acpi_associate(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; }
static inline void ata_acpi_on_resume(struct ata_port *ap) { } static inline void ata_acpi_on_resume(struct ata_port *ap) { }
static inline int ata_acpi_on_devcfg(struct ata_device *adev) { return 0; } static inline int ata_acpi_on_devcfg(struct ata_device *dev) { return 0; }
static inline void ata_acpi_on_disable(struct ata_device *dev) { }
#endif #endif
/* libata-scsi.c */ /* libata-scsi.c */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册