All of lore.kernel.org
 help / color / mirror / Atom feed
* [RESEND PATCH] riscv: Move nommu pgprot_* macros to pgtable.h
@ 2020-06-30  6:28 Pekka Enberg
  2020-07-14  1:21 ` Palmer Dabbelt
  0 siblings, 1 reply; 3+ messages in thread
From: Pekka Enberg @ 2020-06-30  6:28 UTC (permalink / raw)
  To: linux-riscv; +Cc: Pekka Enberg, Kefeng Wang, aou, palmer, paul.walmsley

From: Pekka Enberg <penberg@kernel.org>

The mmio.h header file defines some pgprot macros for !CONFIG_MMU, but
pgtable.h seems like a better place for them.

Compile tested with defconfig + !CONFIG_MMU.

Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
---
Although the patche appeard on the mailing list, they never made it to
the inbox of some important folks such as maintainers... I assume the
reason is that "git-send-email" used "penberg@kernel.org" in the email
headers when it really was sent from "penberg@gmail.com".

 arch/riscv/include/asm/mmio.h    | 6 ------
 arch/riscv/include/asm/pgtable.h | 4 ++++
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/riscv/include/asm/mmio.h b/arch/riscv/include/asm/mmio.h
index 56053c9838b2..aff6c33ab0c0 100644
--- a/arch/riscv/include/asm/mmio.h
+++ b/arch/riscv/include/asm/mmio.h
@@ -14,12 +14,6 @@
 #include <linux/types.h>
 #include <asm/mmiowb.h>
 
-#ifndef CONFIG_MMU
-#define pgprot_noncached(x)	(x)
-#define pgprot_writecombine(x)	(x)
-#define pgprot_device(x)	(x)
-#endif /* CONFIG_MMU */
-
 /* Generic IO read/write.  These perform native-endian accesses. */
 #define __raw_writeb __raw_writeb
 static inline void __raw_writeb(u8 val, volatile void __iomem *addr)
diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h
index eaea1f717010..e82a32112b7e 100644
--- a/arch/riscv/include/asm/pgtable.h
+++ b/arch/riscv/include/asm/pgtable.h
@@ -459,6 +459,10 @@ static inline int ptep_clear_flush_young(struct vm_area_struct *vma,
 
 static inline void __kernel_map_pages(struct page *page, int numpages, int enable) {}
 
+#define pgprot_noncached(x)	(x)
+#define pgprot_writecombine(x)	(x)
+#define pgprot_device(x)	(x)
+
 #endif /* !CONFIG_MMU */
 
 #define kern_addr_valid(addr)   (1) /* FIXME */
-- 
2.25.0


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [RESEND PATCH] riscv: Move nommu pgprot_* macros to pgtable.h
  2020-06-30  6:28 [RESEND PATCH] riscv: Move nommu pgprot_* macros to pgtable.h Pekka Enberg
@ 2020-07-14  1:21 ` Palmer Dabbelt
  2020-07-14 10:00   ` Pekka Enberg
  0 siblings, 1 reply; 3+ messages in thread
From: Palmer Dabbelt @ 2020-07-14  1:21 UTC (permalink / raw)
  To: penberg; +Cc: penberg, linux-riscv, aou, wangkefeng.wang, Paul Walmsley

On Mon, 29 Jun 2020 23:28:28 PDT (-0700), penberg@gmail.com wrote:
> From: Pekka Enberg <penberg@kernel.org>
>
> The mmio.h header file defines some pgprot macros for !CONFIG_MMU, but
> pgtable.h seems like a better place for them.
>
> Compile tested with defconfig + !CONFIG_MMU.
>
> Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
> Signed-off-by: Pekka Enberg <penberg@kernel.org>
> ---
> Although the patche appeard on the mailing list, they never made it to
> the inbox of some important folks such as maintainers... I assume the
> reason is that "git-send-email" used "penberg@kernel.org" in the email
> headers when it really was sent from "penberg@gmail.com".
>
>  arch/riscv/include/asm/mmio.h    | 6 ------
>  arch/riscv/include/asm/pgtable.h | 4 ++++
>  2 files changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/arch/riscv/include/asm/mmio.h b/arch/riscv/include/asm/mmio.h
> index 56053c9838b2..aff6c33ab0c0 100644
> --- a/arch/riscv/include/asm/mmio.h
> +++ b/arch/riscv/include/asm/mmio.h
> @@ -14,12 +14,6 @@
>  #include <linux/types.h>
>  #include <asm/mmiowb.h>
>
> -#ifndef CONFIG_MMU
> -#define pgprot_noncached(x)	(x)
> -#define pgprot_writecombine(x)	(x)
> -#define pgprot_device(x)	(x)
> -#endif /* CONFIG_MMU */
> -
>  /* Generic IO read/write.  These perform native-endian accesses. */
>  #define __raw_writeb __raw_writeb
>  static inline void __raw_writeb(u8 val, volatile void __iomem *addr)
> diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h
> index eaea1f717010..e82a32112b7e 100644
> --- a/arch/riscv/include/asm/pgtable.h
> +++ b/arch/riscv/include/asm/pgtable.h
> @@ -459,6 +459,10 @@ static inline int ptep_clear_flush_young(struct vm_area_struct *vma,
>
>  static inline void __kernel_map_pages(struct page *page, int numpages, int enable) {}
>
> +#define pgprot_noncached(x)	(x)
> +#define pgprot_writecombine(x)	(x)
> +#define pgprot_device(x)	(x)
> +
>  #endif /* !CONFIG_MMU */
>
>  #define kern_addr_valid(addr)   (1) /* FIXME */

This seems fine, but I guess I don't understand why they don't have default
values in the generic code for !MMU.  It kind of seems like it's an oversight
due to nested #ifdefs.  Assuming that's the case, we can just juggle those
around and then remove these from all the ports that define the now useless
macros.

LMK if you want to pursue that or if you want me to take it over.

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [RESEND PATCH] riscv: Move nommu pgprot_* macros to pgtable.h
  2020-07-14  1:21 ` Palmer Dabbelt
@ 2020-07-14 10:00   ` Pekka Enberg
  0 siblings, 0 replies; 3+ messages in thread
From: Pekka Enberg @ 2020-07-14 10:00 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: linux-riscv, Albert Ou, Kefeng Wang, Paul Walmsley

Hi Palmer,

On Tue, Jul 14, 2020 at 4:21 AM Palmer Dabbelt <palmer@dabbelt.com> wrote:
> This seems fine, but I guess I don't understand why they don't have default
> values in the generic code for !MMU.  It kind of seems like it's an oversight
> due to nested #ifdefs.  Assuming that's the case, we can just juggle those
> around and then remove these from all the ports that define the now useless
> macros.
>
> LMK if you want to pursue that or if you want me to take it over.

Yeah, makes sense, I'll send patches to do that instead. Thanks!

- Pekka

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

end of thread, other threads:[~2020-07-14 10:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-30  6:28 [RESEND PATCH] riscv: Move nommu pgprot_* macros to pgtable.h Pekka Enberg
2020-07-14  1:21 ` Palmer Dabbelt
2020-07-14 10:00   ` Pekka Enberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.