Skip to content

Commit

Permalink
[libata] Remove ->irq_ack() hook, and ata_dummy_irq_on()
Browse files Browse the repository at this point in the history
* ->irq_ack() is redundant to what the irq handler already
  performs... chk-status + irq-clear.  Furthermore, it is only
  called in one place, when screaming-irq-debugging is enabled,
  so we don't want to bother with a hook just for that.

* ata_dummy_irq_on() is only ever used in drivers that have
  no callpath reaching ->irq_on().  Remove .irq_on hook from
  those drivers, and the now-unused ata_dummy_irq_on()

Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Jeff Garzik committed Oct 12, 2007
1 parent cb94c1c commit 6d32d30
Show file tree
Hide file tree
Showing 66 changed files with 2 additions and 207 deletions.
4 changes: 0 additions & 4 deletions drivers/ata/ahci.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,6 @@ static const struct ata_port_operations ahci_ops = {
.qc_issue = ahci_qc_issue,

.irq_clear = ahci_irq_clear,
.irq_on = ata_dummy_irq_on,
.irq_ack = ata_dummy_irq_ack,

.scr_read = ahci_scr_read,
.scr_write = ahci_scr_write,
Expand Down Expand Up @@ -310,8 +308,6 @@ static const struct ata_port_operations ahci_vt8251_ops = {
.qc_issue = ahci_qc_issue,

.irq_clear = ahci_irq_clear,
.irq_on = ata_dummy_irq_on,
.irq_ack = ata_dummy_irq_ack,

.scr_read = ahci_scr_read,
.scr_write = ahci_scr_write,
Expand Down
1 change: 0 additions & 1 deletion drivers/ata/ata_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ static struct ata_port_operations generic_port_ops = {
.irq_handler = ata_interrupt,
.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = ata_port_start,
};
Expand Down
3 changes: 0 additions & 3 deletions drivers/ata/ata_piix.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,6 @@ static const struct ata_port_operations piix_pata_ops = {
.irq_handler = ata_interrupt,
.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = ata_port_start,
};
Expand Down Expand Up @@ -352,7 +351,6 @@ static const struct ata_port_operations ich_pata_ops = {
.irq_handler = ata_interrupt,
.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = ata_port_start,
};
Expand Down Expand Up @@ -382,7 +380,6 @@ static const struct ata_port_operations piix_sata_ops = {
.irq_handler = ata_interrupt,
.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = ata_port_start,
};
Expand Down
6 changes: 2 additions & 4 deletions drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -5747,7 +5747,8 @@ inline unsigned int ata_host_intr (struct ata_port *ap,

#ifdef ATA_IRQ_TRAP
if ((ap->stats.idle_irq % 1000) == 0) {
ap->ops->irq_ack(ap, 0); /* debug trap */
ata_chk_status(ap);
ap->ops->irq_clear(ap);
ata_port_printk(ap, KERN_WARNING, "irq trap\n");
return 1;
}
Expand Down Expand Up @@ -7137,9 +7138,6 @@ EXPORT_SYMBOL_GPL(ata_eh_qc_complete);
EXPORT_SYMBOL_GPL(ata_eh_qc_retry);
EXPORT_SYMBOL_GPL(ata_do_eh);
EXPORT_SYMBOL_GPL(ata_irq_on);
EXPORT_SYMBOL_GPL(ata_dummy_irq_on);
EXPORT_SYMBOL_GPL(ata_irq_ack);
EXPORT_SYMBOL_GPL(ata_dummy_irq_ack);
EXPORT_SYMBOL_GPL(ata_dev_try_classify);

EXPORT_SYMBOL_GPL(ata_cable_40wire);
Expand Down
40 changes: 0 additions & 40 deletions drivers/ata/libata-sff.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,46 +64,6 @@ u8 ata_irq_on(struct ata_port *ap)
return tmp;
}

u8 ata_dummy_irq_on (struct ata_port *ap) { return 0; }

/**
* ata_irq_ack - Acknowledge a device interrupt.
* @ap: Port on which interrupts are enabled.
*
* Wait up to 10 ms for legacy IDE device to become idle (BUSY
* or BUSY+DRQ clear). Obtain dma status and port status from
* device. Clear the interrupt. Return port status.
*
* LOCKING:
*/

u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq)
{
unsigned int bits = chk_drq ? ATA_BUSY | ATA_DRQ : ATA_BUSY;
u8 host_stat = 0, post_stat = 0, status;

status = ata_busy_wait(ap, bits, 1000);
if (status & bits)
if (ata_msg_err(ap))
printk(KERN_ERR "abnormal status 0x%X\n", status);

if (ap->ioaddr.bmdma_addr) {
/* get controller status; clear intr, err bits */
host_stat = ioread8(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
iowrite8(host_stat | ATA_DMA_INTR | ATA_DMA_ERR,
ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);

post_stat = ioread8(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
}
if (ata_msg_intr(ap))
printk(KERN_INFO "%s: irq ack: host_stat 0x%X, new host_stat 0x%X, drv_stat 0x%X\n",
__FUNCTION__,
host_stat, post_stat, status);
return status;
}

u8 ata_dummy_irq_ack(struct ata_port *ap, unsigned int chk_drq) { return 0; }

/**
* ata_tf_load - send taskfile registers to host controller
* @ap: Port to which output is sent
Expand Down
4 changes: 0 additions & 4 deletions drivers/ata/pata_ali.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,6 @@ static struct ata_port_operations ali_early_port_ops = {
.irq_handler = ata_interrupt,
.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = ata_port_start,
};
Expand Down Expand Up @@ -369,7 +368,6 @@ static struct ata_port_operations ali_20_port_ops = {
.irq_handler = ata_interrupt,
.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = ata_port_start,
};
Expand Down Expand Up @@ -408,7 +406,6 @@ static struct ata_port_operations ali_c2_port_ops = {
.irq_handler = ata_interrupt,
.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = ata_port_start,
};
Expand Down Expand Up @@ -446,7 +443,6 @@ static struct ata_port_operations ali_c5_port_ops = {
.irq_handler = ata_interrupt,
.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = ata_port_start,
};
Expand Down
6 changes: 0 additions & 6 deletions drivers/ata/pata_amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,6 @@ static struct ata_port_operations amd33_port_ops = {
.irq_handler = ata_interrupt,
.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = ata_port_start,
};
Expand Down Expand Up @@ -393,7 +392,6 @@ static struct ata_port_operations amd66_port_ops = {
.irq_handler = ata_interrupt,
.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = ata_port_start,
};
Expand Down Expand Up @@ -428,7 +426,6 @@ static struct ata_port_operations amd100_port_ops = {
.irq_handler = ata_interrupt,
.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = ata_port_start,
};
Expand Down Expand Up @@ -463,7 +460,6 @@ static struct ata_port_operations amd133_port_ops = {
.irq_handler = ata_interrupt,
.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = ata_port_start,
};
Expand Down Expand Up @@ -498,7 +494,6 @@ static struct ata_port_operations nv100_port_ops = {
.irq_handler = ata_interrupt,
.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = ata_port_start,
};
Expand Down Expand Up @@ -533,7 +528,6 @@ static struct ata_port_operations nv133_port_ops = {
.irq_handler = ata_interrupt,
.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = ata_port_start,
};
Expand Down
2 changes: 0 additions & 2 deletions drivers/ata/pata_artop.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,6 @@ static const struct ata_port_operations artop6210_ops = {
.irq_handler = ata_interrupt,
.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = ata_port_start,
};
Expand Down Expand Up @@ -394,7 +393,6 @@ static const struct ata_port_operations artop6260_ops = {
.irq_handler = ata_interrupt,
.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = ata_port_start,
};
Expand Down
1 change: 0 additions & 1 deletion drivers/ata/pata_atiixp.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ static struct ata_port_operations atiixp_port_ops = {
.irq_handler = ata_interrupt,
.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = ata_port_start,
};
Expand Down
1 change: 0 additions & 1 deletion drivers/ata/pata_cmd640.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ static struct ata_port_operations cmd640_port_ops = {
.irq_handler = ata_interrupt,
.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = cmd640_port_start,
};
Expand Down
3 changes: 0 additions & 3 deletions drivers/ata/pata_cmd64x.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@ static struct ata_port_operations cmd64x_port_ops = {
.irq_handler = ata_interrupt,
.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = ata_port_start,
};
Expand Down Expand Up @@ -348,7 +347,6 @@ static struct ata_port_operations cmd646r1_port_ops = {
.irq_handler = ata_interrupt,
.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = ata_port_start,
};
Expand Down Expand Up @@ -383,7 +381,6 @@ static struct ata_port_operations cmd648_port_ops = {
.irq_handler = ata_interrupt,
.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = ata_port_start,
};
Expand Down
1 change: 0 additions & 1 deletion drivers/ata/pata_cs5520.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ static struct ata_port_operations cs5520_port_ops = {

.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = ata_port_start,
};
Expand Down
1 change: 0 additions & 1 deletion drivers/ata/pata_cs5530.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ static struct ata_port_operations cs5530_port_ops = {
.irq_handler = ata_interrupt,
.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = ata_port_start,
};
Expand Down
1 change: 0 additions & 1 deletion drivers/ata/pata_cs5535.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ static struct ata_port_operations cs5535_port_ops = {
.irq_handler = ata_interrupt,
.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = ata_port_start,
};
Expand Down
1 change: 0 additions & 1 deletion drivers/ata/pata_cypress.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ static struct ata_port_operations cy82c693_port_ops = {
.irq_handler = ata_interrupt,
.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = ata_port_start,
};
Expand Down
1 change: 0 additions & 1 deletion drivers/ata/pata_efar.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ static const struct ata_port_operations efar_ops = {
.irq_handler = ata_interrupt,
.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = ata_port_start,
};
Expand Down
1 change: 0 additions & 1 deletion drivers/ata/pata_hpt366.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,6 @@ static struct ata_port_operations hpt366_port_ops = {
.irq_handler = ata_interrupt,
.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = ata_port_start,
};
Expand Down
4 changes: 0 additions & 4 deletions drivers/ata/pata_hpt37x.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,6 @@ static struct ata_port_operations hpt370_port_ops = {
.irq_handler = ata_interrupt,
.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = ata_port_start,
};
Expand Down Expand Up @@ -712,7 +711,6 @@ static struct ata_port_operations hpt370a_port_ops = {
.irq_handler = ata_interrupt,
.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = ata_port_start,
};
Expand Down Expand Up @@ -752,7 +750,6 @@ static struct ata_port_operations hpt372_port_ops = {
.irq_handler = ata_interrupt,
.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = ata_port_start,
};
Expand Down Expand Up @@ -792,7 +789,6 @@ static struct ata_port_operations hpt374_port_ops = {
.irq_handler = ata_interrupt,
.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = ata_port_start,
};
Expand Down
1 change: 0 additions & 1 deletion drivers/ata/pata_hpt3x2n.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,6 @@ static struct ata_port_operations hpt3x2n_port_ops = {
.irq_handler = ata_interrupt,
.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = ata_port_start,
};
Expand Down
1 change: 0 additions & 1 deletion drivers/ata/pata_hpt3x3.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ static struct ata_port_operations hpt3x3_port_ops = {
.irq_handler = ata_interrupt,
.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = ata_port_start,
};
Expand Down
18 changes: 0 additions & 18 deletions drivers/ata/pata_icside.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,23 +357,6 @@ static void pata_icside_error_handler(struct ata_port *ap)
pata_icside_postreset);
}

static u8 pata_icside_irq_ack(struct ata_port *ap, unsigned int chk_drq)
{
unsigned int bits = chk_drq ? ATA_BUSY | ATA_DRQ : ATA_BUSY;
u8 status;

status = ata_busy_wait(ap, bits, 1000);
if (status & bits)
if (ata_msg_err(ap))
printk(KERN_ERR "abnormal status 0x%X\n", status);

if (ata_msg_intr(ap))
printk(KERN_INFO "%s: irq ack: drv_stat 0x%X\n",
__FUNCTION__, status);

return status;
}

static struct ata_port_operations pata_icside_port_ops = {
.port_disable = ata_port_disable,

Expand Down Expand Up @@ -403,7 +386,6 @@ static struct ata_port_operations pata_icside_port_ops = {

.irq_clear = ata_dummy_noret,
.irq_on = ata_irq_on,
.irq_ack = pata_icside_irq_ack,

.port_start = pata_icside_port_start,

Expand Down
1 change: 0 additions & 1 deletion drivers/ata/pata_isapnp.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ static struct ata_port_operations isapnp_port_ops = {

.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = ata_port_start,
};
Expand Down
1 change: 0 additions & 1 deletion drivers/ata/pata_it8213.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ static const struct ata_port_operations it8213_ops = {
.irq_handler = ata_interrupt,
.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = ata_port_start,
};
Expand Down
Loading

0 comments on commit 6d32d30

Please sign in to comment.