From: Jeremy Fitzhardinge on
On 05/11/2010 11:28 AM, Albert Herranz wrote:
> Konrad Rzeszutek Wilk wrote:
>
>> +extern void *swiotlb_tbl_map_single(struct device *hwdev, phys_addr_t phys,
>> + u64 tbl_dma_addr, size_t size,
>> + enum dma_data_direction dir);
>> +
>>
> The phys and tbl_dma_addr arguments in the function prototype are swapped compared to the function definition in patch 1/6.
>

Good catch. I can see someone beating their head bloody over that...

J
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Albert Herranz on
Konrad Rzeszutek Wilk wrote:
> We put the functions dealing with the operations on
> the SWIOTLB buffer in the header and make those functions non-static.
>
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk(a)oracle.com>
> ---
> include/linux/swiotlb.h | 22 ++++++++++++++++++++++
> lib/swiotlb.c | 28 ++++++++++++----------------
> 2 files changed, 34 insertions(+), 16 deletions(-)
>
> diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
> index f3fc331..dabfd0b 100644
> --- a/include/linux/swiotlb.h
> +++ b/include/linux/swiotlb.h
> @@ -25,6 +25,28 @@ extern int swiotlb_force;
> extern void swiotlb_init(int verbose);
> extern void swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose);
>
> +/*
> + * Enumeration for sync targets
> + */
> +enum dma_sync_target {
> + SYNC_FOR_CPU = 0,
> + SYNC_FOR_DEVICE = 1,
> +};
> +extern void *swiotlb_tbl_map_single(struct device *hwdev, phys_addr_t phys,
> + u64 tbl_dma_addr, size_t size,
> + enum dma_data_direction dir);
> +

The phys and tbl_dma_addr arguments in the function prototype are swapped compared to the function definition in patch 1/6.

Cheers,
Albert
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Albert Herranz on
Konrad Rzeszutek Wilk wrote:
> So these two patches (one to replace the PATCH 1/6 and the other to
> replace this one), would work then:
>
> I've put the whole tree at:
> git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb-2.6.git swiotlb-0.8.1
>

The whole series work fine on the Wii 32-bit PowerPC platform (used to implement the MEM2 DMA facility needed by its EHCI controller).

Tested-by: Albert Herranz <albert_herranz(a)yahoo.es>

Thanks,
Albert

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Albert Herranz on
On 05/19/2010 05:34 AM, FUJITA Tomonori wrote:
>> Every single KB counts on the Wii. It has just 24MB of MEM1 and 64MB of MEM2 (discontiguous memory ranges).
>> I'm using 1MB for the SWIOTLB for now, but of course that can be further tweaked down.
>
> You can decrease the swiotlb memory however you can't fix the root
> problems of swiotlb:
>
> - it needs pre-allocated memory
> - it can't handle the out-of-pre-allocated memory situation.
>

Yes, agreed.
Although having a dedicated pool _may_ be an advantage on a memory constrained system: it can guarantee swiotlb allocations (as long as the pool has been properly sized) even when the system is using up all memory.

> I mean that Wii doesn't boot on the root device on the USB controller,
> right?
>

The current "bootloaders" boot images from the external SD card.
But Linux itself can have its root device on a USB storage device.

>> I posted (in the past) a patch series [1] in which I made the
>> dmabounce code in the ARM architecture tree available to other
>> architectures, and used that to implement the needed bouncing
>> infrastructure. But I was told then by Russell to use swiotlb
>> instead [2].
>
> I think that we need to modify swiotlb for embedded archs. Otherwise,
> I don't think that swiotlb can replace arm's dmabounce.
>
> Ok, I'll implement something like that.
>

Thanks. Looking forward to it :)

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