Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 358f9a77 authored by Tejun Heo's avatar Tejun Heo Committed by Jeff Garzik
Browse files

libata: implement and use ata_noop_irq_clear()



->irq_clear() is used to clear IRQ bit of a SFF controller and isn't
useful for drivers which don't use libata SFF HSM implementation.
However, it's a required callback and many drivers implement their own
noop version as placeholder.  This patch implements ata_noop_irq_clear
and use it to replace those custom placeholders.

Also, SFF drivers which don't support BMDMA don't need to use
ata_bmdma_irq_clear().  It becomes noop if BMDMA address isn't
initialized.  Convert them to use ata_noop_irq_clear().

Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
parent c1bc899f
Loading
Loading
Loading
Loading
+3 −9
Original line number Diff line number Diff line
@@ -244,7 +244,6 @@ static int ahci_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val);
static int ahci_scr_write(struct ata_port *ap, unsigned int sc_reg, u32 val);
static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
static unsigned int ahci_qc_issue(struct ata_queued_cmd *qc);
static void ahci_irq_clear(struct ata_port *ap);
static int ahci_port_start(struct ata_port *ap);
static void ahci_port_stop(struct ata_port *ap);
static void ahci_tf_read(struct ata_port *ap, struct ata_taskfile *tf);
@@ -307,7 +306,7 @@ static const struct ata_port_operations ahci_ops = {
	.qc_prep		= ahci_qc_prep,
	.qc_issue		= ahci_qc_issue,

	.irq_clear		= ahci_irq_clear,
	.irq_clear		= ata_noop_irq_clear,

	.scr_read		= ahci_scr_read,
	.scr_write		= ahci_scr_write,
@@ -343,7 +342,7 @@ static const struct ata_port_operations ahci_vt8251_ops = {
	.qc_prep		= ahci_qc_prep,
	.qc_issue		= ahci_qc_issue,

	.irq_clear		= ahci_irq_clear,
	.irq_clear		= ata_noop_irq_clear,

	.scr_read		= ahci_scr_read,
	.scr_write		= ahci_scr_write,
@@ -377,7 +376,7 @@ static const struct ata_port_operations ahci_p5wdh_ops = {
	.qc_prep		= ahci_qc_prep,
	.qc_issue		= ahci_qc_issue,

	.irq_clear		= ahci_irq_clear,
	.irq_clear		= ata_noop_irq_clear,

	.scr_read		= ahci_scr_read,
	.scr_write		= ahci_scr_write,
@@ -1769,11 +1768,6 @@ static void ahci_port_intr(struct ata_port *ap)
	}
}

static void ahci_irq_clear(struct ata_port *ap)
{
	/* TODO */
}

static irqreturn_t ahci_interrupt(int irq, void *dev_instance)
{
	struct ata_host *host = dev_instance;
+1 −0
Original line number Diff line number Diff line
@@ -7824,6 +7824,7 @@ EXPORT_SYMBOL_GPL(ata_noop_qc_prep);
EXPORT_SYMBOL_GPL(ata_bmdma_setup);
EXPORT_SYMBOL_GPL(ata_bmdma_start);
EXPORT_SYMBOL_GPL(ata_bmdma_irq_clear);
EXPORT_SYMBOL_GPL(ata_noop_irq_clear);
EXPORT_SYMBOL_GPL(ata_bmdma_status);
EXPORT_SYMBOL_GPL(ata_bmdma_stop);
EXPORT_SYMBOL_GPL(ata_bmdma_freeze);
+8 −0
Original line number Diff line number Diff line
@@ -302,6 +302,14 @@ void ata_bmdma_irq_clear(struct ata_port *ap)
	iowrite8(ioread8(mmio + ATA_DMA_STATUS), mmio + ATA_DMA_STATUS);
}

/**
 *	ata_noop_irq_clear - Noop placeholder for irq_clear
 *	@ap: Port associated with this ATA transaction.
 */
void ata_noop_irq_clear(struct ata_port *ap)
{
}

/**
 *	ata_bmdma_status - Read PCI IDE BMDMA status
 *	@ap: Port associated with this ATA transaction.
+1 −1
Original line number Diff line number Diff line
@@ -380,7 +380,7 @@ static struct ata_port_operations ali_early_port_ops = {
	.data_xfer	= ata_data_xfer,

	.irq_handler	= ata_interrupt,
	.irq_clear	= ata_bmdma_irq_clear,
	.irq_clear	= ata_noop_irq_clear,
	.irq_on		= ata_irq_on,

	.port_start	= ata_sff_port_start,
+1 −6
Original line number Diff line number Diff line
@@ -166,11 +166,6 @@ static void pata_at32_set_piomode(struct ata_port *ap, struct ata_device *adev)
	}
}

static void pata_at32_irq_clear(struct ata_port *ap)
{
	/* No DMA controller yet */
}

static struct scsi_host_template at32_sht = {
	.module			= THIS_MODULE,
	.name			= DRV_NAME,
@@ -208,7 +203,7 @@ static struct ata_port_operations at32_port_ops = {

	.data_xfer		= ata_data_xfer,

	.irq_clear		= pata_at32_irq_clear,
	.irq_clear		= ata_noop_irq_clear,
	.irq_on			= ata_irq_on,

	.port_start		= ata_sff_port_start,
Loading