linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: linux-ide@vger.kernel.org, tj@kernel.org
Cc: linux-sh@vger.kernel.org
Subject: [PATCH 2/3] sata_rcar: correct 'sata_rcar_sht'
Date: Mon, 27 May 2013 22:45:08 +0000	[thread overview]
Message-ID: <201305280245.09149.sergei.shtylyov@cogentembedded.com> (raw)
In-Reply-To: <201305280238.17867.sergei.shtylyov@cogentembedded.com>

Using ATA_BMDMA_SHT() to intialize 'sata_rcar_sht' was suboptimal as the R-Car
descriptor table transfer counter is 28 bits wide (bit 1 to bit 28), so that the
'dma_boundary' field of 0xFFFF is just too small, as well as the 'sg_tablesize'
field of 128.  Use ATA_BASE_SHT() to initialize 'sata_rcar_sht' instead and give
proper values to the 'dma_boundary' and 'sg_tablesize' fields explicitly. 

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
 drivers/ata/sata_rcar.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

Index: libata/drivers/ata/sata_rcar.c
=================================--- libata.orig/drivers/ata/sata_rcar.c
+++ libata/drivers/ata/sata_rcar.c
@@ -121,6 +121,8 @@
 /* Descriptor table word 0 bit (when DTA32M = 1) */
 #define SATA_RCAR_DTEND			BIT(0)
 
+#define SATA_RCAR_DMA_BOUNDARY		0x1FFFFFFEUL
+
 struct sata_rcar_priv {
 	void __iomem *base;
 	struct clk *clk;
@@ -575,7 +577,14 @@ static u8 sata_rcar_bmdma_status(struct 
 }
 
 static struct scsi_host_template sata_rcar_sht = {
-	ATA_BMDMA_SHT(DRV_NAME),
+	ATA_BASE_SHT(DRV_NAME),
+	/*
+	 * This controller allows transfer chunks up to 512MB which cross 64KB
+	 * boundaries, therefore the DMA limits are more relaxed than standard
+	 * ATA SFF.
+	 */
+	.sg_tablesize		= ATA_MAX_PRD,
+	.dma_boundary		= SATA_RCAR_DMA_BOUNDARY,
 };
 
 static struct ata_port_operations sata_rcar_port_ops = {


  parent reply	other threads:[~2013-05-27 22:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-27 22:38 [PATCH 0/3] Optimize R-Car SATA driver Sergei Shtylyov
2013-05-27 22:43 ` [PATCH 1/3] sata_rcar: kill superfluous code in sata_rcar_bmdma_fill_sg() Sergei Shtylyov
2013-05-27 22:45 ` Sergei Shtylyov [this message]
2013-05-27 22:46 ` [PATCH 3/3] sata_rcar: add 'base' local variable to some functions Sergei Shtylyov
2013-05-28  0:20 ` [PATCH 0/3] Optimize R-Car SATA driver Tejun Heo
2013-05-28 11:53   ` Sergei Shtylyov
2013-05-28 11:58     ` Tejun Heo

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=201305280245.09149.sergei.shtylyov@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=tj@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).