linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: linux-arch@vger.kernel.org
Subject: [RFC PATCH 3/4] pio-mapping: Use the PIO mapping API in libata-sff.c
Date: Fri, 05 Feb 2010 16:32:00 +0000	[thread overview]
Message-ID: <20100205163200.30827.51929.stgit@pc1117.cambridge.arm.com> (raw)
In-Reply-To: <20100205163044.30827.10915.stgit@pc1117.cambridge.arm.com>

This patch shows an example of PIO API usage for non-highmem pages. It
is assumed that kunmap_atomic() performs cache flushing though this may
not always be the case (needs checking with architecture people).

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
---
 drivers/ata/libata-sff.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index 741065c..5b72a92 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -36,6 +36,7 @@
 #include <linux/pci.h>
 #include <linux/libata.h>
 #include <linux/highmem.h>
+#include <linux/pio-mapping.h>
 
 #include "libata.h"
 
@@ -888,9 +889,12 @@ static void ata_pio_sector(struct ata_queued_cmd *qc)
 		kunmap_atomic(buf, KM_IRQ0);
 		local_irq_restore(flags);
 	} else {
-		buf = page_address(page);
-		ap->ops->sff_data_xfer(qc->dev, buf + offset, qc->sect_size,
-				       do_write);
+		enum pio_data_direction dir = do_write ?
+			PIO_TO_DEVICE : PIO_FROM_DEVICE;
+
+		buf = pio_map_page(page, offset, qc->sect_size, dir);
+		ap->ops->sff_data_xfer(qc->dev, buf, qc->sect_size, do_write);
+		pio_unmap_page(buf, qc->sect_size, dir);
 	}
 
 	qc->curbytes += qc->sect_size;

  parent reply	other threads:[~2010-02-05 16:32 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-05 16:31 [RFC PATCH 0/4] PIO drivers and cache coherency Catalin Marinas
2010-02-05 16:31 ` [RFC PATCH 1/4] pio-mapping: Add generic support for PIO mapping API Catalin Marinas
2010-02-05 16:31 ` [RFC PATCH 2/4] pio-mapping: Add ARM support for the " Catalin Marinas
2010-02-05 16:43   ` James Bottomley
2010-02-05 17:20     ` Catalin Marinas
2010-02-05 17:36       ` James Bottomley
2010-02-05 18:02         ` Catalin Marinas
2010-02-08 16:10         ` Catalin Marinas
2010-02-08 16:54           ` Russell King
2010-02-08 17:20             ` James Bottomley
2010-02-08 17:33               ` Russell King
2010-02-08 19:07                 ` James Bottomley
2010-02-08 18:02             ` [RFC PATCH 2/4] pio-mapping: Add ARM support for the PIOmapping API Catalin Marinas
2010-02-08 19:09               ` James Bottomley
2010-02-08 17:14           ` [RFC PATCH 2/4] pio-mapping: Add ARM support for the PIO mapping API James Bottomley
2010-02-09 18:03             ` Catalin Marinas
2010-02-17  9:11               ` Benjamin Herrenschmidt
2010-02-17 20:04                 ` Russell King
2010-02-17 20:39                   ` Benjamin Herrenschmidt
2010-02-05 16:32 ` Catalin Marinas [this message]
2010-02-05 16:32 ` [RFC PATCH 4/4] pio-mapping: Use the PIO mapping API in the ISP1760 HCD driver Catalin Marinas

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=20100205163200.30827.51929.stgit@pc1117.cambridge.arm.com \
    --to=catalin.marinas@arm.com \
    --cc=linux-arch@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).