[PATCH v2 09/14] powerpc: select ARCH_MAY_HAVE_PC_PARPORT

2013-10-07 Thread Mark Salter
Architectures which support CONFIG_PARPORT_PC should select
ARCH_MAY_HAVE_PC_PARPORT.

Signed-off-by: Mark Salter 
CC: Benjamin Herrenschmidt 
CC: Paul Mackerras 
CC: linuxppc-dev@lists.ozlabs.org
---
 arch/powerpc/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 38f3b7e..9211207 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -85,6 +85,7 @@ config GENERIC_HWEIGHT
 config PPC
bool
default y
+   select ARCH_MAY_HAVE_PC_PARPORT
select BINFMT_ELF
select OF
select OF_EARLY_FLATTREE
-- 
1.8.3.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH v2 14/14] Kconfig cleanup (PARPORT_PC dependencies)

2013-10-07 Thread Mark Salter
Remove messy dependencies from PARPORT_PC by having it depend on one
Kconfig symbol (ARCH_MAY_HAVE_PC_PARPORT) and having architectures
which need it, select ARCH_MAY_HAVE_PC_PARPORT in arch/*/Kconfig.
New architectures are unlikely to need PARPORT_PC, so this avoids
having an ever growing list of architectures to exclude. Those
architectures which do select ARCH_MAY_HAVE_PC_PARPORT in this
patch are the ones which have an asm/parport.h (or use the generic
version).

Signed-off-by: Mark Salter 
CC: Richard Henderson 
CC: linux-al...@vger.kernel.org
CC: Vineet Gupta 
CC: Russell King 
CC: linux-arm-ker...@lists.infradead.org
CC: Tony Luck 
CC: Fenghua Yu 
CC: linux-i...@vger.kernel.org
CC: Geert Uytterhoeven 
CC: linux-m...@lists.linux-m68k.org
CC: Michal Simek 
CC: microblaze-ucli...@itee.uq.edu.au
CC: Ralf Baechle 
CC: linux-m...@linux-mips.org
CC: "James E.J. Bottomley" 
CC: Helge Deller 
CC: linux-par...@vger.kernel.org
CC: Benjamin Herrenschmidt 
CC: Paul Mackerras 
CC: linuxppc-dev@lists.ozlabs.org
CC: Paul Mundt 
CC: linux...@vger.kernel.org
CC: "David S. Miller" 
CC: sparcli...@vger.kernel.org
CC: Guan Xuetao 
CC: Thomas Gleixner 
CC: Ingo Molnar 
CC: "H. Peter Anvin" 
CC: x...@kernel.org
---
 drivers/parport/Kconfig | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/parport/Kconfig b/drivers/parport/Kconfig
index 70694ce..a079b18 100644
--- a/drivers/parport/Kconfig
+++ b/drivers/parport/Kconfig
@@ -31,13 +31,17 @@ menuconfig PARPORT
 
  If unsure, say Y.
 
+config ARCH_MAY_HAVE_PC_PARPORT
+   bool
+   help
+ Select this config option from the architecture Kconfig if
+ the architecture may have PC parallel port hardware.
+
 if PARPORT
 
 config PARPORT_PC
tristate "PC-style hardware"
-   depends on (!SPARC64 || PCI) && !SPARC32 && !M32R && !FRV && !S390 && \
-   (!M68K || ISA) && !MN10300 && !AVR32 && !BLACKFIN && \
-   !XTENSA && !CRIS && !H8300
+   depends on ARCH_MAY_HAVE_PC_PARPORT
 
---help---
  You should say Y here if you have a PC-style parallel port. All
-- 
1.8.3.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 08/11] powerpc: use generic fixmap.h

2013-11-12 Thread Mark Salter
Signed-off-by: Mark Salter 
CC: Benjamin Herrenschmidt 
CC: Paul Mackerras 
CC: linuxppc-dev@lists.ozlabs.org
---
 arch/powerpc/include/asm/fixmap.h | 44 ++-
 1 file changed, 2 insertions(+), 42 deletions(-)

diff --git a/arch/powerpc/include/asm/fixmap.h 
b/arch/powerpc/include/asm/fixmap.h
index 5c2c023..90f604b 100644
--- a/arch/powerpc/include/asm/fixmap.h
+++ b/arch/powerpc/include/asm/fixmap.h
@@ -58,52 +58,12 @@ enum fixed_addresses {
 extern void __set_fixmap (enum fixed_addresses idx,
phys_addr_t phys, pgprot_t flags);
 
-#define set_fixmap(idx, phys) \
-   __set_fixmap(idx, phys, PAGE_KERNEL)
-/*
- * Some hardware wants to get fixmapped without caching.
- */
-#define set_fixmap_nocache(idx, phys) \
-   __set_fixmap(idx, phys, PAGE_KERNEL_NCG)
-
-#define clear_fixmap(idx) \
-   __set_fixmap(idx, 0, __pgprot(0))
-
 #define __FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
 #define FIXADDR_START  (FIXADDR_TOP - __FIXADDR_SIZE)
 
-#define __fix_to_virt(x)   (FIXADDR_TOP - ((x) << PAGE_SHIFT))
-#define __virt_to_fix(x)   ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT)
-
-extern void __this_fixmap_does_not_exist(void);
-
-/*
- * 'index to address' translation. If anyone tries to use the idx
- * directly without tranlation, we catch the bug with a NULL-deference
- * kernel oops. Illegal ranges of incoming indices are caught too.
- */
-static __always_inline unsigned long fix_to_virt(const unsigned int idx)
-{
-   /*
-* this branch gets completely eliminated after inlining,
-* except when someone tries to use fixaddr indices in an
-* illegal way. (such as mixing up address types or using
-* out-of-range indices).
-*
-* If it doesn't get removed, the linker will complain
-* loudly with a reasonably clear error message..
-*/
-   if (idx >= __end_of_fixed_addresses)
-   __this_fixmap_does_not_exist();
-
-return __fix_to_virt(idx);
-}
+#define FIXMAP_PAGE_NOCACHE PAGE_KERNEL_NCG
 
-static inline unsigned long virt_to_fix(const unsigned long vaddr)
-{
-   BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START);
-   return __virt_to_fix(vaddr);
-}
+#include 
 
 #endif /* !__ASSEMBLY__ */
 #endif
-- 
1.8.3.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 00/11] Consolidate asm/fixmap.h files

2013-11-12 Thread Mark Salter
Many architectures provide an asm/fixmap.h which defines support for
compile-time 'special' virtual mappings which need to be made before
paging_init() has run. This suport is also used for early ioremap
on x86. Much of this support is identical across the architectures.
This patch consolidates all of the common bits into asm-generic/fixmap.h
which is intended to be included from arch/*/include/asm/fixmap.h.

This has been compiled on x86, arm, powerpc, and sh, but tested
on x86 only.

Mark Salter (11):
  Add generic fixmap.h
  x86: use generic fixmap.h
  arm: use generic fixmap.h
  hexagon: use generic fixmap.h
  metag: use generic fixmap.h
  microblaze: use generic fixmap.h
  mips: use generic fixmap.h
  powerpc: use generic fixmap.h
  sh: use generic fixmap.h
  tile: use generic fixmap.h
  um: use generic fixmap.h

 arch/arm/include/asm/fixmap.h|  25 ++--
 arch/hexagon/include/asm/fixmap.h|  40 +
 arch/metag/include/asm/fixmap.h  |  32 +--
 arch/microblaze/include/asm/fixmap.h |  44 +-
 arch/mips/include/asm/fixmap.h   |  33 +--
 arch/powerpc/include/asm/fixmap.h|  44 +-
 arch/sh/include/asm/fixmap.h |  39 +
 arch/tile/include/asm/fixmap.h   |  33 +--
 arch/um/include/asm/fixmap.h |  40 +
 arch/x86/include/asm/fixmap.h|  59 +--
 include/asm-generic/fixmap.h | 107 +++
 11 files changed, 125 insertions(+), 371 deletions(-)
 create mode 100644 include/asm-generic/fixmap.h

-- 
1.8.3.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 01/11] Add generic fixmap.h

2013-11-12 Thread Mark Salter
Many architectures provide an asm/fixmap.h which defines support for
compile-time 'special' virtual mappings which need to be made before
paging_init() has run. This suport is also used for early ioremap
on x86. Much of this support is identical across the architectures.
This patch consolidates all of the common bits into asm-generic/fixmap.h
which is intended to be included from arch/*/include/asm/fixmap.h.

Signed-off-by: Mark Salter 
CC: Arnd Bergmann 
CC: linux-a...@vger.kernel.org
CC: Russell King 
CC: linux-arm-ker...@lists.infradead.org
CC: Richard Kuo 
CC: linux-hexa...@vger.kernel.org
CC: James Hogan 
CC: linux-me...@vger.kernel.org
CC: Michal Simek 
CC: microblaze-ucli...@itee.uq.edu.au
CC: Ralf Baechle 
CC: linux-m...@linux-mips.org
CC: Benjamin Herrenschmidt 
CC: Paul Mackerras 
CC: linuxppc-dev@lists.ozlabs.org
---
 include/asm-generic/fixmap.h | 107 +++
 1 file changed, 107 insertions(+)
 create mode 100644 include/asm-generic/fixmap.h

diff --git a/include/asm-generic/fixmap.h b/include/asm-generic/fixmap.h
new file mode 100644
index 000..8d453db
--- /dev/null
+++ b/include/asm-generic/fixmap.h
@@ -0,0 +1,107 @@
+/*
+ * fixmap.h: compile-time virtual memory allocation
+ *
+ * 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.
+ *
+ * Copyright (C) 1998 Ingo Molnar
+ *
+ * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999
+ * x86_32 and x86_64 integration by Gustavo F. Padovan, February 2009
+ */
+
+#ifndef __ASM_GENERIC_FIXMAP_H
+#define __ASM_GENERIC_FIXMAP_H
+
+#define __fix_to_virt(x)   (FIXADDR_TOP - ((x) << PAGE_SHIFT))
+#define __virt_to_fix(x)   ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT)
+
+#ifndef __ASSEMBLY__
+extern void __this_fixmap_does_not_exist(void);
+
+/*
+ * 'index to address' translation. If anyone tries to use the idx
+ * directly without translation, we catch the bug with a NULL-deference
+ * kernel oops. Illegal ranges of incoming indices are caught too.
+ */
+static __always_inline unsigned long fix_to_virt(const unsigned int idx)
+{
+   /*
+* this branch gets completely eliminated after inlining,
+* except when someone tries to use fixaddr indices in an
+* illegal way. (such as mixing up address types or using
+* out-of-range indices).
+*
+* If it doesn't get removed, the linker will complain
+* loudly with a reasonably clear error message..
+*/
+   if (idx >= __end_of_fixed_addresses)
+   __this_fixmap_does_not_exist();
+
+   return __fix_to_virt(idx);
+}
+
+static inline unsigned long virt_to_fix(const unsigned long vaddr)
+{
+   BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START);
+   return __virt_to_fix(vaddr);
+}
+
+/*
+ * Provide some reasonable defaults for page flags.
+ * Not all architectures use all of these different types and some
+ * architectures use different names.
+ */
+#ifndef FIXMAP_PAGE_NORMAL
+#define FIXMAP_PAGE_NORMAL PAGE_KERNEL
+#endif
+#ifndef FIXMAP_PAGE_NOCACHE
+#define FIXMAP_PAGE_NOCACHE PAGE_KERNEL_NOCACHE
+#endif
+#ifndef FIXMAP_PAGE_IO
+#define FIXMAP_PAGE_IO PAGE_KERNEL_IO
+#endif
+#ifndef FIXMAP_PAGE_CLEAR
+#define FIXMAP_PAGE_CLEAR __pgprot(0)
+#endif
+
+#ifndef set_fixmap
+#define set_fixmap(idx, phys)  \
+   __set_fixmap(idx, phys, FIXMAP_PAGE_NORMAL)
+#endif
+
+#ifndef clear_fixmap
+#define clear_fixmap(idx)  \
+   __set_fixmap(idx, 0, FIXMAP_PAGE_CLEAR)
+#endif
+
+/* Return an pointer with offset calculated */
+#define __set_fixmap_offset(idx, phys, flags)\
+({   \
+   unsigned long addr;   \
+   __set_fixmap(idx, phys, flags);   \
+   addr = fix_to_virt(idx) + ((phys) & (PAGE_SIZE - 1)); \
+   addr; \
+})
+
+#define set_fixmap_offset(idx, phys) \
+   __set_fixmap_offset(idx, phys, FIXMAP_PAGE_NORMAL)
+
+/*
+ * Some hardware wants to get fixmapped without caching.
+ */
+#define set_fixmap_nocache(idx, phys) \
+   __set_fixmap(idx, phys, FIXMAP_PAGE_NOCACHE)
+
+#define set_fixmap_offset_nocache(idx, phys) \
+   __set_fixmap_offset(idx, phys, FIXMAP_PAGE_NOCACHE)
+
+/*
+ * Some fixmaps are for IO
+ */
+#define set_fixmap_io(idx, phys) \
+   __set_fixmap(idx, phys, FIXMAP_PAGE_IO)
+
+#endif /* __ASSEMBLY__ */
+#endif /* __ASM_GENERIC_FIXMAP_H */
-- 
1.8.3.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 00/11] Consolidate asm/fixmap.h files

2013-11-12 Thread Mark Salter
On Tue, 2013-11-12 at 16:39 +0100, Michal Simek wrote:
> On 11/12/2013 02:22 PM, Mark Salter wrote:
> > 
> >  arch/arm/include/asm/fixmap.h|  25 ++--
> >  arch/hexagon/include/asm/fixmap.h|  40 +
> >  arch/metag/include/asm/fixmap.h  |  32 +--
> >  arch/microblaze/include/asm/fixmap.h |  44 +-
> >  arch/mips/include/asm/fixmap.h   |  33 +--
> >  arch/powerpc/include/asm/fixmap.h|  44 +-
> >  arch/sh/include/asm/fixmap.h |  39 +
> >  arch/tile/include/asm/fixmap.h   |  33 +--
> >  arch/um/include/asm/fixmap.h |  40 +
> >  arch/x86/include/asm/fixmap.h|  59 +--
> >  include/asm-generic/fixmap.h | 107 
> > +++
> >  11 files changed, 125 insertions(+), 371 deletions(-)
> >  create mode 100644 include/asm-generic/fixmap.h
> 
> Any repo/branch with all these patches will be helpful.

https://github.com/mosalter/linux (fixmap branch)


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH v2 08/11] powerpc: use generic fixmap.h

2013-11-25 Thread Mark Salter
Signed-off-by: Mark Salter 
CC: Benjamin Herrenschmidt 
CC: Paul Mackerras 
CC: linuxppc-dev@lists.ozlabs.org
---
 arch/powerpc/include/asm/fixmap.h | 44 ++-
 1 file changed, 2 insertions(+), 42 deletions(-)

diff --git a/arch/powerpc/include/asm/fixmap.h 
b/arch/powerpc/include/asm/fixmap.h
index 5c2c023..90f604b 100644
--- a/arch/powerpc/include/asm/fixmap.h
+++ b/arch/powerpc/include/asm/fixmap.h
@@ -58,52 +58,12 @@ enum fixed_addresses {
 extern void __set_fixmap (enum fixed_addresses idx,
phys_addr_t phys, pgprot_t flags);
 
-#define set_fixmap(idx, phys) \
-   __set_fixmap(idx, phys, PAGE_KERNEL)
-/*
- * Some hardware wants to get fixmapped without caching.
- */
-#define set_fixmap_nocache(idx, phys) \
-   __set_fixmap(idx, phys, PAGE_KERNEL_NCG)
-
-#define clear_fixmap(idx) \
-   __set_fixmap(idx, 0, __pgprot(0))
-
 #define __FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
 #define FIXADDR_START  (FIXADDR_TOP - __FIXADDR_SIZE)
 
-#define __fix_to_virt(x)   (FIXADDR_TOP - ((x) << PAGE_SHIFT))
-#define __virt_to_fix(x)   ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT)
-
-extern void __this_fixmap_does_not_exist(void);
-
-/*
- * 'index to address' translation. If anyone tries to use the idx
- * directly without tranlation, we catch the bug with a NULL-deference
- * kernel oops. Illegal ranges of incoming indices are caught too.
- */
-static __always_inline unsigned long fix_to_virt(const unsigned int idx)
-{
-   /*
-* this branch gets completely eliminated after inlining,
-* except when someone tries to use fixaddr indices in an
-* illegal way. (such as mixing up address types or using
-* out-of-range indices).
-*
-* If it doesn't get removed, the linker will complain
-* loudly with a reasonably clear error message..
-*/
-   if (idx >= __end_of_fixed_addresses)
-   __this_fixmap_does_not_exist();
-
-return __fix_to_virt(idx);
-}
+#define FIXMAP_PAGE_NOCACHE PAGE_KERNEL_NCG
 
-static inline unsigned long virt_to_fix(const unsigned long vaddr)
-{
-   BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START);
-   return __virt_to_fix(vaddr);
-}
+#include 
 
 #endif /* !__ASSEMBLY__ */
 #endif
-- 
1.8.3.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH v2 00/11] Consolidate asm/fixmap.h files

2013-11-25 Thread Mark Salter
Many architectures provide an asm/fixmap.h which defines support for
compile-time 'special' virtual mappings which need to be made before
paging_init() has run. This suport is also used for early ioremap
on x86. Much of this support is identical across the architectures.
This patch consolidates all of the common bits into asm-generic/fixmap.h
which is intended to be included from arch/*/include/asm/fixmap.h.

This has been compiled on x86, arm, powerpc, and sh, but tested
on x86 only.

This is version two of the patch series:

   git://github.com/mosalter/linux.git#fixmap-v2

Version 1 is here:

   git://github.com/mosalter/linux.git#fixmap

Changes from v1:

  * Added acks from feedback.
  * Use BUILD_BUG_ON in fix_to_virt()
  * Fixed ARM patch to make FIXMAP_TOP inclusive of fixmap
range as is the case in the other architectures.

Mark Salter (11):
  Add generic fixmap.h
  x86: use generic fixmap.h
  arm: use generic fixmap.h
  hexagon: use generic fixmap.h
  metag: use generic fixmap.h
  microblaze: use generic fixmap.h
  mips: use generic fixmap.h
  powerpc: use generic fixmap.h
  sh: use generic fixmap.h
  tile: use generic fixmap.h
  um: use generic fixmap.h

 arch/arm/include/asm/fixmap.h| 29 +++
 arch/arm/mm/init.c   |  2 +-
 arch/hexagon/include/asm/fixmap.h| 40 +--
 arch/metag/include/asm/fixmap.h  | 32 +---
 arch/microblaze/include/asm/fixmap.h | 44 +---
 arch/mips/include/asm/fixmap.h   | 33 +---
 arch/powerpc/include/asm/fixmap.h| 44 +---
 arch/sh/include/asm/fixmap.h | 39 +--
 arch/tile/include/asm/fixmap.h   | 33 +---
 arch/um/include/asm/fixmap.h | 40 +--
 arch/x86/include/asm/fixmap.h| 59 +-
 include/asm-generic/fixmap.h | 97 
 12 files changed, 118 insertions(+), 374 deletions(-)
 create mode 100644 include/asm-generic/fixmap.h

-- 
1.8.3.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH v2 01/11] Add generic fixmap.h

2013-11-25 Thread Mark Salter
Many architectures provide an asm/fixmap.h which defines support for
compile-time 'special' virtual mappings which need to be made before
paging_init() has run. This support is also used for early ioremap
on x86. Much of this support is identical across the architectures.
This patch consolidates all of the common bits into asm-generic/fixmap.h
which is intended to be included from arch/*/include/asm/fixmap.h.

Signed-off-by: Mark Salter 
Acked-by: Arnd Bergmann 
Acked-by: Ralf Baechle 
CC: linux-a...@vger.kernel.org
CC: Russell King 
CC: linux-arm-ker...@lists.infradead.org
CC: Richard Kuo 
CC: linux-hexa...@vger.kernel.org
CC: James Hogan 
CC: linux-me...@vger.kernel.org
CC: Michal Simek 
CC: microblaze-ucli...@itee.uq.edu.au
CC: linux-m...@linux-mips.org
CC: Benjamin Herrenschmidt 
CC: Paul Mackerras 
CC: linuxppc-dev@lists.ozlabs.org
---
 include/asm-generic/fixmap.h | 97 
 1 file changed, 97 insertions(+)
 create mode 100644 include/asm-generic/fixmap.h

diff --git a/include/asm-generic/fixmap.h b/include/asm-generic/fixmap.h
new file mode 100644
index 000..5a64ca4
--- /dev/null
+++ b/include/asm-generic/fixmap.h
@@ -0,0 +1,97 @@
+/*
+ * fixmap.h: compile-time virtual memory allocation
+ *
+ * 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.
+ *
+ * Copyright (C) 1998 Ingo Molnar
+ *
+ * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999
+ * x86_32 and x86_64 integration by Gustavo F. Padovan, February 2009
+ * Break out common bits to asm-generic by Mark Salter, November 2013
+ */
+
+#ifndef __ASM_GENERIC_FIXMAP_H
+#define __ASM_GENERIC_FIXMAP_H
+
+#include 
+
+#define __fix_to_virt(x)   (FIXADDR_TOP - ((x) << PAGE_SHIFT))
+#define __virt_to_fix(x)   ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT)
+
+#ifndef __ASSEMBLY__
+/*
+ * 'index to address' translation. If anyone tries to use the idx
+ * directly without translation, we catch the bug with a NULL-deference
+ * kernel oops. Illegal ranges of incoming indices are caught too.
+ */
+static __always_inline unsigned long fix_to_virt(const unsigned int idx)
+{
+   BUILD_BUG_ON(idx >= __end_of_fixed_addresses);
+   return __fix_to_virt(idx);
+}
+
+static inline unsigned long virt_to_fix(const unsigned long vaddr)
+{
+   BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START);
+   return __virt_to_fix(vaddr);
+}
+
+/*
+ * Provide some reasonable defaults for page flags.
+ * Not all architectures use all of these different types and some
+ * architectures use different names.
+ */
+#ifndef FIXMAP_PAGE_NORMAL
+#define FIXMAP_PAGE_NORMAL PAGE_KERNEL
+#endif
+#ifndef FIXMAP_PAGE_NOCACHE
+#define FIXMAP_PAGE_NOCACHE PAGE_KERNEL_NOCACHE
+#endif
+#ifndef FIXMAP_PAGE_IO
+#define FIXMAP_PAGE_IO PAGE_KERNEL_IO
+#endif
+#ifndef FIXMAP_PAGE_CLEAR
+#define FIXMAP_PAGE_CLEAR __pgprot(0)
+#endif
+
+#ifndef set_fixmap
+#define set_fixmap(idx, phys)  \
+   __set_fixmap(idx, phys, FIXMAP_PAGE_NORMAL)
+#endif
+
+#ifndef clear_fixmap
+#define clear_fixmap(idx)  \
+   __set_fixmap(idx, 0, FIXMAP_PAGE_CLEAR)
+#endif
+
+/* Return a pointer with offset calculated */
+#define __set_fixmap_offset(idx, phys, flags)\
+({   \
+   unsigned long addr;   \
+   __set_fixmap(idx, phys, flags);   \
+   addr = fix_to_virt(idx) + ((phys) & (PAGE_SIZE - 1)); \
+   addr; \
+})
+
+#define set_fixmap_offset(idx, phys) \
+   __set_fixmap_offset(idx, phys, FIXMAP_PAGE_NORMAL)
+
+/*
+ * Some hardware wants to get fixmapped without caching.
+ */
+#define set_fixmap_nocache(idx, phys) \
+   __set_fixmap(idx, phys, FIXMAP_PAGE_NOCACHE)
+
+#define set_fixmap_offset_nocache(idx, phys) \
+   __set_fixmap_offset(idx, phys, FIXMAP_PAGE_NOCACHE)
+
+/*
+ * Some fixmaps are for IO
+ */
+#define set_fixmap_io(idx, phys) \
+   __set_fixmap(idx, phys, FIXMAP_PAGE_IO)
+
+#endif /* __ASSEMBLY__ */
+#endif /* __ASM_GENERIC_FIXMAP_H */
-- 
1.8.3.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 05/10] powerpc: select ARCH_MIGHT_HAVE_PC_SERIO

2013-12-14 Thread Mark Salter
Architectures which might use an i8042 for serial IO to keyboard,
mouse, etc should select ARCH_MIGHT_HAVE_PC_SERIO.

Signed-off-by: Mark Salter 
CC: Benjamin Herrenschmidt 
CC: Paul Mackerras 
CC: linuxppc-dev@lists.ozlabs.org
---
 arch/powerpc/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index b44b52c..fb75485 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -86,6 +86,7 @@ config PPC
bool
default y
select ARCH_MIGHT_HAVE_PC_PARPORT
+   select ARCH_MIGHT_HAVE_PC_SERIO
select BINFMT_ELF
select OF
select OF_EARLY_FLATTREE
-- 
1.8.3.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 10/10] Kconfig: cleanup SERIO_I8042 dependencies

2013-12-14 Thread Mark Salter
Remove messy dependencies from SERIO_I8042 by having it depend on one
Kconfig symbol (ARCH_MIGHT_HAVE_PC_SERIO) and having architectures
which need it select ARCH_MIGHT_HAVE_PC_SERIO in arch/*/Kconfig.
New architectures are unlikely to need SERIO_I8042, so this avoids
having an ever growing list of architectures to exclude.

Signed-off-by: Mark Salter 
CC: Dmitry Torokhov 
CC: Richard Henderson 
CC: linux-al...@vger.kernel.org
CC: Russell King 
CC: linux-arm-ker...@lists.infradead.org
CC: Tony Luck 
CC: Fenghua Yu 
CC: linux-i...@vger.kernel.org
CC: Ralf Baechle 
CC: linux-m...@linux-mips.org
CC: Benjamin Herrenschmidt 
CC: Paul Mackerras 
CC: linuxppc-dev@lists.ozlabs.org
CC: Paul Mundt 
CC: linux...@vger.kernel.org
CC: "David S. Miller" 
CC: sparcli...@vger.kernel.org
CC: Guan Xuetao 
CC: Ingo Molnar 
CC: Thomas Gleixner 
CC: "H. Peter Anvin" 
CC: x...@kernel.org
---
 drivers/input/serio/Kconfig | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/input/serio/Kconfig b/drivers/input/serio/Kconfig
index 8541f94..1f5cec2 100644
--- a/drivers/input/serio/Kconfig
+++ b/drivers/input/serio/Kconfig
@@ -16,14 +16,19 @@ config SERIO
  To compile this driver as a module, choose M here: the
  module will be called serio.
 
+config ARCH_MIGHT_HAVE_PC_SERIO
+   bool
+   help
+ Select this config option from the architecture Kconfig if
+ the architecture might use a PC serio device (i8042) to
+  communicate with keyboard, mouse, etc.
+
 if SERIO
 
 config SERIO_I8042
tristate "i8042 PC Keyboard controller"
default y
-   depends on !PARISC && (!ARM || FOOTBRIDGE_HOST) && \
-  (!SUPERH || SH_CAYMAN) && !M68K && !BLACKFIN && !S390 && \
-  !ARC
+   depends on ARCH_MIGHT_HAVE_PC_SERIO
help
  i8042 is the chip over which the standard AT keyboard and PS/2
  mouse are connected to the computer. If you use these devices,
-- 
1.8.3.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 10/10] Kconfig: cleanup SERIO_I8042 dependencies

2013-12-15 Thread Mark Salter
On Sun, 2013-12-15 at 02:36 -0800, Dmitry Torokhov wrote:
> On Sat, Dec 14, 2013 at 10:32:31AM -0800, H. Peter Anvin wrote:
> > On 12/14/2013 08:59 AM, Mark Salter wrote:
> > > Remove messy dependencies from SERIO_I8042 by having it depend on one
> > > Kconfig symbol (ARCH_MIGHT_HAVE_PC_SERIO) and having architectures
> > > which need it select ARCH_MIGHT_HAVE_PC_SERIO in arch/*/Kconfig.
> > > New architectures are unlikely to need SERIO_I8042, so this avoids
> > > having an ever growing list of architectures to exclude.

> How are we going to merge this? In bulk through input tree or peacemeal
> through all arches first?
> 

They should all go together to eliminate the chance of bisect breakage.
Either the input tree or maybe akpm tree.


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH v2 00/10] Kconfig: cleanup SERIO_I8042 dependencies

2013-12-17 Thread Mark Salter
This patch series removes the messy dependencies from SERIO_I8042
by having it depend on one variable (ARCH_MAY_HAVE_PC_SERIO) and
having architectures which need it select that variable in
arch/*/Kconfig.

New architectures are unlikely to need SERIO_I8042, so this avoids
having an ever growing list of architectures to exclude. If an
architecture without i8042 support isn't excluded through the
dependency list for SERIO_I8042 or through explicit disabling in
a config, it will likely panic on boot with something similar to
this (from arm64):

[   27.426181] [] i8042_flush+0x88/0x10c
[   27.426251] [] i8042_init+0x58/0xe8
[   27.426320] [] do_one_initcall+0xc4/0x14c
[   27.426404] [] kernel_init_freeable+0x1a4/0x244
[   27.426480] [] kernel_init+0x18/0x148
[   27.426561] Code: d2800c82 f2bf7c02 f2dff7e2 f2e2 (39400042) 
[   27.426789] ---[ end trace ac076843cf0f383e ]---
[   27.426875] Kernel panic - not syncing: Attempted to kill init! 
exitcode=0x000b

This is v2 of the patch series. Changes from version 1:

  o Added acks. arm, ia64, and sh are only ones without acks.
  o Moved select of ARCH_MIGHT_HAVE_PC_SERIO to board-specific
Kconfigs for arm and sh.

A tree with these patches is at:

   git://github.com/mosalter/linux.git (serio-i8042-v2 branch)


Mark Salter (10):
  alpha: select ARCH_MIGHT_HAVE_PC_SERIO
  arm: select ARCH_MIGHT_HAVE_PC_SERIO
  ia64: select ARCH_MIGHT_HAVE_PC_SERIO
  mips: select ARCH_MIGHT_HAVE_PC_SERIO
  powerpc: select ARCH_MIGHT_HAVE_PC_SERIO
  sh: select ARCH_MIGHT_HAVE_PC_SERIO for SH_CAYMAN
  sparc: select ARCH_MIGHT_HAVE_PC_SERIO
  unicore32: select ARCH_MIGHT_HAVE_PC_SERIO
  x86: select ARCH_MIGHT_HAVE_PC_SERIO
  Kconfig: cleanup SERIO_I8042 dependencies

 arch/alpha/Kconfig   |  1 +
 arch/arm/mach-footbridge/Kconfig |  1 +
 arch/ia64/Kconfig|  1 +
 arch/mips/Kconfig|  1 +
 arch/powerpc/Kconfig |  1 +
 arch/sh/boards/Kconfig   |  1 +
 arch/sparc/Kconfig   |  1 +
 arch/unicore32/Kconfig   |  1 +
 arch/x86/Kconfig |  1 +
 drivers/input/serio/Kconfig  | 11 ---
 10 files changed, 17 insertions(+), 3 deletions(-)

-- 
1.8.3.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH v2 10/10] Kconfig: cleanup SERIO_I8042 dependencies

2013-12-17 Thread Mark Salter
Remove messy dependencies from SERIO_I8042 by having it depend on one
Kconfig symbol (ARCH_MIGHT_HAVE_PC_SERIO) and having architectures
which need it select ARCH_MIGHT_HAVE_PC_SERIO in arch/*/Kconfig.
New architectures are unlikely to need SERIO_I8042, so this avoids
having an ever growing list of architectures to exclude.

Signed-off-by: Mark Salter 
Acked-by: "H. Peter Anvin" 
Acked-by: Ralf Baechle 
Acked-by: Benjamin Herrenschmidt 
CC: Dmitry Torokhov 
CC: Richard Henderson 
CC: linux-al...@vger.kernel.org
CC: Russell King 
CC: linux-arm-ker...@lists.infradead.org
CC: Tony Luck 
CC: Fenghua Yu 
CC: linux-i...@vger.kernel.org
CC: linux-m...@linux-mips.org
CC: Paul Mackerras 
CC: linuxppc-dev@lists.ozlabs.org
CC: Paul Mundt 
CC: linux...@vger.kernel.org
CC: "David S. Miller" 
CC: sparcli...@vger.kernel.org
CC: Guan Xuetao 
CC: Ingo Molnar 
CC: Thomas Gleixner 
CC: x...@kernel.org
---
 drivers/input/serio/Kconfig | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/input/serio/Kconfig b/drivers/input/serio/Kconfig
index 8541f94..1f5cec2 100644
--- a/drivers/input/serio/Kconfig
+++ b/drivers/input/serio/Kconfig
@@ -16,14 +16,19 @@ config SERIO
  To compile this driver as a module, choose M here: the
  module will be called serio.
 
+config ARCH_MIGHT_HAVE_PC_SERIO
+   bool
+   help
+ Select this config option from the architecture Kconfig if
+ the architecture might use a PC serio device (i8042) to
+  communicate with keyboard, mouse, etc.
+
 if SERIO
 
 config SERIO_I8042
tristate "i8042 PC Keyboard controller"
default y
-   depends on !PARISC && (!ARM || FOOTBRIDGE_HOST) && \
-  (!SUPERH || SH_CAYMAN) && !M68K && !BLACKFIN && !S390 && \
-  !ARC
+   depends on ARCH_MIGHT_HAVE_PC_SERIO
help
  i8042 is the chip over which the standard AT keyboard and PS/2
  mouse are connected to the computer. If you use these devices,
-- 
1.8.3.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH v2 05/10] powerpc: select ARCH_MIGHT_HAVE_PC_SERIO

2013-12-17 Thread Mark Salter
Architectures which might use an i8042 for serial IO to keyboard,
mouse, etc should select ARCH_MIGHT_HAVE_PC_SERIO.

Signed-off-by: Mark Salter 
Acked-by: Benjamin Herrenschmidt 
CC: Paul Mackerras 
CC: linuxppc-dev@lists.ozlabs.org
---
 arch/powerpc/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index b44b52c..fb75485 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -86,6 +86,7 @@ config PPC
bool
default y
select ARCH_MIGHT_HAVE_PC_PARPORT
+   select ARCH_MIGHT_HAVE_PC_SERIO
select BINFMT_ELF
select OF
select OF_EARLY_FLATTREE
-- 
1.8.3.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: kernel BUG at drivers/scsi/scsi_lib.c:1096!

2015-11-18 Thread Mark Salter
On Wed, 2015-11-18 at 20:18 +1100, Michael Ellerman wrote:
> Hi folks,
> 
> I'm intermittently seeing the following oops on at least one powerpc box.
> 
> The BUG_ON() is from:
> 
> static int scsi_init_sgtable(struct request *req, struct scsi_data_buffer 
> *sdb)
> {
>   ...
>   count = blk_rq_map_sg(req->q, req, sdb->table.sgl);
>   BUG_ON(count > sdb->table.nents);
> 
> Looking at the dump it looks like count was 2, I can't work out what nents 
> was.
> 
> The machine's just a fairly boring bare metal setup, with a single IPR 
> adapter:
> 
> 0001:08:00.0 RAID bus controller: IBM PCI-E IPR SAS Adapter (ASIC) (rev 02)
>   Subsystem: IBM PCIe3 x8 SAS RAID Internal Adapter 6Gb (57D7)
>   Flags: bus master, fast devsel, latency 0
>   Kernel driver in use: ipr
> 
> 
> Anyone seen it before or have any ideas?

I'm also seeing it on arm64 in 4.4-rc1

[6.859003] Call trace:  

[6.861439] [] scsi_init_sgtable+0x84/0x88 

[6.867072] [] scsi_init_io+0x4c/0x1ac 

[6.872358] [] sd_setup_read_write_cmnd+0x44/0x844 

[6.878682] [] sd_init_command+0x38/0xb0   

[6.884141] [] scsi_setup_cmnd+0xd8/0x13c  

[6.889686] [] scsi_prep_fn+0xc0/0x140 

[6.894973] [] blk_peek_request+0x148/0x24c

[6.900692] [] scsi_request_fn+0x58/0x648  

[6.906237] [] __blk_run_queue+0x40/0x58   

[6.911696] [] blk_run_queue+0x30/0x48 

[6.916983] [] scsi_run_queue+0x204/0x294  

[6.922528] [] scsi_end_request+0x13c/0x1a0

[6.928247] [] scsi_io_completion+0xf0/0x564   

[6.934052] [] scsi_finish_command+0xe4/0x144  

[6.939943] [] scsi_softirq_done+0x148/0x178   

[6.945748] [] blk_done_softirq+0x7c/0x94  

[6.951295] [] __do_softirq+0x114/0x2a0

[6.956667] [] irq_exit+0x8c/0xe4  

[6.961522] [] handle_IPI+0x170/0x228  

[6.966721] [] gic_handle_irq+0xa0/0xb8

[6.972093] Exception stack(0xfe03dc143de0 to 0xfe03dc143f00)


> 
> cheers
> 
> 
> systemd[1]: Starting Uncomplicated firewall...
>  Starting Uncomplicated firewall...
> [ cut here ]
> kernel BUG at drivers/scsi/scsi_lib.c:1096!
> Oops: Exception in kernel mode, sig: 5 [#1]
> SMP NR_CPUS=2048 NUMA PowerNV
> Modules linked in:
> CPU: 132 PID: 2699 Comm: kworker/132:1H Not tainted 
> 4.4.0-rc1-54939-ge22a248-dirty #77
> Workqueue: kblockd cfq_kick_queue
> task: c00fef147400 ti: c00feb384000 task.ti: c00feb384000
> NIP: c05ab4a8 LR: c05ab490 CTR: 
> REGS: c00feb387620 TRAP: 0700   Not tainted  
> (4.4.0-rc1-54939-ge22a248-dirty)
> MSR: 900100029033   CR: 24002228  XER: 
> CFAR: c0464950 SOFTE: 0 
> GPR00: c05ab490 c00feb3878a0 c0d77d00 0002 
> GPR04: c00ff2030158 c00ff47a0c00  1000 
> GPR08:  0001  fff7 
> GPR12: 2200 cfde5200 c00c8098 c0b39858 
> GPR16: c0ae12c8 c0b39948   
> GPR20: c05ab9c0 c017f5800144  c01e551a6850 
> GPR24: c017f5800140 c007efb9c800  c01e551a6800 
> GPR28:   c00ff2030158 c00feb420240 
> NIP [c05ab4a8] scsi_init_sgtable+0xa8/0x180
> LR [c05ab490] scsi_init_sgtable+0x90/0x180
> Call Trace:
> [c00feb3878a0] [c05ab490] scsi_init_sgtable+0x90/0x180 
> (unreliable)
> [c00feb3878e0] [c05ab5d4] scsi_init_io+0x54/0x160
> [c00feb387930] [c05fb43c] sd_init_command+0x6c/0xb00
> [c00feb3879f0] [c05ac2f8] scsi_setup_cmnd+0x108/0x1a0
> [c00feb387a30] [c05ac594] scsi_prep_fn+0x104/0x1c0
> [c00feb387a70] [c045d85c] blk_peek_request+0x20c/0x390
> [c00feb387af0] [c05ad6a8] scsi_request_fn+0xb8/0x7f0
> [c00feb387bf0] [c04583b4] __blk_run_queue+0x54/0x80
> [c00feb387c20] [c047e178] cfq_kick_queue+0x38/0xc0
> [c00feb387c50] [c00c00cc] process_one_work+0x2ac/0x560
> [c00feb387ce0] [c00c0510] worker_thread+0x190/0x660
> [c00feb387d80] [c00c8198] kthread+0x108/0x130
> [c00feb387e30] [c

Re: kernel BUG at drivers/scsi/scsi_lib.c:1096!

2015-11-20 Thread Mark Salter
On Fri, 2015-11-20 at 13:56 +0100, Laurent Dufour wrote:
> On 20/11/2015 13:10, Michael Ellerman wrote:
> > On Thu, 2015-11-19 at 00:23 -0800, Christoph Hellwig wrote:
> > 
> > > It's pretty much guaranteed a block layer bug, most likely in the
> > > merge bios to request infrastucture where we don't obey the merging
> > > limits properly.
> > > 
> > > Does either of you have a known good and first known bad kernel?
> > 
> > Not me, I've only hit it one or two times. All I can say is I have hit it in
> > 4.4-rc1.
> > 
> > Laurent, can you narrow it down at all?
> 
> I'm trying bisect it but it's very time consuming, and I think I missed
> some bad kernel because I didn't let enough time to the system to panic.
> 
> But I'm still on...
> 
I usually hit it at boot time. Maybe one out of five times. I'll take a stab
at bisecting today...

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: kernel BUG at drivers/scsi/scsi_lib.c:1096!

2015-11-22 Thread Mark Salter
On Sun, 2015-11-22 at 00:56 +0800, Ming Lei wrote:
> On Sat, 21 Nov 2015 12:30:14 +0100
> Laurent Dufour  wrote:
> 
> > On 20/11/2015 13:10, Michael Ellerman wrote:
> > > On Thu, 2015-11-19 at 00:23 -0800, Christoph Hellwig wrote:
> > > 
> > > > It's pretty much guaranteed a block layer bug, most likely in the
> > > > merge bios to request infrastucture where we don't obey the merging
> > > > limits properly.
> > > > 
> > > > Does either of you have a known good and first known bad kernel?
> > > 
> > > Not me, I've only hit it one or two times. All I can say is I have hit it 
> > > in
> > > 4.4-rc1.
> > > 
> > > Laurent, can you narrow it down at all?
> > 
> > It seems that the panic is triggered by the commit bdced438acd8 ("block:
> > setup bi_phys_segments after splitting") which has been pulled by the
> > merge d9734e0d1ccf ("Merge branch 'for-4.4/core' of
> > git://git.kernel.dk/linux-block").
> > 
> > My system is panicing promptly when running a kernel built at
> > d9734e0d1ccf, while reverting the commit bdced438acd8, it can run hours
> > without panicing.
> > 
> > This being said, I can't explain what's going wrong.
> > 
> > May Ming shed some light here ?
> 
> Laurent, looks there is one bug in blk_bio_segment_split(), would you
> mind testing the following patch to see if it fixes your issue?
> 
> ---
> From 6fc701231dcc000bc8bc4b9105583380d9aa31f4 Mon Sep 17 00:00:00 2001
> From: Ming Lei 
> Date: Sun, 22 Nov 2015 00:47:13 +0800
> Subject: [PATCH] block: fix segment split
> 
> Inside blk_bio_segment_split(), previous bvec pointer('bvprvp')
> always points to the iterator local variable, which is obviously
> wrong, so fix it by pointing to the local variable of 'bvprv'.
> 
> Signed-off-by: Ming Lei 
> ---
>  block/blk-merge.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/block/blk-merge.c b/block/blk-merge.c
> index de5716d8..f2efe8a 100644
> --- a/block/blk-merge.c
> +++ b/block/blk-merge.c
> @@ -98,7 +98,7 @@ static struct bio *blk_bio_segment_split(struct 
> request_queue *q,
>  
>   seg_size += bv.bv_len;
>   bvprv = bv;
> - bvprvp = &bv;
> + bvprvp = &bvprv;
>   sectors += bv.bv_len >> 9;
>   continue;
>   }
> @@ -108,7 +108,7 @@ new_segment:
>  
>   nsegs++;
>   bvprv = bv;
> - bvprvp = &bv;
> + bvprvp = &bvprv;
>   seg_size = bv.bv_len;
>   sectors += bv.bv_len >> 9;
>   }

I'm still hitting the BUG even with this patch applied on top of 4.4-rc1.


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: kernel BUG at drivers/scsi/scsi_lib.c:1096!

2015-11-22 Thread Mark Salter
On Mon, 2015-11-23 at 08:36 +0800, Ming Lei wrote:
> On Mon, Nov 23, 2015 at 7:20 AM, Mark Salter  wrote:
> > On Sun, 2015-11-22 at 00:56 +0800, Ming Lei wrote:
> > > On Sat, 21 Nov 2015 12:30:14 +0100
> > > Laurent Dufour  wrote:
> > > 
> > > > On 20/11/2015 13:10, Michael Ellerman wrote:
> > > > > On Thu, 2015-11-19 at 00:23 -0800, Christoph Hellwig wrote:
> > > > > 
> > > > > > It's pretty much guaranteed a block layer bug, most likely in the
> > > > > > merge bios to request infrastucture where we don't obey the merging
> > > > > > limits properly.
> > > > > > 
> > > > > > Does either of you have a known good and first known bad kernel?
> > > > > 
> > > > > Not me, I've only hit it one or two times. All I can say is I have 
> > > > > hit it in
> > > > > 4.4-rc1.
> > > > > 
> > > > > Laurent, can you narrow it down at all?
> > > > 
> > > > It seems that the panic is triggered by the commit bdced438acd8 ("block:
> > > > setup bi_phys_segments after splitting") which has been pulled by the
> > > > merge d9734e0d1ccf ("Merge branch 'for-4.4/core' of
> > > > git://git.kernel.dk/linux-block").
> > > > 
> > > > My system is panicing promptly when running a kernel built at
> > > > d9734e0d1ccf, while reverting the commit bdced438acd8, it can run hours
> > > > without panicing.
> > > > 
> > > > This being said, I can't explain what's going wrong.
> > > > 
> > > > May Ming shed some light here ?
> > > 
> > > Laurent, looks there is one bug in blk_bio_segment_split(), would you
> > > mind testing the following patch to see if it fixes your issue?
> > > 
> > > ---
> > > From 6fc701231dcc000bc8bc4b9105583380d9aa31f4 Mon Sep 17 00:00:00 2001
> > > From: Ming Lei 
> > > Date: Sun, 22 Nov 2015 00:47:13 +0800
> > > Subject: [PATCH] block: fix segment split
> > > 
> > > Inside blk_bio_segment_split(), previous bvec pointer('bvprvp')
> > > always points to the iterator local variable, which is obviously
> > > wrong, so fix it by pointing to the local variable of 'bvprv'.
> > > 
> > > Signed-off-by: Ming Lei 
> > > ---
> > >  block/blk-merge.c | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/block/blk-merge.c b/block/blk-merge.c
> > > index de5716d8..f2efe8a 100644
> > > --- a/block/blk-merge.c
> > > +++ b/block/blk-merge.c
> > > @@ -98,7 +98,7 @@ static struct bio *blk_bio_segment_split(struct 
> > > request_queue *q,
> > > 
> > >   seg_size += bv.bv_len;
> > >   bvprv = bv;
> > > - bvprvp = &bv;
> > > + bvprvp = &bvprv;
> > >   sectors += bv.bv_len >> 9;
> > >   continue;
> > >   }
> > > @@ -108,7 +108,7 @@ new_segment:
> > > 
> > >   nsegs++;
> > >   bvprv = bv;
> > > - bvprvp = &bv;
> > > + bvprvp = &bvprv;
> > >   seg_size = bv.bv_len;
> > >   sectors += bv.bv_len >> 9;
> > >   }
> > 
> > I'm still hitting the BUG even with this patch applied on top of 4.4-rc1.
> 
> OK, looks there are still other bugs, care to share us how to reproduce
> it on arm64?
> 
> thanks,
> Ming

Unfortunately, the best reproducer I have is to boot the platform. I have seen 
the
BUG a few times post-boot, but I don't have a consistant reproducer. I am using
upstream 4.4-rc1 with this config:

  http://people.redhat.com/msalter/fh_defconfig

With 4.4-rc1 on an APM Mustang platform, I see the BUG about once every 6-7 
boots.
On an AMD Seattle platform, about every 9 boots.

I have a script that loops through an ssh command to reboot the platform under 
test.
I manually install test kernels and then run the script and wait for failure. 
While
debugging, I have tried more minimal configs with which I have been unable to
reproduce the problem even after several hours of reboots. With the above 
mentioned
fh_defconfig, I have been able to get a failure within 20 or so boots with most
kernel builds but at certain kernel commits, the failure has taken a longer 
time to
reproduce.

From my POV, I can't say which commit causes the problem. So far, I have not 
been
able to reproduce at all before commit d9734e0d1ccf but I am currently trying to
reproduce with commit 0d51ce9ca1116 (one merge earlier than d9734e0d1ccf).


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: kernel BUG at drivers/scsi/scsi_lib.c:1096!

2015-11-23 Thread Mark Salter
On Mon, 2015-11-23 at 23:27 +0800, Ming Lei wrote:
> On Mon, Nov 23, 2015 at 11:20 PM, Laurent Dufour
>  wrote:
> > > 
> > > Reverting above commit on top if 4.4-rc1 seems to fix the problem for me.
> > 
> > That's what I mentioned earlier ;)
> > 
> > Now Ming send an additional patch with seems to fix the bug introduced
> > through the commit bdced438acd8. When testing with this new patch I
> > can't get the panic anymore, but Mark reported he is still hitting it.
> 
> Laurent, thanks for your test on the 1st patch, and looks there are at
> least two problems, and my 2nd patch sent just now should address
> Mark's issue which is caused by bdced438acd83a.
> 
> Once the 2nd one is tested OK, I will send out the two together.
> 
> Thanks,
> Ming

Thanks Ming.
With both patches applied, I have been unable to reproduce the problem.

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 2/2] Kbuild: Use dtc's -d (dependency) option

2012-01-11 Thread Mark Salter
On Mon, 2012-01-09 at 11:38 -0700, Stephen Warren wrote:
> This hooks dtc into Kbuild's dependency system.
> 
> Thus, for example, "make dtbs" will rebuild tegra-harmony.dtb if only
> tegra20.dtsi has changed yet tegra-harmony.dts has not. The previous
> lack of this feature recently caused me to have very confusing "git
> bisect" results.
> 
> For ARM, it's obvious what to add to $(targets). I'm not familiar enough
> with other architectures to know what to add there. Powerpc appears to
> already add various .dtb files into $(targets), but the other archs may
> need something added to $(targets) to work.
> 
> Signed-off-by: Stephen Warren 
> 

Acked-by: Mark Salter 

For the arch/c6x bit.


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


RE: [PATCH 2/2] Kbuild: Use dtc's -d (dependency) option

2012-01-17 Thread Mark Salter
On Tue, 2012-01-17 at 09:20 -0800, Stephen Warren wrote:
> Michal Marek wrote at Saturday, January 14, 2012 3:51 PM:
> > On 11.1.2012 20:36, Mark Salter wrote:
> > > On Mon, 2012-01-09 at 11:38 -0700, Stephen Warren wrote:
> > >> This hooks dtc into Kbuild's dependency system.
> > >>
> > >> Thus, for example, "make dtbs" will rebuild tegra-harmony.dtb if only
> > >> tegra20.dtsi has changed yet tegra-harmony.dts has not. The previous
> > >> lack of this feature recently caused me to have very confusing "git
> > >> bisect" results.
> > >>
> > >> For ARM, it's obvious what to add to $(targets). I'm not familiar enough
> > >> with other architectures to know what to add there. Powerpc appears to
> > >> already add various .dtb files into $(targets), but the other archs may
> > >> need something added to $(targets) to work.
> > >>
> > >> Signed-off-by: Stephen Warren 
> > >>
> > >
> > > Acked-by: Mark Salter 
> > >
> > > For the arch/c6x bit.
> > 
> > As the C6X port has been merged in this merge window, I can't easily
> > apply this patch to my kbuild branch and at the same time please Linus
> > by basing the pull request on a tagged release. So I'm going to drop the
> > arch/c6x part to keep the kbuild branch "pretty" and let either Mark or
> > Stephen send the patch to Linus directly, once he has merged the kbuild
> > branch. Would that work?
> 
> I was assuming my patches were for 3.4 rather than 3.3, since it's pretty
> late for new features in 3.3. In that case, there wouldn't be an issue,
> right?
> 
> If you do want to go ahead and push my patches into 3.3, your proposal
> looks fine to me. Mark, do you want me to push the patch to Linus, or
> do you want to pick it up?

It would probably be best to keep it all together, but if there's a need
to break out c6x individually, I don't mind picking it up.

--Mark


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [RFCv2 00/14]

2012-01-25 Thread Mark Salter
On Mon, 2012-01-23 at 14:07 -0700, Grant Likely wrote:
> Hey everyone,
> 
> Here's the second RFC for the irq_domain patches.  I could use some
> help testing now.  I still expect there will be a few bugs.  The
> series is based on v3.3-rc1, and I've pushed it out to my git server:

Hi Grant,

I converted arch/c6x over to the generic irq_domain support and have not
had any problems in testing. The c6x virtual irq support was a nearly
identical copy of the powerpc code, so the patch I ended up with mostly
copied what you did in arch/powerpc. The c6x patch is on the tip of:

  g...@linux-c6x.org:/git/projects/linux-c6x-upstreaming irq-testing

I think this probably belongs in your series, but I can push it
separately if not.

--Mark


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH v5 20/27] irq_domain/c6x: constify irq_domain structures

2012-02-21 Thread Mark Salter
On Thu, 2012-02-16 at 02:09 -0700, Grant Likely wrote:
> Signed-off-by: Grant Likely 
> Cc: Mark Salter 
> Cc: Thomas Gleixner 
> ---
>  arch/arm/common/gic.c|2 +-
>  arch/c6x/kernel/irq.c|2 +-
>  arch/c6x/platforms/megamod-pic.c |2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)

For c6x part:

Acked-by: Mark Salter 


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH v5 21/27] irq_domain/c6x: Use library of xlate functions

2012-02-21 Thread Mark Salter
On Thu, 2012-02-16 at 02:09 -0700, Grant Likely wrote:
> The c6x irq controllers don't need to define custom .xlate hooks
> 
> Signed-off-by: Grant Likely 
> Cc: Rob Herring 
> Cc: Mark Salter 
> Cc: Thomas Gleixner 
> ---
>  arch/c6x/kernel/irq.c|1 +
>  arch/c6x/platforms/megamod-pic.c |   14 +-
>  2 files changed, 2 insertions(+), 13 deletions(-)

Acked-by: Mark Salter 


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 10/29] c6x: use asm-generic/cacheflush.h

2020-05-18 Thread Mark Salter
On Fri, 2020-05-15 at 16:36 +0200, Christoph Hellwig wrote:
> C6x needs almost no cache flushing routines of its own.  Rely on
> asm-generic/cacheflush.h for the defaults.
> 
> Signed-off-by: Christoph Hellwig 
> ---
>  arch/c6x/include/asm/cacheflush.h | 19 +--
>  1 file changed, 1 insertion(+), 18 deletions(-)
> 
> diff --git a/arch/c6x/include/asm/cacheflush.h 
> b/arch/c6x/include/asm/cacheflush.h
> index 4540b40475e6c..10922d528de6d 100644
> --- a/arch/c6x/include/asm/cacheflush.h
> +++ b/arch/c6x/include/asm/cacheflush.h
> @@ -16,21 +16,6 @@
>  #include 
>  #include 
>  
> -/*
> - * virtually-indexed cache management (our cache is physically indexed)
> - */
> -#define flush_cache_all()do {} while (0)
> -#define flush_cache_mm(mm)   do {} while (0)
> -#define flush_cache_dup_mm(mm)   do {} while (0)
> -#define flush_cache_range(mm, start, end)do {} while (0)
> -#define flush_cache_page(vma, vmaddr, pfn)   do {} while (0)
> -#define flush_cache_vmap(start, end) do {} while (0)
> -#define flush_cache_vunmap(start, end)   do {} while (0)
> -#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0
> -#define flush_dcache_page(page)  do {} while (0)
> -#define flush_dcache_mmap_lock(mapping)  do {} while (0)
> -#define flush_dcache_mmap_unlock(mapping)do {} while (0)
> -
>  /*
>   * physically-indexed cache management
>   */
> @@ -49,14 +34,12 @@ do {  
>   \
>   (unsigned long) page_address(page) + PAGE_SIZE)); \
>  } while (0)
>  
> -
>  #define copy_to_user_page(vma, page, vaddr, dst, src, len) \
>  do {  \
>   memcpy(dst, src, len);   \
>   flush_icache_range((unsigned) (dst), (unsigned) (dst) + (len)); \
>  } while (0)
>  
> -#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
> - memcpy(dst, src, len)
> +#include 
>  
>  #endif /* _ASM_C6X_CACHEFLUSH_H */

Acked-by: Mark Salter 




Re: [Linux-c6x-dev] [PATCH v2 7/7] uapi: export all headers under uapi directories

2017-01-11 Thread Mark Salter
> -header-y += perf_regs.h
> -header-y += posix_types.h
> -header-y += ptrace.h
> -header-y += setup.h
> -header-y += sigcontext.h
> -header-y += signal.h
> -header-y += stat.h
> -header-y += statfs.h
> -header-y += swab.h
> -header-y += unistd.h
>  genhdr-y += unistd-common.h
>  genhdr-y += unistd-oabi.h
>  genhdr-y += unistd-eabi.h
> diff --git a/arch/arm64/include/uapi/asm/Kbuild 
> b/arch/arm64/include/uapi/asm/Kbuild
> index 825b0fe51c2b..13a97aa2285f 100644
> --- a/arch/arm64/include/uapi/asm/Kbuild
> +++ b/arch/arm64/include/uapi/asm/Kbuild
> @@ -2,21 +2,3 @@
>  include include/uapi/asm-generic/Kbuild.asm
>  
>  generic-y += kvm_para.h
> -
> -header-y += auxvec.h
> -header-y += bitsperlong.h
> -header-y += byteorder.h
> -header-y += fcntl.h
> -header-y += hwcap.h
> -header-y += kvm_para.h
> -header-y += perf_regs.h
> -header-y += param.h
> -header-y += ptrace.h
> -header-y += setup.h
> -header-y += sigcontext.h
> -header-y += siginfo.h
> -header-y += signal.h
> -header-y += stat.h
> -header-y += statfs.h
> -header-y += ucontext.h
> -header-y += unistd.h
> diff --git a/arch/avr32/include/uapi/asm/Kbuild 
> b/arch/avr32/include/uapi/asm/Kbuild
> index 08d8a3d76ea8..610395083364 100644
> --- a/arch/avr32/include/uapi/asm/Kbuild
> +++ b/arch/avr32/include/uapi/asm/Kbuild
> @@ -1,26 +1,6 @@
>  # UAPI Header export list
>  include include/uapi/asm-generic/Kbuild.asm
>  
> -header-y += auxvec.h
> -header-y += byteorder.h
> -header-y += cachectl.h
> -header-y += msgbuf.h
> -header-y += param.h
> -header-y += posix_types.h
> -header-y += ptrace.h
> -header-y += sembuf.h
> -header-y += setup.h
> -header-y += shmbuf.h
> -header-y += sigcontext.h
> -header-y += signal.h
> -header-y += socket.h
> -header-y += sockios.h
> -header-y += stat.h
> -header-y += swab.h
> -header-y += termbits.h
> -header-y += termios.h
> -header-y += types.h
> -header-y += unistd.h
>  generic-y += bitsperlong.h
>  generic-y += errno.h
>  generic-y += fcntl.h
> diff --git a/arch/blackfin/include/uapi/asm/Kbuild 
> b/arch/blackfin/include/uapi/asm/Kbuild
> index 0bd28f77abc3..b15bf6bc0e94 100644
> --- a/arch/blackfin/include/uapi/asm/Kbuild
> +++ b/arch/blackfin/include/uapi/asm/Kbuild
> @@ -1,19 +1,2 @@
>  # UAPI Header export list
>  include include/uapi/asm-generic/Kbuild.asm
> -
> -header-y += bfin_sport.h
> -header-y += byteorder.h
> -header-y += cachectl.h
> -header-y += fcntl.h
> -header-y += fixed_code.h
> -header-y += ioctls.h
> -header-y += kvm_para.h
> -header-y += poll.h
> -header-y += posix_types.h
> -header-y += ptrace.h
> -header-y += sigcontext.h
> -header-y += siginfo.h
> -header-y += signal.h
> -header-y += stat.h
> -header-y += swab.h
> -header-y += unistd.h
> diff --git a/arch/c6x/include/uapi/asm/Kbuild 
> b/arch/c6x/include/uapi/asm/Kbuild
> index e9bc2b2b8147..13a97aa2285f 100644
> --- a/arch/c6x/include/uapi/asm/Kbuild
> +++ b/arch/c6x/include/uapi/asm/Kbuild
> @@ -2,11 +2,3 @@
>  include include/uapi/asm-generic/Kbuild.asm
>  
>  generic-y += kvm_para.h
> -
> -header-y += byteorder.h
> -header-y += kvm_para.h
> -header-y += ptrace.h
> -header-y += setup.h
> -header-y += sigcontext.h
> -header-y += swab.h
> -header-y += unistd.h

Acked-by: Mark Salter 

> diff --git a/arch/cris/include/uapi/arch-v10/arch/Kbuild 
> b/arch/cris/include/uapi/arch-v10/arch/Kbuild
> deleted file mode 100644
> index 9048c87a782b..
> --- a/arch/cris/include/uapi/arch-v10/arch/Kbuild
> +++ /dev/null
> @@ -1,5 +0,0 @@
> -# UAPI Header export list
> -header-y += sv_addr.agh
> -header-y += sv_addr_ag.h
> -header-y += svinto.h
> -header-y += user.h
> diff --git a/arch/cris/include/uapi/arch-v32/arch/Kbuild 
> b/arch/cris/include/uapi/arch-v32/arch/Kbuild
> deleted file mode 100644
> index 59efffd16b61..
> --- a/arch/cris/include/uapi/arch-v32/arch/Kbuild
> +++ /dev/null
> @@ -1,3 +0,0 @@
> -# UAPI Header export list
> -header-y += cryptocop.h
> -header-y += user.h
> diff --git a/arch/cris/include/uapi/asm/Kbuild 
> b/arch/cris/include/uapi/asm/Kbuild
> index d5564a0ae66a..d0c5471856e0 100644
> --- a/arch/cris/include/uapi/asm/Kbuild
> +++ b/arch/cris/include/uapi/asm/Kbuild
> @@ -1,44 +1,5 @@
>  # UAPI Header export list
>  include include/uapi/asm-generic/Kbuild.asm
>  
> -header-y += ../arch-v10/arch/
> -header-y += ../arch-v32/arch/
> -header-y += auxvec.h
> -header-y += bitsperlong.h
> -header-y += byteorder.h
> -header-y += elf.h
> -header-y += elf_v10.h
> -header-y += elf_v32.h
> -header-y += errno.h
> -header-y += ethernet.h
> -header-y += etraxgp