Re: [PATCH 5/7] ppc64el: kernel: patch: one patch for the PowerNV platform

2014-05-25 Thread Bastian Blank
On Sat, May 24, 2014 at 06:19:00PM -0300, Mauricio Faria de Oliveira wrote:
 This patch didn't make mainline yet (3.15-rc6).

And why?  Which tree currently holds it?

Bastian

-- 
No one may kill a man.  Not for any purpose.  It cannot be condoned.
-- Kirk, Spock's Brain, stardate 5431.6


-- 
To UNSUBSCRIBE, email to debian-kernel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/20140525113640.gd8...@mail.waldi.eu.org



Re: [PATCH 5/7] ppc64el: kernel: patch: one patch for the PowerNV platform

2014-05-25 Thread Ben Hutchings
On Sat, 2014-05-24 at 18:19 -0300, Mauricio Faria de Oliveira wrote:
 This patch didn't make mainline yet (3.15-rc6).
 
 This is required for booting in the PowerNV (non-virtualized) platform in
 little-endian mode.
 
 Sources:
 - 
 https://github.com/torvalds/linux/commit/5072b7ba14de2b02b1d68f85dc5e81980e1818e7
 - http://patchwork.ozlabs.org/patch/350461/
[...]

Please put one of these URLs in the 'Origin' header of the added patch
file.

Ben.

-- 
Ben Hutchings
Teamwork is essential - it allows you to blame someone else.


signature.asc
Description: This is a digitally signed message part


Re: [PATCH 5/7] ppc64el: kernel: patch: one patch for the PowerNV platform

2014-05-25 Thread Mauricio Faria de Oliveira

On 05/25/2014 08:36 AM, Bastian Blank wrote:

On Sat, May 24, 2014 at 06:19:00PM -0300, Mauricio Faria de Oliveira wrote:

This patch didn't make mainline yet (3.15-rc6).


And why?  Which tree currently holds it?


That I'm not sure, but it's carried on other distros, and being
(re)posted by the powerpc kernel guys.

Maybe because it had a different version made available recently, but
it was preferred to keep with an older version [1], which was in Linus's
github tree once [2], and is on Ubuntu Trusty's kernel [3].

It's not yet on Ben H (ok, Herrenschmidt this time; it seems 'benh'
nicknamed people tend to like kernels and powerpc stuff :-)   's
linux-next tree [4]; but I think it's because of the 'recently'
discussed reason/re-posted on linuxppc-dev [5].

So, it's expected to be submitted to -next in some time, since it's
acknowledged to be required. I just happen to don't know why.
I can ask Ben for further clarification if needed.

Thanks,

[1] http://patchwork.ozlabs.org/patch/347024/
[2] 
https://github.com/torvalds/linux/commit/5072b7ba14de2b02b1d68f85dc5e81980e1818e7

[3] https://launchpad.net/ubuntu/+source/linux/3.13.0-1.16
[4] https://git.kernel.org/cgit/linux/kernel/git/benh/powerpc.git/?h=next
[5] http://patchwork.ozlabs.org/patch/350461/

--
Mauricio Faria de Oliveira
IBM Linux Technology Center


--
To UNSUBSCRIBE, email to debian-kernel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/538268fe.1080...@linux.vnet.ibm.com



Re: [PATCH 5/7] ppc64el: kernel: patch: one patch for the PowerNV platform

2014-05-25 Thread Mauricio Faria de Oliveira

On 05/25/2014 09:10 AM, Ben Hutchings wrote:

On Sat, 2014-05-24 at 18:19 -0300, Mauricio Faria de Oliveira wrote:

This patch didn't make mainline yet (3.15-rc6).

This is required for booting in the PowerNV (non-virtualized) platform in
little-endian mode.

Sources:
- 
https://github.com/torvalds/linux/commit/5072b7ba14de2b02b1d68f85dc5e81980e1818e7
- http://patchwork.ozlabs.org/patch/350461/

[...]

Please put one of these URLs in the 'Origin' header of the added patch
file.


Ok, ack.

If we have a better source (say, some -next tree) by the time I submit
a PATCH V2 if needed, I'll put it there instead.  Otherwise I'd stick w/
the other source than linus's github, since it was not pulled from there
yet.

Thanks,

--
Mauricio Faria de Oliveira
IBM Linux Technology Center


--
To UNSUBSCRIBE, email to debian-kernel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/538269e3.9030...@linux.vnet.ibm.com



[PATCH 5/7] ppc64el: kernel: patch: one patch for the PowerNV platform

2014-05-24 Thread Mauricio Faria de Oliveira
This patch didn't make mainline yet (3.15-rc6).

This is required for booting in the PowerNV (non-virtualized) platform in
little-endian mode.

Sources:
- 
https://github.com/torvalds/linux/commit/5072b7ba14de2b02b1d68f85dc5e81980e1818e7
- http://patchwork.ozlabs.org/patch/350461/

Signed-off-by: Mauricio Faria de Oliveira mauri...@linux.vnet.ibm.com
---
 ...el-powernv-calls-to-support-little-endian.patch |   94 
 debian/patches/series  |1 +
 2 files changed, 95 insertions(+), 0 deletions(-)
 create mode 100644 
debian/patches/bugfix/powerpc/ppc64el-powernv-calls-to-support-little-endian.patch

diff --git 
a/debian/patches/bugfix/powerpc/ppc64el-powernv-calls-to-support-little-endian.patch
 
b/debian/patches/bugfix/powerpc/ppc64el-powernv-calls-to-support-little-endian.patch
new file mode 100644
index 000..815ff98
--- /dev/null
+++ 
b/debian/patches/bugfix/powerpc/ppc64el-powernv-calls-to-support-little-endian.patch
@@ -0,0 +1,94 @@
+https://github.com/torvalds/linux/commit/5072b7ba14de2b02b1d68f85dc5e81980e1818e7
+
+From 5072b7ba14de2b02b1d68f85dc5e81980e1818e7 Mon Sep 17 00:00:00 2001
+From: Benjamin Herrenschmidt b...@kernel.crashing.org
+Date: Wed, 21 Aug 2013 14:52:31 +1000
+Subject: [PATCH] powerpc/powernv: Add calls to support little endian
+
+Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.or
+Forward-ported-by: Mauricio Faria de Oliveira mauri...@linux.vnet.ibm.com
+
+Index: linux-3.15-rc5/arch/powerpc/include/asm/opal.h
+===
+--- linux-3.15-rc5.orig/arch/powerpc/include/asm/opal.h2014-05-09 
17:10:52.0 -0300
 linux-3.15-rc5/arch/powerpc/include/asm/opal.h 2014-05-19 
15:31:37.0 -0300
+@@ -154,6 +154,7 @@
+ #define OPAL_LPC_READ 67
+ #define OPAL_LPC_WRITE68
+ #define OPAL_RETURN_CPU   69
++#define OPAL_REINIT_CPUS  70
+ #define OPAL_ELOG_READ71
+ #define OPAL_ELOG_WRITE   72
+ #define OPAL_ELOG_ACK 73
+@@ -725,6 +726,11 @@
+   uint64_t pestB[OPAL_PHB3_NUM_PEST_REGS];
+ };
+ 
++enum {
++  OPAL_REINIT_CPUS_HILE_BE= (1  0),
++  OPAL_REINIT_CPUS_HILE_LE= (1  1),
++};
++
+ typedef struct oppanel_line {
+   const char *line;
+   uint64_tline_len;
+@@ -849,6 +855,7 @@
+   uint16_t *pci_error_type, uint16_t *severity);
+ int64_t opal_pci_poll(uint64_t phb_id);
+ int64_t opal_return_cpu(void);
++int64_t opal_reinit_cpus(uint64_t flags);
+ 
+ int64_t opal_xscom_read(uint32_t gcid, uint64_t pcb_addr, __be64 *val);
+ int64_t opal_xscom_write(uint32_t gcid, uint64_t pcb_addr, uint64_t val);
+Index: linux-3.15-rc5/arch/powerpc/platforms/powernv/opal-wrappers.S
+===
+--- linux-3.15-rc5.orig/arch/powerpc/platforms/powernv/opal-wrappers.S 
2014-05-09 17:10:52.0 -0300
 linux-3.15-rc5/arch/powerpc/platforms/powernv/opal-wrappers.S  
2014-05-19 15:31:37.0 -0300
+@@ -124,6 +124,7 @@
+ OPAL_CALL(opal_lpc_read,  OPAL_LPC_READ);
+ OPAL_CALL(opal_lpc_write, OPAL_LPC_WRITE);
+ OPAL_CALL(opal_return_cpu,OPAL_RETURN_CPU);
++OPAL_CALL(opal_reinit_cpus,   OPAL_REINIT_CPUS);
+ OPAL_CALL(opal_read_elog, OPAL_ELOG_READ);
+ OPAL_CALL(opal_send_ack_elog, OPAL_ELOG_ACK);
+ OPAL_CALL(opal_get_elog_size, OPAL_ELOG_SIZE);
+Index: linux-3.15-rc5/arch/powerpc/platforms/powernv/opal.c
+===
+--- linux-3.15-rc5.orig/arch/powerpc/platforms/powernv/opal.c  2014-05-09 
17:10:52.0 -0300
 linux-3.15-rc5/arch/powerpc/platforms/powernv/opal.c   2014-05-19 
15:31:37.0 -0300
+@@ -57,6 +57,21 @@
+ static uint64_t last_notified_mask = 0x0ul;
+ static atomic_t opal_notifier_hold = ATOMIC_INIT(0);
+ 
++static void opal_reinit_cores(void)
++{
++  /* Do the actual re-init, This will clobber all FPRs, VRs, etc...
++   *
++   * It will preserve non volatile GPRs and HSPRG0/1. It will
++   * also restore HIDs and other SPRs to their original value
++   * but it might clobber a bunch.
++   */
++#ifdef __BIG_ENDIAN__
++  opal_reinit_cpus(OPAL_REINIT_CPUS_HILE_BE);
++#else
++  opal_reinit_cpus(OPAL_REINIT_CPUS_HILE_LE);
++#endif
++} 
++
+ int __init early_init_dt_scan_opal(unsigned long node,
+  const char *uname, int depth, void *data)
+ {
+@@ -96,6 +111,13 @@
+   printk(OPAL V1 detected !\n);
+   }
+ 
++  /* Reinit all cores with the right endian */
++  opal_reinit_cores();
++
++  /* Restore some bits */
++  if (cur_cpu_spec-cpu_restore)
++