public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* RE: [microblaze-uclinux] [PATCH 12/12] microblaze: use generic dma-mapping-broken.h
       [not found] ` <20090511232345.859696820@arndb.de>
@ 2009-05-11 23:59   ` Stephen Neuendorffer
  2009-05-12  0:29     ` Arnd Bergmann
  0 siblings, 1 reply; 8+ messages in thread
From: Stephen Neuendorffer @ 2009-05-11 23:59 UTC (permalink / raw)
  To: microblaze-uclinux, Michal Simek; +Cc: linux-kernel


Gah... considering the ll_temac needs this, it should get implemented
ASAP...
(Yeah, I know... just not enough hours in the day.)

Steve

> -----Original Message-----
> From: owner-microblaze-uclinux@lists.itee.uq.edu.au
[mailto:owner-microblaze-
> uclinux@lists.itee.uq.edu.au] On Behalf Of Arnd Bergmann
> Sent: Monday, May 11, 2009 4:21 PM
> To: Michal Simek
> Cc: linux-kernel@vger.kernel.org; microblaze-uclinux@itee.uq.edu.au
> Subject: [microblaze-uclinux] [PATCH 12/12] microblaze: use generic
dma-mapping-broken.h
> 
> Microblaze does not support the Linux DMA mapping API
> at this point, so disable CONFIG_NO_DMA. This lets
> us use the generic dma-mapping-broken.h implementation
> instead of providing a different copy.
> 
> Any drivers that try to use DMA mapping now get
> omitted from Kconfig or produce a link error, rather
> than failing silently at run time.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  arch/microblaze/Kconfig                   |    2 +-
>  arch/microblaze/include/asm/dma-mapping.h |  130
+----------------------------
>  2 files changed, 2 insertions(+), 130 deletions(-)
>  rewrite arch/microblaze/include/asm/dma-mapping.h (100%)
> 
> diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig
> index 8cc312b..0d837ee 100644
> --- a/arch/microblaze/Kconfig
> +++ b/arch/microblaze/Kconfig
> @@ -55,7 +55,7 @@ config PCI
> 
>  config NO_DMA
>  	depends on !MMU
> -	def_bool n
> +	def_bool y
> 
>  source "init/Kconfig"
> 
> diff --git a/arch/microblaze/include/asm/dma-mapping.h
b/arch/microblaze/include/asm/dma-mapping.h
> dissimilarity index 100%
> index 1733625..d00e400 100644
> --- a/arch/microblaze/include/asm/dma-mapping.h
> +++ b/arch/microblaze/include/asm/dma-mapping.h
> @@ -1,129 +1 @@
> -/*
> - * Copyright (C) 2006 Atmark Techno, Inc.
> - *
> - * This file is subject to the terms and conditions of the GNU
General Public
> - * License. See the file "COPYING" in the main directory of this
archive
> - * for more details.
> - */
> -
> -#ifndef _ASM_MICROBLAZE_DMA_MAPPING_H
> -#define _ASM_MICROBLAZE_DMA_MAPPING_H
> -
> -#include <asm/cacheflush.h>
> -#include <linux/io.h>
> -#include <linux/bug.h>
> -
> -struct scatterlist;
> -
> -#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h,
f)
> -#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v,
h)
> -
> -/* FIXME */
> -static inline int
> -dma_supported(struct device *dev, u64 mask)
> -{
> -	return 1;
> -}
> -
> -static inline dma_addr_t
> -dma_map_page(struct device *dev, struct page *page,
> -	unsigned long offset, size_t size,
> -	enum dma_data_direction direction)
> -{
> -	BUG();
> -	return 0;
> -}
> -
> -static inline void
> -dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t
size,
> -	enum dma_data_direction direction)
> -{
> -	BUG();
> -}
> -
> -static inline int
> -dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
> -	enum dma_data_direction direction)
> -{
> -	BUG();
> -	return 0;
> -}
> -
> -static inline void
> -dma_unmap_sg(struct device *dev, struct scatterlist *sg, int
nhwentries,
> -	enum dma_data_direction direction)
> -{
> -	BUG();
> -}
> -
> -static inline void
> -dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle,
size_t size,
> -			enum dma_data_direction direction)
> -{
> -	BUG();
> -}
> -
> -static inline void
> -dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle,
> -		size_t size, enum dma_data_direction direction)
> -{
> -	BUG();
> -}
> -
> -static inline void
> -dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int
nelems,
> -		enum dma_data_direction direction)
> -{
> -	BUG();
> -}
> -
> -static inline void
> -dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
int nelems,
> -		enum dma_data_direction direction)
> -{
> -	BUG();
> -}
> -
> -static inline int dma_mapping_error(struct device *dev, dma_addr_t
dma_addr)
> -{
> -	return 0;
> -}
> -
> -static inline void *dma_alloc_coherent(struct device *dev, size_t
size,
> -				dma_addr_t *dma_handle, int flag)
> -{
> -	return NULL; /* consistent_alloc(flag, size, dma_handle); */
> -}
> -
> -static inline void dma_free_coherent(struct device *dev, size_t size,
> -			void *vaddr, dma_addr_t dma_handle)
> -{
> -	BUG();
> -}
> -
> -static inline dma_addr_t
> -dma_map_single(struct device *dev, void *ptr, size_t size,
> -	enum dma_data_direction direction)
> -{
> -	BUG_ON(direction == DMA_NONE);
> -
> -	return virt_to_bus(ptr);
> -}
> -
> -static inline void dma_unmap_single(struct device *dev, dma_addr_t
dma_addr,
> -				    size_t size,
> -				    enum dma_data_direction direction)
> -{
> -	switch (direction) {
> -	case DMA_FROM_DEVICE:
> -		flush_dcache_range((unsigned)dma_addr,
> -			(unsigned)dma_addr + size);
> -			/* Fall through */
> -	case DMA_TO_DEVICE:
> -		break;
> -	default:
> -		BUG();
> -	}
> -}
> -
> -#endif /* _ASM_MICROBLAZE_DMA_MAPPING_H */
> +#include <asm-generic/dma-mapping-broken.h>
> --
> 1.6.0.4
> 
> --
> 
> ___________________________
> microblaze-uclinux mailing list
> microblaze-uclinux@itee.uq.edu.au
> Project Home Page :
http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
> Mailing List Archive :
http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/
> 


This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [microblaze-uclinux] [PATCH 12/12] microblaze: use generic dma-mapping-broken.h
  2009-05-11 23:59   ` [microblaze-uclinux] [PATCH 12/12] microblaze: use generic dma-mapping-broken.h Stephen Neuendorffer
@ 2009-05-12  0:29     ` Arnd Bergmann
  2009-05-12  0:33       ` Stephen Neuendorffer
  0 siblings, 1 reply; 8+ messages in thread
From: Arnd Bergmann @ 2009-05-12  0:29 UTC (permalink / raw)
  To: Stephen Neuendorffer
  Cc: microblaze-uclinux, Michal Simek, linux-kernel, FUJITA Tomonori

On Tuesday 12 May 2009, Stephen Neuendorffer wrote:
> 
> Gah... considering the ll_temac needs this, it should get implemented
> ASAP...
> (Yeah, I know... just not enough hours in the day.)
> 

FUJITA Tomonori has just posted an asm-generic version of dma-mapping.h,
which is half complete. For microblaze, it should be easy to add the
missing functions, basically falling back on get_free_pages for all
allocations and on page_to_phys for the actual mapping, as in
arch/powerpc/kernel/dma.c.

	Arnd <><

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [microblaze-uclinux] [PATCH 12/12] microblaze: use generic dma-mapping-broken.h
  2009-05-12  0:29     ` Arnd Bergmann
@ 2009-05-12  0:33       ` Stephen Neuendorffer
  0 siblings, 0 replies; 8+ messages in thread
From: Stephen Neuendorffer @ 2009-05-12  0:33 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: microblaze-uclinux, Michal Simek, linux-kernel, FUJITA Tomonori


Sounds like a great idea...  That's really all that's necessary for
microblazes with write-through cache anyway.

Steve

> -----Original Message-----
> From: Arnd Bergmann [mailto:arnd@arndb.de]
> Sent: Monday, May 11, 2009 5:30 PM
> To: Stephen Neuendorffer
> Cc: microblaze-uclinux@itee.uq.edu.au; Michal Simek;
linux-kernel@vger.kernel.org; FUJITA Tomonori
> Subject: Re: [microblaze-uclinux] [PATCH 12/12] microblaze: use
generic dma-mapping-broken.h
> 
> On Tuesday 12 May 2009, Stephen Neuendorffer wrote:
> >
> > Gah... considering the ll_temac needs this, it should get
implemented
> > ASAP...
> > (Yeah, I know... just not enough hours in the day.)
> >
> 
> FUJITA Tomonori has just posted an asm-generic version of
dma-mapping.h,
> which is half complete. For microblaze, it should be easy to add the
> missing functions, basically falling back on get_free_pages for all
> allocations and on page_to_phys for the actual mapping, as in
> arch/powerpc/kernel/dma.c.
> 
> 	Arnd <><


This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 11/12] microblaze: dont include asm/mmu.h in hw_exception_handler
       [not found] ` <20090511232345.746701938@arndb.de>
@ 2009-05-12  9:12   ` Michal Simek
  2009-05-12 11:13     ` Arnd Bergmann
  0 siblings, 1 reply; 8+ messages in thread
From: Michal Simek @ 2009-05-12  9:12 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linux-kernel, microblaze-uclinux

Arnd Bergmann wrote:


1. Please do not attach your patches - use in-line patches - it is easier for me and for others to
review it.

2. I have to reject this patch.
- currently you are right that I should remove mmu.h from hw_exception...S for noMMU kernel
- but on the other hand I need mmu.h for mmu patches - because of MICROBLAZE_TLB_SIZE
  - if you think that mmu.h shouldn't be included we have to move this definition to another file
  - you can look at my next branch to see mmu context

Thanks,
Michal




-- 
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 00/12] Microblaze fixes for 2.6.31
       [not found] <20090511232019.927138561@arndb.de>
       [not found] ` <20090511232345.859696820@arndb.de>
       [not found] ` <20090511232345.746701938@arndb.de>
@ 2009-05-12  9:27 ` Michal Simek
  2 siblings, 0 replies; 8+ messages in thread
From: Michal Simek @ 2009-05-12  9:27 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linux-kernel, microblaze-uclinux

Arnd Bergmann wrote:
> Hi Michal,
> 
> These are some cleanups and bug fixes that I came
> across while working on my asm-generic headers.
> 
> Since I don't have actual hardware, they are
> compile tested only. Please test and queue up
> for 2.6.31.
> 
> Feel free to pull the whole series from
> git.kernel.org:/pub/scm/linux/kernel/git/arnd/playground.git microblaze-cleanups

All changes except this one ([PATCH 11/12] microblaze: dont include asm/mmu.h in
hw_exception_handler) were added to for-linus branch

Thanks,
Michal


> 
> 	Arnd <><
> 


-- 
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 11/12] microblaze: dont include asm/mmu.h in hw_exception_handler
  2009-05-12  9:12   ` [PATCH 11/12] microblaze: dont include asm/mmu.h in hw_exception_handler Michal Simek
@ 2009-05-12 11:13     ` Arnd Bergmann
  2009-05-12 11:24       ` Michal Simek
  0 siblings, 1 reply; 8+ messages in thread
From: Arnd Bergmann @ 2009-05-12 11:13 UTC (permalink / raw)
  To: monstr; +Cc: linux-kernel, microblaze-uclinux

On Tuesday 12 May 2009, Michal Simek wrote:
> 1. Please do not attach your patches - use in-line patches - 
> it is easier for me and for others to review it.

Something went wrong (again...) with my patches this time, so they
got rejected by vger. They are not attached however AFAICT, but
are inline with the "Content-Disposition: inline;" header, which
is generated by "quilt mail". Which tool do you use that does
not work with this correctly?

> - but on the other hand I need mmu.h for mmu patches - because of MICROBLAZE_TLB_SIZE
>   - if you think that mmu.h shouldn't be included we have to
>     move this definition to another file 
>   - you can look at my next branch to see mmu context

Almost all architectures disallow using mmu.h in assembly, only
powerpc and sh have an '#ifndef __ASSEMBLY__' in there. I did the
change to allow using my asm-generic/mmu.h for microblaze-nommu.

When your MMU code gets merged, this is no longer required though,
because you cannot simply fall back on the asm-generic version anyway.

	Arnd <><

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 11/12] microblaze: dont include asm/mmu.h in hw_exception_handler
  2009-05-12 11:13     ` Arnd Bergmann
@ 2009-05-12 11:24       ` Michal Simek
  2009-05-12 11:46         ` Arnd Bergmann
  0 siblings, 1 reply; 8+ messages in thread
From: Michal Simek @ 2009-05-12 11:24 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linux-kernel, microblaze-uclinux

Arnd Bergmann wrote:
> On Tuesday 12 May 2009, Michal Simek wrote:
>> 1. Please do not attach your patches - use in-line patches - 
>> it is easier for me and for others to review it.
> 
> Something went wrong (again...) with my patches this time, so they
> got rejected by vger. They are not attached however AFAICT, but
> are inline with the "Content-Disposition: inline;" header, which
> is generated by "quilt mail". Which tool do you use that does
> not work with this correctly?

I use sendmail and git-send-email and I use Thunderbird for reviewing.

> 
>> - but on the other hand I need mmu.h for mmu patches - because of MICROBLAZE_TLB_SIZE
>>   - if you think that mmu.h shouldn't be included we have to
>>     move this definition to another file 
>>   - you can look at my next branch to see mmu context
> 
> Almost all architectures disallow using mmu.h in assembly, only
> powerpc and sh have an '#ifndef __ASSEMBLY__' in there. I did the
> change to allow using my asm-generic/mmu.h for microblaze-nommu.
> 
> When your MMU code gets merged, this is no longer required though,
> because you cannot simply fall back on the asm-generic version anyway.

I have no problem to remove mmu.h from it but I have to move that one TLB macro to
different sensible include file. It is related with mmu that's why I think someone in past
add it to this file. The main point is which file. Any tip?
Or the second solution is to move directly to .S file but any different include file will be better.

Michal

> 
> 	Arnd <><


-- 
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 11/12] microblaze: dont include asm/mmu.h in hw_exception_handler
  2009-05-12 11:24       ` Michal Simek
@ 2009-05-12 11:46         ` Arnd Bergmann
  0 siblings, 0 replies; 8+ messages in thread
From: Arnd Bergmann @ 2009-05-12 11:46 UTC (permalink / raw)
  To: monstr; +Cc: linux-kernel, microblaze-uclinux

On Tuesday 12 May 2009, Michal Simek wrote:
> I have no problem to remove mmu.h from it but I have to move that one TLB macro to
> different sensible include file. It is related with mmu that's why I think someone in past
> add it to this file. The main point is which file. Any tip?

Since the hardware shares a number of properties with ppc440, I guess you
are right that it makes sense to keep the kernel implementation similar to
arch/powerpc/include/asm/mmu-44x.h. Please keep it the way you have it
now, I'll just add #ifndef __ASSEMBLY__ to the asm-generic file.

	Arnd <><

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-05-12 11:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20090511232019.927138561@arndb.de>
     [not found] ` <20090511232345.859696820@arndb.de>
2009-05-11 23:59   ` [microblaze-uclinux] [PATCH 12/12] microblaze: use generic dma-mapping-broken.h Stephen Neuendorffer
2009-05-12  0:29     ` Arnd Bergmann
2009-05-12  0:33       ` Stephen Neuendorffer
     [not found] ` <20090511232345.746701938@arndb.de>
2009-05-12  9:12   ` [PATCH 11/12] microblaze: dont include asm/mmu.h in hw_exception_handler Michal Simek
2009-05-12 11:13     ` Arnd Bergmann
2009-05-12 11:24       ` Michal Simek
2009-05-12 11:46         ` Arnd Bergmann
2009-05-12  9:27 ` [PATCH 00/12] Microblaze fixes for 2.6.31 Michal Simek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox