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

Commit 8746618d authored by Tejun Heo's avatar Tejun Heo Committed by Jeff Garzik
Browse files

[PATCH] sil24: move error handling out of hot interrupt path



04_sil24_add-error_intr-function.patch

	Move error handling from sil24_host_intr into separate
        function - sil24_error_intr.

Signed-off-by: default avatarTejun Heo <htejun@gmail.com>

 sata_sil24.c |   55 +++++++++++++++++++++++++++++++------------------------
 1 files changed, 31 insertions(+), 24 deletions(-)
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent 06460aea
Loading
Loading
Loading
Loading
+31 −24
Original line number Diff line number Diff line
@@ -480,18 +480,11 @@ static void sil24_eng_timeout(struct ata_port *ap)
	sil24_reset_controller(ap);
}

static inline void sil24_host_intr(struct ata_port *ap)
static void sil24_error_intr(struct ata_port *ap, u32 slot_stat)
{
	struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->active_tag);
	struct sil24_port_priv *pp = ap->private_data;
	void *port = pp->port;
	u32 slot_stat;

	slot_stat = readl(port + PORT_SLOT_STAT);
	if (!(slot_stat & HOST_SSTAT_ATTN)) {
		if (qc)
			ata_qc_complete(qc, 0);
	} else {
	u32 irq_stat, cmd_err, sstatus, serror;

	irq_stat = readl(port + PORT_IRQ_STAT);
@@ -515,6 +508,20 @@ static inline void sil24_host_intr(struct ata_port *ap)

	sil24_reset_controller(ap);
}

static inline void sil24_host_intr(struct ata_port *ap)
{
	struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->active_tag);
	struct sil24_port_priv *pp = ap->private_data;
	void *port = pp->port;
	u32 slot_stat;

	slot_stat = readl(port + PORT_SLOT_STAT);
	if (!(slot_stat & HOST_SSTAT_ATTN)) {
		if (qc)
			ata_qc_complete(qc, 0);
	} else
		sil24_error_intr(ap, slot_stat);
}

static irqreturn_t sil24_interrupt(int irq, void *dev_instance, struct pt_regs *regs)