Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 11407
b: refs/heads/master
c: a7dac44
h: refs/heads/master
i:
  11405: 19e9448
  11403: 670b2ea
  11399: 7c82b3b
  11391: ca85b3a
v: v3
  • Loading branch information
Jeff Garzik committed Oct 30, 2005
1 parent f7780fc commit 17c36fd
Show file tree
Hide file tree
Showing 12 changed files with 168 additions and 286 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f0612bbc41f65f5a684f69d714a1a17a6f0f40c5
refs/heads/master: a7dac447bb9cef27d4d29cdf63e2d7809c50b1f4
34 changes: 13 additions & 21 deletions trunk/drivers/scsi/ahci.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,15 +312,8 @@ static int ahci_port_start(struct ata_port *ap)
return -ENOMEM;
memset(pp, 0, sizeof(*pp));

ap->pad = dma_alloc_coherent(dev, ATA_DMA_PAD_BUF_SZ, &ap->pad_dma, GFP_KERNEL);
if (!ap->pad) {
kfree(pp);
return -ENOMEM;
}

mem = dma_alloc_coherent(dev, AHCI_PORT_PRIV_DMA_SZ, &mem_dma, GFP_KERNEL);
if (!mem) {
dma_free_coherent(dev, ATA_DMA_PAD_BUF_SZ, ap->pad, ap->pad_dma);
kfree(pp);
return -ENOMEM;
}
Expand Down Expand Up @@ -396,7 +389,6 @@ static void ahci_port_stop(struct ata_port *ap)
ap->private_data = NULL;
dma_free_coherent(dev, AHCI_PORT_PRIV_DMA_SZ,
pp->cmd_slot, pp->cmd_slot_dma);
dma_free_coherent(dev, ATA_DMA_PAD_BUF_SZ, ap->pad, ap->pad_dma);
kfree(pp);
}

Expand Down Expand Up @@ -475,23 +467,23 @@ static void ahci_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
static void ahci_fill_sg(struct ata_queued_cmd *qc)
{
struct ahci_port_priv *pp = qc->ap->private_data;
struct scatterlist *sg;
struct ahci_sg *ahci_sg;
unsigned int i;

VPRINTK("ENTER\n");

/*
* Next, the S/G list.
*/
ahci_sg = pp->cmd_tbl_sg;
ata_for_each_sg(sg, qc) {
dma_addr_t addr = sg_dma_address(sg);
u32 sg_len = sg_dma_len(sg);

ahci_sg->addr = cpu_to_le32(addr & 0xffffffff);
ahci_sg->addr_hi = cpu_to_le32((addr >> 16) >> 16);
ahci_sg->flags_size = cpu_to_le32(sg_len - 1);
ahci_sg++;
for (i = 0; i < qc->n_elem; i++) {
u32 sg_len;
dma_addr_t addr;

addr = sg_dma_address(&qc->sg[i]);
sg_len = sg_dma_len(&qc->sg[i]);

pp->cmd_tbl_sg[i].addr = cpu_to_le32(addr & 0xffffffff);
pp->cmd_tbl_sg[i].addr_hi = cpu_to_le32((addr >> 16) >> 16);
pp->cmd_tbl_sg[i].flags_size = cpu_to_le32(sg_len - 1);
}
}

Expand Down Expand Up @@ -608,7 +600,7 @@ static void ahci_eng_timeout(struct ata_port *ap)
* not being called from the SCSI EH.
*/
qc->scsidone = scsi_finish_command;
ata_qc_complete(qc, ATA_ERR);
ata_qc_complete(qc, AC_ERR_OTHER);
}

spin_unlock_irqrestore(&host_set->lock, flags);
Expand Down Expand Up @@ -637,7 +629,7 @@ static inline int ahci_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc)
if (status & PORT_IRQ_FATAL) {
ahci_intr_error(ap, status);
if (qc)
ata_qc_complete(qc, ATA_ERR);
ata_qc_complete(qc, AC_ERR_OTHER);
}

return 1;
Expand Down
Loading

0 comments on commit 17c36fd

Please sign in to comment.