Commit 678afac6 authored by Tejun Heo's avatar Tejun Heo Committed by Jeff Garzik

libata: move ata_dev_disable() to libata-eh.c

ata_dev_disable() is about to be more tightly integrated into EH
logic.  Move it to libata-eh.c.
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent d89293ab
...@@ -1015,18 +1015,6 @@ static const char *sata_spd_string(unsigned int spd) ...@@ -1015,18 +1015,6 @@ static const char *sata_spd_string(unsigned int spd)
return spd_str[spd - 1]; return spd_str[spd - 1];
} }
void ata_dev_disable(struct ata_device *dev)
{
if (ata_dev_enabled(dev)) {
if (ata_msg_drv(dev->link->ap))
ata_dev_printk(dev, KERN_WARNING, "disabled\n");
ata_acpi_on_disable(dev);
ata_down_xfermask_limit(dev, ATA_DNXFER_FORCE_PIO0 |
ATA_DNXFER_QUIET);
dev->class++;
}
}
static int ata_dev_set_dipm(struct ata_device *dev, enum link_pm policy) static int ata_dev_set_dipm(struct ata_device *dev, enum link_pm policy)
{ {
struct ata_link *link = dev->link; struct ata_link *link = dev->link;
......
...@@ -1175,6 +1175,27 @@ void ata_eh_qc_retry(struct ata_queued_cmd *qc) ...@@ -1175,6 +1175,27 @@ void ata_eh_qc_retry(struct ata_queued_cmd *qc)
__ata_eh_qc_complete(qc); __ata_eh_qc_complete(qc);
} }
/**
* ata_dev_disable - disable ATA device
* @dev: ATA device to disable
*
* Disable @dev.
*
* Locking:
* EH context.
*/
void ata_dev_disable(struct ata_device *dev)
{
if (!ata_dev_enabled(dev))
return;
if (ata_msg_drv(dev->link->ap))
ata_dev_printk(dev, KERN_WARNING, "disabled\n");
ata_acpi_on_disable(dev);
ata_down_xfermask_limit(dev, ATA_DNXFER_FORCE_PIO0 | ATA_DNXFER_QUIET);
dev->class++;
}
/** /**
* ata_eh_detach_dev - detach ATA device * ata_eh_detach_dev - detach ATA device
* @dev: ATA device to detach * @dev: ATA device to detach
......
...@@ -79,7 +79,6 @@ extern int ata_build_rw_tf(struct ata_taskfile *tf, struct ata_device *dev, ...@@ -79,7 +79,6 @@ extern int ata_build_rw_tf(struct ata_taskfile *tf, struct ata_device *dev,
u64 block, u32 n_block, unsigned int tf_flags, u64 block, u32 n_block, unsigned int tf_flags,
unsigned int tag); unsigned int tag);
extern u64 ata_tf_read_block(struct ata_taskfile *tf, struct ata_device *dev); extern u64 ata_tf_read_block(struct ata_taskfile *tf, struct ata_device *dev);
extern void ata_dev_disable(struct ata_device *dev);
extern void ata_pio_queue_task(struct ata_port *ap, void *data, extern void ata_pio_queue_task(struct ata_port *ap, void *data,
unsigned long delay); unsigned long delay);
extern void ata_port_flush_task(struct ata_port *ap); extern void ata_port_flush_task(struct ata_port *ap);
...@@ -160,6 +159,7 @@ extern void ata_scsi_error(struct Scsi_Host *host); ...@@ -160,6 +159,7 @@ extern void ata_scsi_error(struct Scsi_Host *host);
extern void ata_port_wait_eh(struct ata_port *ap); extern void ata_port_wait_eh(struct ata_port *ap);
extern void ata_eh_fastdrain_timerfn(unsigned long arg); extern void ata_eh_fastdrain_timerfn(unsigned long arg);
extern void ata_qc_schedule_eh(struct ata_queued_cmd *qc); 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); extern void ata_eh_detach_dev(struct ata_device *dev);
extern void ata_eh_about_to_do(struct ata_link *link, struct ata_device *dev, extern void ata_eh_about_to_do(struct ata_link *link, struct ata_device *dev,
unsigned int action); unsigned int action);
......
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