Skip to content

Commit

Permalink
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/git/jgarzik/libata-dev

* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  drivers/ata/pata_ixp4xx_cf.c: ioremap return code check
  Ata: pata_marvell, use ioread* for iomap-ped memory
  libata: fix for sata_mv >64KB DMA segments
  • Loading branch information
Linus Torvalds committed Oct 3, 2007
2 parents 3e0ca2f + 991bf52 commit 804b3f9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
3 changes: 3 additions & 0 deletions drivers/ata/pata_ixp4xx_cf.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ static __devinit int ixp4xx_pata_probe(struct platform_device *pdev)
data->cs0 = devm_ioremap(&pdev->dev, cs0->start, 0x1000);
data->cs1 = devm_ioremap(&pdev->dev, cs1->start, 0x1000);

if (!data->cs0 || !data->cs1)
return -ENOMEM;

irq = platform_get_irq(pdev, 0);
if (irq)
set_irq_type(irq, IRQT_RISING);
Expand Down
4 changes: 2 additions & 2 deletions drivers/ata/pata_marvell.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ static int marvell_pre_reset(struct ata_port *ap, unsigned long deadline)
return -ENOMEM;
printk("BAR5:");
for(i = 0; i <= 0x0F; i++)
printk("%02X:%02X ", i, readb(barp + i));
printk("%02X:%02X ", i, ioread8(barp + i));
printk("\n");

devices = readl(barp + 0x0C);
devices = ioread32(barp + 0x0C);
pci_iounmap(pdev, barp);

if ((pdev->device == 0x6145) && (ap->port_no == 0) &&
Expand Down
26 changes: 19 additions & 7 deletions drivers/ata/sata_mv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1139,15 +1139,27 @@ static unsigned int mv_fill_sg(struct ata_queued_cmd *qc)
dma_addr_t addr = sg_dma_address(sg);
u32 sg_len = sg_dma_len(sg);

mv_sg->addr = cpu_to_le32(addr & 0xffffffff);
mv_sg->addr_hi = cpu_to_le32((addr >> 16) >> 16);
mv_sg->flags_size = cpu_to_le32(sg_len & 0xffff);
while (sg_len) {
u32 offset = addr & 0xffff;
u32 len = sg_len;

if (ata_sg_is_last(sg, qc))
mv_sg->flags_size |= cpu_to_le32(EPRD_FLAG_END_OF_TBL);
if ((offset + sg_len > 0x10000))
len = 0x10000 - offset;

mv_sg->addr = cpu_to_le32(addr & 0xffffffff);
mv_sg->addr_hi = cpu_to_le32((addr >> 16) >> 16);
mv_sg->flags_size = cpu_to_le32(len);

sg_len -= len;
addr += len;

if (!sg_len && ata_sg_is_last(sg, qc))
mv_sg->flags_size |= cpu_to_le32(EPRD_FLAG_END_OF_TBL);

mv_sg++;
n_sg++;
}

mv_sg++;
n_sg++;
}

return n_sg;
Expand Down

0 comments on commit 804b3f9

Please sign in to comment.