Re: [PATCH 3/4] Fix remaining big endian issue of hfcmulti

From: Benjamin Herrenschmidt
Date: Tue Aug 05 2008 - 09:05:09 EST



> Thanks for this hint, I didn't know that the repetive versions are
> for byte streams and not for eg. transfer of multiple u32.
> So it makes things lot easier the code should look like:
>
> int l = len >> 2;
>
> if (l) {
> ioread32_rep(hc->pci_membase + A_FIFO_DATA0, data, l);
> data += l << 2;
> }
> if (len & 2) {
> ioread16_rep(hc->pci_membase + A_FIFO_DATA0, data, 1);
> data += 2;
> }
> if (len & 1)
> writeb(*data, hc->pci_membase + A_FIFO_DATA0);

Don't mix the io* variants with the PCI variants. Use iowrite8 for the
last one and make sure you do a proper pci_iomap.

One cool thing with the new iomap stuff is that it also works for both
PIO and MMIO, so you no longer need to differenciate writeX from outX
as long as you use the right mapping stuff initially.

Ben.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/