DIFF 2.6.0-test10 SATA dma_address
Willy, Alan,
SATA support attempts to directly reference scattergather.dma_address and .dma_length. That's wrong since those are arch specific fields. alpha, cris, parisc, ppc64, sparc, and sparc64 won't build SATA.
SATA code needs to use "sg_dma_address()" and sg_dma_len()" macros to reference those fields.
If this patch looks good, please tell me which forum (linux-scsi?) this needs to be posted to.
Patch appended and also available from:
ftp://ftp.parisc-linux.org/patches/diff-2.6.0-t10-sata
The code now compiles but I've not yet built a kernel (forgot to disable KALLSYMS - toolchain bugs) and don't have the HW to test it.
cheers,
grant
Index: drivers/scsi/libata-core.c
===================================================================
RCS file: /var/cvs/linux-2.6/drivers/scsi/libata-core.c,v retrieving revision 1.3
scsi/libata-core.c +7 -7
@@ -1627,8 +1627,8 @@ static void ata_sg_clean(struct ata_queuif (cmd->use_sg)pci_unmap_sg (ap->host_set->pdev, sg, qc->n_elem, dir);else -pci_unmap_single (ap->host_set->pdev, sg[0 ].dma_address, - sg[0 ].length, dir); +pci_unmap_single (ap->host_set->pdev,sg_dma_address (&sg[0 ]), +sg_dma_len (&sg[0 ]), dir); qc->flags &= ~ATA_QCFLAG_SG ; qc->sg =NULL ;
@@ -1651,8 +1651,8 @@ void ata_fill_sg(struct ata_queued_cmd *assert (qc->n_elem >0 );for (i =0 ; i < qc->n_elem; i++) { - ap->prd[i].addr =cpu_to_le32 (sg[i].dma_address); - ap->prd[i].flags_len =cpu_to_le32 (sg[i].length); + ap->prd[i].addr =cpu_to_le32 (sg_dma_address (&sg[i])); + ap->prd[i].flags_len =cpu_to_le32 (sg_dma_len (&sg[i]));VPRINTK ("PRD[%u] = (0x%X, 0x%X)\n" , i,le32_to_cpu (ap->prd[i].addr),le32_to_cpu (ap->prd[i].flags_len)); }
@@ -1683,12 +1683,12 @@ static int ata_sg_setup_one(struct ata_q sg->page =virt_to_page (cmd->request_buffer); sg->offset = (unsigned long ) cmd->request_buffer & ~PAGE_MASK ; - sg->length = cmd->request_bufflen; +sg_dma_len (sg) = cmd->request_bufflen;if (!have_sg)return 0 ; - sg->dma_address =pci_map_single (ap->host_set->pdev, +sg_dma_address (sg) =pci_map_single (ap->host_set->pdev, cmd->request_buffer, cmd->request_bufflen, dir);
@@ -1909,7 +1909,7 @@ static void ata_pio_sector(struct ata_po qc->cursg_ofs++;if (cmd->use_sg) -if ((qc->cursg_ofs *ATA_SECT_SIZE ) == sg[qc->cursg].length) { +if ((qc->cursg_ofs *ATA_SECT_SIZE ) ==sg_dma_len (&sg[qc->cursg])) { qc->cursg++; qc->cursg_ofs =0 ; }
Index: drivers/scsi/sata_promise.c
===================================================================
RCS file: /var/cvs/linux-2.6/drivers/scsi/sata_promise.c,v retrieving revision 1.3
scsi/sata_promise.c +2 -2
@@ -603,8 +603,8 @@ static void pdc20621_fill_sg(struct ata_ last = qc->n_elem; idx =0 ;for (i =0 ; i < last; i++) { - buf[idx++] =cpu_to_le32 (sg[i].dma_address); - buf[idx++] =cpu_to_le32 (sg[i].length); + buf[idx++] =cpu_to_le32 (sg_dma_address (&sg[i])); + buf[idx++] =cpu_to_le32 (sg_dma_len (&sg[i])); total_len += sg[i].length; } buf[idx -1 ] |=cpu_to_le32 (ATA_PRD_EOT );
Hi Grant,
Quoted 6 lines · Grant Grundler
Willy, Alan,
SATA support attempts to directly reference scattergather.dma_address and .dma_length. That's wrong since those are arch specific fields. alpha, cris, parisc, ppc64, sparc, and sparc64 won't build SATA.
Quoted 6 lines
SATA code needs to use "
sg_dma_address()" andsg_dma_len()" macros to reference those fields.If this patch looks good, please tell me which forum (linux-scsi?) this needs to be posted to.
Hmm I don't see any follow up but i just read in "post-halloween-2.6.txt" (Reporting bugs. section) that
[snip]
SCSI - [email protected]
[snip]
Quoted 6 lines
Patch appended and also available from:
ftp://ftp.parisc-linux.org/patches/diff-2.6.0-t10-sataThe code now compiles but I've not yet built a kernel (forgot to disable KALLSYMS - toolchain bugs) and don't have the HW to test it.
hth,
Joel
PS: Sorry I miss to follow this patch :(
Quoted 5 lines · Joel Soete
Hmm I don't see any follow up but i just read in "post-halloween-2.6.txt" (Reporting bugs. section) that
[snip]
SCSI - [email protected]
[snip]
The SATA maintainer (Jeff Garzik) has already applied this patch.
James