From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.234]) by ozlabs.org (Postfix) with ESMTP id 0F4CCDDF10 for ; Sat, 20 Sep 2008 07:56:12 +1000 (EST) Received: by rv-out-0506.google.com with SMTP id f6so578671rvb.9 for ; Fri, 19 Sep 2008 14:56:11 -0700 (PDT) Message-ID: Date: Fri, 19 Sep 2008 14:56:11 -0700 From: vb Sender: vbendeb@gmail.com To: linuxppc-embedded@ozlabs.org Subject: Re: Allocating uncached memory in 2.6.25(powerpc/440) In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 References: List-Id: Linux on Embedded PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Oh man, sorry, those damn keyboard shortcuts, let me try again :-) I wonder if anyone can help with some hints in this situation: here is a code fragment to illustrate the questions: if ((ai = kmalloc(sizeof(alloc_info_t) + 4 * szw, GFP_ATOMIC | GFP_DMA)) != NULL) { ai->src = FROM_KMALLOC; printk("\n%s:%d %p\n", __FUNCTION__, __LINE__, ai); basically, a block of contiguous memory is allocated. This block is needed to set up some DMA descriptors, so it needs to be uncached, and I thought this is what GFP_DMA flag is for. I stop execution using a JTAG probe right after the printk above, and examine the TLB matching the allocated address. This is what printk reports: sal_alloc:163 eee76000 And the TLB record for this memory is the default kernel 256M page: 61 : 00 e0000000 256MB V0 -> 0_20000000 U:0000 ---G- ---XWR Which is obviously cached (missing the I bit set). How is this supposed to work? Is this right to expect the address returned by kmalloc() to be mapped to uncached TLB in case GFP_DMA flag is passed in? What are the proper ways of setting up shared memory in this kernel? Any hints will be highly appreciated, TIA, Vadim