[uClinux-dev] [PATCH 3/3] m68knommu: Add ethernet driver for MCF547x/MCF548x

Greg Ungerer gerg at snapgear.com
Thu Sep 27 02:04:50 EDT 2012


Hi Stany,

On 27/09/12 00:02, Stany MARCEL wrote:
> Are cache flush needed as GFP_DMA flags are used for memory allocations (kmalloc and skbuff) ?

Yes, you will still need to flush caches. Allocating with GFP_DMA means
that the memory you get is capable of being DMA'ed from and to.


> Is not the responsibility of arch dependent file to allocate DMA'able memory when this flag is used.

Its is DMA'able, but it is not normally cache coherent.

Regards
Greg



> -----Original Message-----
> From: Greg Ungerer [mailto:gerg at snapgear.com]
> Sent: Wed 9/26/2012 2:07 PM
> To: uClinux development list
> Cc: Philippe De Muyter; Stany MARCEL
> Subject: Re: [uClinux-dev] [PATCH 3/3] m68knommu: Add ethernet driver for MCF547x/MCF548x
>
> On 09/26/2012 06:20 AM, Philippe De Muyter wrote:
>> Hello Stany
>>
>> [CCing uclinux-dev]
>>
>> On Tue, Sep 25, 2012 at 06:07:45PM +0200, Stany MARCEL wrote:
>>> Hello Philippe,
>>>
>>> I have to do the following modification to compile your drivers with MMU enabled :
>>>
>>> diff --git a/drivers/net/ethernet/freescale/fec_m54xx.c b/drivers/net/ethernet/freescale/fec_m54xx.c
>>> index 4204a14..f6cafc6 100644
>>> --- a/drivers/net/ethernet/freescale/fec_m54xx.c
>>> +++ b/drivers/net/ethernet/freescale/fec_m54xx.c
>>> @@ -41,6 +41,10 @@
>>>     */
>>>    #define flush_and_invalidate_dcache() flush_cache_all()
>>>
>>> +#ifdef CONFIG_MMU
>>> +#define        flush_dcache_range(A, L) flush_cf_dcache(A, L)
>
> Drivers shouldn't be calling these architecture flush functions at all.
> They must use the DMA API and the functions it defines. See
>
>     Documentation/DMA-API.txt
>
> For example look at the use of dma_map_single()/dma_unmap_single()
> in drivers/net/ethernet/freescale/fec.c. (Ignore the almost certainly
> bogus cache_flush_all() for CONFIG_M532x).
>
> Regards
> Greg
>
>
>
> ------------------------------------------------------------------------
> Greg Ungerer  --  Principal Engineer        EMAIL:     gerg at snapgear.com
> SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
> 8 Gardner Close,                            FAX:         +61 7 3891 3630
> Milton, QLD, 4064, Australia                WEB: http://www.SnapGear.com
>
>
>
>


-- 
------------------------------------------------------------------------
Greg Ungerer  --  Principal Engineer        EMAIL:     gerg at snapgear.com
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
8 Gardner Close                             FAX:         +61 7 3217 5323
Milton, QLD, 4064, Australia                WEB: http://www.SnapGear.com



More information about the uClinux-dev mailing list