Hello.
On 05/25/2013 03:12 AM, Sergei Shtylyov wrote:
Tejun, a question for you... see below.
From: Vladimir Barinov <vladimir.barinov@xxxxxxxxxxxxxxxxxx>
Add Renesas R-Car on-chip 3Gbps SATA controller driver.
Signed-off-by: Vladimir Barinov <vladimir.barinov@xxxxxxxxxxxxxxxxxx>
[Sergei: few bugs fixed, significant cleanup]
Not all bugs turned out to be fixed... :-/
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@xxxxxxxxxxxxxxxxxx>
[...]
Index: renesas/drivers/ata/sata_rcar.c
===================================================================
--- /dev/null
+++ renesas/drivers/ata/sata_rcar.c
@@ -0,0 +1,910 @@
[...]
+static void sata_rcar_bmdma_fill_sg(struct ata_queued_cmd *qc)
+{
+ struct ata_port *ap = qc->ap;
+ struct ata_bmdma_prd *prd = ap->bmdma_prd;
+ struct scatterlist *sg;
+ unsigned int si, pi;
+
+ pi = 0;
+ for_each_sg(qc->sg, sg, qc->n_elem, si) {
+ u32 addr, sg_len, len;
+
+ /*
+ * Note: h/w doesn't support 64-bit, so we unconditionally
+ * truncate dma_addr_t to u32.
+ */
+ addr = (u32)sg_dma_address(sg);
+ sg_len = sg_dma_len(sg);
+
+ /* H/w transfer count is only 29 bits long, let's be careful */
+ while (sg_len) {
+ len = sg_len;
+ if (len > 0x1ffffffe)
This value should have been put into the 'dma_boundary' field of the
'struct scsi_host_template', IIUC. Tejun, if I do it, do I need this
check at all?
You haven't replied, so I went and searched an answer myself. Indeed,
it's enough to specify the right 'dma_boundary' and stop bothering about it.
Expect two patches to the driver. I think the correct branch for them
will be
'for-3.11'.
WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html