Commit 70e6ad0c authored by Tejun Heo's avatar Tejun Heo

[PATCH] libata: prepare ata_sg_clean() for invocation from EH

Make ata_sg_clean() global and don't allow NCQ for internal commands.
Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
parent bd056d7e
...@@ -309,7 +309,8 @@ int ata_build_rw_tf(struct ata_taskfile *tf, struct ata_device *dev, ...@@ -309,7 +309,8 @@ int ata_build_rw_tf(struct ata_taskfile *tf, struct ata_device *dev,
tf->flags |= tf_flags; tf->flags |= tf_flags;
if ((dev->flags & (ATA_DFLAG_PIO | ATA_DFLAG_NCQ_OFF | if ((dev->flags & (ATA_DFLAG_PIO | ATA_DFLAG_NCQ_OFF |
ATA_DFLAG_NCQ)) == ATA_DFLAG_NCQ) { ATA_DFLAG_NCQ)) == ATA_DFLAG_NCQ &&
likely(tag != ATA_TAG_INTERNAL)) {
/* yay, NCQ */ /* yay, NCQ */
if (!lba_48_ok(block, n_block)) if (!lba_48_ok(block, n_block))
return -ERANGE; return -ERANGE;
...@@ -3533,8 +3534,7 @@ static unsigned int ata_dev_init_params(struct ata_device *dev, ...@@ -3533,8 +3534,7 @@ static unsigned int ata_dev_init_params(struct ata_device *dev,
* LOCKING: * LOCKING:
* spin_lock_irqsave(host lock) * spin_lock_irqsave(host lock)
*/ */
void ata_sg_clean(struct ata_queued_cmd *qc)
static void ata_sg_clean(struct ata_queued_cmd *qc)
{ {
struct ata_port *ap = qc->ap; struct ata_port *ap = qc->ap;
struct scatterlist *sg = qc->__sg; struct scatterlist *sg = qc->__sg;
......
...@@ -73,6 +73,7 @@ extern int sata_down_spd_limit(struct ata_port *ap); ...@@ -73,6 +73,7 @@ extern int sata_down_spd_limit(struct ata_port *ap);
extern int sata_set_spd_needed(struct ata_port *ap); extern int sata_set_spd_needed(struct ata_port *ap);
extern int ata_down_xfermask_limit(struct ata_device *dev, int force_pio0); extern int ata_down_xfermask_limit(struct ata_device *dev, int force_pio0);
extern int ata_set_mode(struct ata_port *ap, struct ata_device **r_failed_dev); extern int ata_set_mode(struct ata_port *ap, struct ata_device **r_failed_dev);
extern void ata_sg_clean(struct ata_queued_cmd *qc);
extern void ata_qc_free(struct ata_queued_cmd *qc); extern void ata_qc_free(struct ata_queued_cmd *qc);
extern void ata_qc_issue(struct ata_queued_cmd *qc); extern void ata_qc_issue(struct ata_queued_cmd *qc);
extern void __ata_qc_complete(struct ata_queued_cmd *qc); extern void __ata_qc_complete(struct ata_queued_cmd *qc);
......
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