forked from luck/tmp_suning_uos_patched
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/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
This commit is contained in:
commit
804b3f9a16
@ -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);
|
||||
|
@ -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) &&
|
||||
|
@ -1139,17 +1139,29 @@ 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);
|
||||
|
||||
while (sg_len) {
|
||||
u32 offset = addr & 0xffff;
|
||||
u32 len = sg_len;
|
||||
|
||||
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(sg_len & 0xffff);
|
||||
mv_sg->flags_size = cpu_to_le32(len);
|
||||
|
||||
if (ata_sg_is_last(sg, qc))
|
||||
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++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return n_sg;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user