linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Cox <alan@linux.intel.com>
To: jeff@garzik.org, linux-ide@vger.kernel.org
Subject: [PATCH 3/3] libata: Make sil680 do its own exec_command posting
Date: Wed, 05 May 2010 10:25:58 +0100	[thread overview]
Message-ID: <20100505092542.586.16410.stgit@localhost.localdomain> (raw)
In-Reply-To: <20100505092350.586.46344.stgit@localhost.localdomain>

Use our own mmio area to avoid PCI posting. This avoids the rather slow
paranoid implementation in the default handler.

Signed-off-by: Alan Cox <alan@linux.intel.com>
---

 drivers/ata/pata_sil680.c |   30 ++++++++++++++++++++++++++----
 1 files changed, 26 insertions(+), 4 deletions(-)


diff --git a/drivers/ata/pata_sil680.c b/drivers/ata/pata_sil680.c
index c6c589c..43faf10 100644
--- a/drivers/ata/pata_sil680.c
+++ b/drivers/ata/pata_sil680.c
@@ -190,15 +190,37 @@ static void sil680_set_dmamode(struct ata_port *ap, struct ata_device *adev)
 	pci_write_config_word(pdev, ua, ultra);
 }
 
+/**
+ *	sil680_sff_exec_command - issue ATA command to host controller
+ *	@ap: port to which command is being issued
+ *	@tf: ATA taskfile register set
+ *
+ *	Issues ATA command, with proper synchronization with interrupt
+ *	handler / other threads. Use our MMIO space for PCI posting to avoid
+ *	a hideously slow cycle all the way to the device.
+ *
+ *	LOCKING:
+ *	spin_lock_irqsave(host lock)
+ */
+void sil680_sff_exec_command(struct ata_port *ap,
+					const struct ata_taskfile *tf)
+{
+	DPRINTK("ata%u: cmd 0x%X\n", ap->print_id, tf->command);
+	iowrite8(tf->command, ap->ioaddr.command_addr);
+	ioread8(ap->ioaddr.bmdma_addr + ATA_DMA_CMD);
+}
+
 static struct scsi_host_template sil680_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
+
 static struct ata_port_operations sil680_port_ops = {
-	.inherits	= &ata_bmdma32_port_ops,
-	.cable_detect	= sil680_cable_detect,
-	.set_piomode	= sil680_set_piomode,
-	.set_dmamode	= sil680_set_dmamode,
+	.inherits		= &ata_bmdma32_port_ops,
+	.sff_exec_command	= sil680_sff_exec_command,
+	.cable_detect		= sil680_cable_detect,
+	.set_piomode		= sil680_set_piomode,
+	.set_dmamode		= sil680_set_dmamode,
 };
 
 /**


  parent reply	other threads:[~2010-05-05 10:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-05  9:24 [PATCH 0/3] Resend: Libata delay patches Alan Cox
2010-05-05  9:24 ` [PATCH 1/3] libata: Remove excess delay in the tf_load path Alan Cox
2010-05-05 10:24   ` Sergei Shtylyov
2010-05-05 11:07     ` Alan Cox
2010-05-15  2:25   ` Jeff Garzik
2010-05-05  9:25 ` [PATCH 2/3] libata: Remove excess command issue delays Alan Cox
2010-05-15  2:24   ` Jeff Garzik
2010-05-15 14:09     ` Alan Cox
2010-05-17 22:21       ` Jeff Garzik
2010-06-10 20:01       ` Jeff Garzik
2010-05-05  9:25 ` Alan Cox [this message]
2010-05-15  2:34   ` [PATCH 3/3] libata: Make sil680 do its own exec_command posting Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100505092542.586.16410.stgit@localhost.localdomain \
    --to=alan@linux.intel.com \
    --cc=jeff@garzik.org \
    --cc=linux-ide@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).