linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 4/9] drivers/ps3: Remove duplicate error messages
  2020-05-09 18:58 [PATCH v2 0/9] powerpc + ps3 patches Geoff Levand
  2020-05-09 18:58 ` [PATCH v2 3/9] powerpc/head_check: Avoid broken pipe Geoff Levand
@ 2020-05-09 18:58 ` Geoff Levand
  2020-05-10 18:15   ` Markus Elfring
  2020-05-09 18:58 ` [PATCH v2 1/9] powerpc/head_check: Automatic verbosity Geoff Levand
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 21+ messages in thread
From: Geoff Levand @ 2020-05-09 18:58 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: linuxppc-dev, Geert Uytterhoeven, Markus Elfring, Emmanuel Nicolet

From: Markus Elfring <elfring@users.sourceforge.net>

Remove duplicate memory allocation failure error messages.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Geoff Levand <geoff@infradead.org>
---
 drivers/ps3/ps3-lpm.c   | 2 --
 drivers/ps3/ps3-vuart.c | 1 -
 2 files changed, 3 deletions(-)

diff --git a/drivers/ps3/ps3-lpm.c b/drivers/ps3/ps3-lpm.c
index 83c45659bc9d..fcc346296e3a 100644
--- a/drivers/ps3/ps3-lpm.c
+++ b/drivers/ps3/ps3-lpm.c
@@ -1111,8 +1111,6 @@ int ps3_lpm_open(enum ps3_lpm_tb_type tb_type, void *tb_cache,
 		lpm_priv->tb_cache_internal = kzalloc(
 			lpm_priv->tb_cache_size + 127, GFP_KERNEL);
 		if (!lpm_priv->tb_cache_internal) {
-			dev_err(sbd_core(), "%s:%u: alloc internal tb_cache "
-				"failed\n", __func__, __LINE__);
 			result = -ENOMEM;
 			goto fail_malloc;
 		}
diff --git a/drivers/ps3/ps3-vuart.c b/drivers/ps3/ps3-vuart.c
index ddaa5ea5801a..3b5878edc6c2 100644
--- a/drivers/ps3/ps3-vuart.c
+++ b/drivers/ps3/ps3-vuart.c
@@ -917,7 +917,6 @@ static int ps3_vuart_bus_interrupt_get(void)
 	vuart_bus_priv.bmp = kzalloc(sizeof(struct ports_bmp), GFP_KERNEL);
 
 	if (!vuart_bus_priv.bmp) {
-		pr_debug("%s:%d: kzalloc failed.\n", __func__, __LINE__);
 		result = -ENOMEM;
 		goto fail_bmp_malloc;
 	}
-- 
2.20.1



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

* [PATCH v2 3/9] powerpc/head_check: Avoid broken pipe
  2020-05-09 18:58 [PATCH v2 0/9] powerpc + ps3 patches Geoff Levand
@ 2020-05-09 18:58 ` Geoff Levand
  2020-05-09 18:58 ` [PATCH v2 4/9] drivers/ps3: Remove duplicate error messages Geoff Levand
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 21+ messages in thread
From: Geoff Levand @ 2020-05-09 18:58 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: linuxppc-dev, Geert Uytterhoeven, Markus Elfring, Emmanuel Nicolet

Remove the '-m4' option to grep to allow grep to process all of nm's
output.  This avoids the nm warning:

  nm terminated with signal 13 [Broken pipe]

Signed-off-by: Geoff Levand <geoff@infradead.org>
---
 arch/powerpc/tools/head_check.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/tools/head_check.sh b/arch/powerpc/tools/head_check.sh
index 37061fb9b58e..e32d3162e5ed 100644
--- a/arch/powerpc/tools/head_check.sh
+++ b/arch/powerpc/tools/head_check.sh
@@ -46,7 +46,7 @@ nm="$1"
 vmlinux="$2"
 
 # gcc-4.6-era toolchain make _stext an A (absolute) symbol rather than T
-$nm "$vmlinux" | grep -e " [TA] _stext$" -e " t start_first_256B$" -e " a text_start$" -e " t start_text$" -m4 > .tmp_symbols.txt
+$nm "$vmlinux" | grep -e " [TA] _stext$" -e " t start_first_256B$" -e " a text_start$" -e " t start_text$" > .tmp_symbols.txt
 
 
 vma=$(cat .tmp_symbols.txt | grep -e " [TA] _stext$" | cut -d' ' -f1)
-- 
2.20.1



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

* [PATCH v2 2/9] powerpc/wrapper: Output linker map file
  2020-05-09 18:58 [PATCH v2 0/9] powerpc + ps3 patches Geoff Levand
                   ` (2 preceding siblings ...)
  2020-05-09 18:58 ` [PATCH v2 1/9] powerpc/head_check: Automatic verbosity Geoff Levand
@ 2020-05-09 18:58 ` Geoff Levand
  2020-05-09 18:58 ` [PATCH v2 9/9] hvc_console: Allow backends to set I/O buffer size Geoff Levand
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 21+ messages in thread
From: Geoff Levand @ 2020-05-09 18:58 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: linuxppc-dev, Geert Uytterhoeven, Markus Elfring, Emmanuel Nicolet

To aid debugging wrapper troubles, output a linker map file
'wrapper.map' when the build is verbose.

Signed-off-by: Geoff Levand <geoff@infradead.org>
---
 arch/powerpc/boot/wrapper | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index ed6266367bc0..35ace40d9fc2 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -29,6 +29,7 @@ set -e
 # Allow for verbose output
 if [ "$V" = 1 ]; then
     set -x
+    map="-Map wrapper.map"
 fi
 
 # defaults
@@ -500,7 +501,7 @@ if [ "$platform" != "miboot" ]; then
         text_start="-Ttext $link_address"
     fi
 #link everything
-    ${CROSS}ld -m $format -T $lds $text_start $pie $nodl -o "$ofile" \
+    ${CROSS}ld -m $format -T $lds $text_start $pie $nodl -o "$ofile" $map \
 	$platformo $tmp $object/wrapper.a
     rm $tmp
 fi
-- 
2.20.1



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

* [PATCH v2 1/9] powerpc/head_check: Automatic verbosity
  2020-05-09 18:58 [PATCH v2 0/9] powerpc + ps3 patches Geoff Levand
  2020-05-09 18:58 ` [PATCH v2 3/9] powerpc/head_check: Avoid broken pipe Geoff Levand
  2020-05-09 18:58 ` [PATCH v2 4/9] drivers/ps3: Remove duplicate error messages Geoff Levand
@ 2020-05-09 18:58 ` Geoff Levand
  2020-05-09 18:58 ` [PATCH v2 2/9] powerpc/wrapper: Output linker map file Geoff Levand
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 21+ messages in thread
From: Geoff Levand @ 2020-05-09 18:58 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: linuxppc-dev, Geert Uytterhoeven, Markus Elfring, Emmanuel Nicolet

To aid debugging build problems turn on shell tracing for the
head_check script when the build is verbose.

Signed-off-by: Geoff Levand <geoff@infradead.org>
---
 arch/powerpc/tools/head_check.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/tools/head_check.sh b/arch/powerpc/tools/head_check.sh
index ad9e57209aa4..37061fb9b58e 100644
--- a/arch/powerpc/tools/head_check.sh
+++ b/arch/powerpc/tools/head_check.sh
@@ -31,8 +31,10 @@
 # level entry code (boot, interrupt vectors, etc) until r2 is set up. This
 # could cause the kernel to die in early boot.
 
-# Turn this on if you want more debug output:
-# set -x
+# Allow for verbose output
+if [ "$V" = "1" ]; then
+	set -x
+fi
 
 if [ $# -lt 2 ]; then
 	echo "$0 [path to nm] [path to vmlinux]" 1>&2
-- 
2.20.1



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

* [PATCH v2 0/9] powerpc + ps3 patches
@ 2020-05-09 18:58 Geoff Levand
  2020-05-09 18:58 ` [PATCH v2 3/9] powerpc/head_check: Avoid broken pipe Geoff Levand
                   ` (9 more replies)
  0 siblings, 10 replies; 21+ messages in thread
From: Geoff Levand @ 2020-05-09 18:58 UTC (permalink / raw)
  To: Michael Ellerman, David S. Miller, Jens Axboe
  Cc: linuxppc-dev, Geert Uytterhoeven, Markus Elfring, Emmanuel Nicolet

Hi Michael,

This is a combined V2 of the two patch sets I sent out on March 27th,
'PS3 patches for v5.7' and 'powerpc: Minor updates to improve build debugging'.

I've dropped these two patches that were in my 'PS3 patches for v5.7' set:

      powerpc/ps3: Add lv1_panic
      powerpc/ps3: Add udbg_panic

and replaced them with a new patch:

      powerpc/ps3: Fix kexec shutdown hang

There is new patch I've added in this set:

      hvc_console: Allow backends to set I/O buffer size

which I've been using in my debugging.  There is nothing using this feature in
the upstream kernel, and I don't plan to submit anything that would use it, so
use your discretion as to merge it.

-Geoff

The following changes since commit 0e698dfa282211e414076f9dc7e83c1c288314fd:

  Linux 5.7-rc4 (2020-05-03 14:56:04 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/geoff/ps3-linux.git for-merge-powerpc-v2

for you to fetch changes up to 6f6294df663a53f47bb28abcbb1ef756c6a59922:

  hvc_console: Allow backends to set I/O buffer size (2020-05-09 11:24:42 -0700)

----------------------------------------------------------------
Emmanuel Nicolet (1):
      ps3disk: use the default segment boundary

Geoff Levand (6):
      powerpc/head_check: Automatic verbosity
      powerpc/wrapper: Output linker map file
      powerpc/head_check: Avoid broken pipe
      powerpc/ps3: Add check for otheros image size
      powerpc/ps3: Fix kexec shutdown hang
      hvc_console: Allow backends to set I/O buffer size

Markus Elfring (2):
      drivers/ps3: Remove duplicate error messages
      net/ps3_gelic_net: Remove duplicate error message

 arch/powerpc/boot/wrapper                    | 20 +++++++++++++++++---
 arch/powerpc/platforms/ps3/mm.c              | 22 ++++++++++++----------
 arch/powerpc/tools/head_check.sh             |  8 +++++---
 drivers/block/ps3disk.c                      |  1 -
 drivers/net/ethernet/toshiba/ps3_gelic_net.c |  2 --
 drivers/ps3/ps3-lpm.c                        |  2 --
 drivers/ps3/ps3-vuart.c                      |  1 -
 drivers/tty/hvc/hvc_console.c                | 19 +++++++++++--------
 8 files changed, 45 insertions(+), 30 deletions(-)

-- 
2.20.1


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

* [PATCH v2 5/9] net/ps3_gelic_net: Remove duplicate error message
  2020-05-09 18:58 [PATCH v2 0/9] powerpc + ps3 patches Geoff Levand
                   ` (7 preceding siblings ...)
  2020-05-09 18:58 ` [PATCH v2 6/9] ps3disk: use the default segment boundary Geoff Levand
@ 2020-05-09 18:58 ` Geoff Levand
  2020-05-10 18:25   ` Markus Elfring
  2020-05-20 10:59 ` [PATCH v2 0/9] powerpc + ps3 patches Michael Ellerman
  9 siblings, 1 reply; 21+ messages in thread
From: Geoff Levand @ 2020-05-09 18:58 UTC (permalink / raw)
  To: Michael Ellerman, David S. Miller
  Cc: linuxppc-dev, Geert Uytterhoeven, Markus Elfring, Emmanuel Nicolet

From: Markus Elfring <elfring@users.sourceforge.net>

Remove an extra message for a memory allocation failure in
function gelic_descr_prepare_rx().

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Geoff Levand <geoff@infradead.org>
---
 drivers/net/ethernet/toshiba/ps3_gelic_net.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/toshiba/ps3_gelic_net.c b/drivers/net/ethernet/toshiba/ps3_gelic_net.c
index 070dd6fa9401..8522f3898e0d 100644
--- a/drivers/net/ethernet/toshiba/ps3_gelic_net.c
+++ b/drivers/net/ethernet/toshiba/ps3_gelic_net.c
@@ -382,8 +382,6 @@ static int gelic_descr_prepare_rx(struct gelic_card *card,
 	descr->skb = dev_alloc_skb(bufsize + GELIC_NET_RXBUF_ALIGN - 1);
 	if (!descr->skb) {
 		descr->buf_addr = 0; /* tell DMAC don't touch memory */
-		dev_info(ctodev(card),
-			 "%s:allocate skb failed !!\n", __func__);
 		return -ENOMEM;
 	}
 	descr->buf_size = cpu_to_be32(bufsize);
-- 
2.20.1



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

* [PATCH v2 6/9] ps3disk: use the default segment boundary
  2020-05-09 18:58 [PATCH v2 0/9] powerpc + ps3 patches Geoff Levand
                   ` (6 preceding siblings ...)
  2020-05-09 18:58 ` [PATCH v2 8/9] powerpc/ps3: Fix kexec shutdown hang Geoff Levand
@ 2020-05-09 18:58 ` Geoff Levand
  2020-05-09 18:58 ` [PATCH v2 5/9] net/ps3_gelic_net: Remove duplicate error message Geoff Levand
  2020-05-20 10:59 ` [PATCH v2 0/9] powerpc + ps3 patches Michael Ellerman
  9 siblings, 0 replies; 21+ messages in thread
From: Geoff Levand @ 2020-05-09 18:58 UTC (permalink / raw)
  To: Michael Ellerman, Jens Axboe
  Cc: linuxppc-dev, Geert Uytterhoeven, Markus Elfring, Emmanuel Nicolet

From: Emmanuel Nicolet <emmanuel.nicolet@gmail.com>

Hi,
since commit dcebd755926b ("block: use bio_for_each_bvec() to compute
multi-page bvec count"), the kernel will bug_on on the PS3 because
bio_split() is called with sectors == 0:

kernel BUG at block/bio.c:1853!
Oops: Exception in kernel mode, sig: 5 [#1]
BE PAGE_SIZE=4K MMU=Hash PREEMPT SMP NR_CPUS=8 NUMA PS3
Modules linked in: firewire_sbp2 rtc_ps3(+) soundcore ps3_gelic(+) \
ps3rom(+) firewire_core ps3vram(+) usb_common crc_itu_t
CPU: 0 PID: 97 Comm: blkid Not tainted 5.3.0-rc4 #1
NIP:  c00000000027d0d0 LR: c00000000027d0b0 CTR: 0000000000000000
REGS: c00000000135ae90 TRAP: 0700   Not tainted  (5.3.0-rc4)
MSR:  8000000000028032 <SF,EE,IR,DR,RI>  CR: 44008240  XER: 20000000
IRQMASK: 0
GPR00: c000000000289368 c00000000135b120 c00000000084a500 c000000004ff8300
GPR04: 0000000000000c00 c000000004c905e0 c000000004c905e0 000000000000ffff
GPR08: 0000000000000000 0000000000000001 0000000000000000 000000000000ffff
GPR12: 0000000000000000 c0000000008ef000 000000000000003e 0000000000080001
GPR16: 0000000000000100 000000000000ffff 0000000000000000 0000000000000004
GPR20: c00000000062fd7e 0000000000000001 000000000000ffff 0000000000000080
GPR24: c000000000781788 c00000000135b350 0000000000000080 c000000004c905e0
GPR28: c00000000135b348 c000000004ff8300 0000000000000000 c000000004c90000
NIP [c00000000027d0d0] .bio_split+0x28/0xac
LR [c00000000027d0b0] .bio_split+0x8/0xac
Call Trace:
[c00000000135b120] [c00000000027d130] .bio_split+0x88/0xac (unreliable)
[c00000000135b1b0] [c000000000289368] .__blk_queue_split+0x11c/0x53c
[c00000000135b2d0] [c00000000028f614] .blk_mq_make_request+0x80/0x7d4
[c00000000135b3d0] [c000000000283a8c] .generic_make_request+0x118/0x294
[c00000000135b4b0] [c000000000283d34] .submit_bio+0x12c/0x174
[c00000000135b580] [c000000000205a44] .mpage_bio_submit+0x3c/0x4c
[c00000000135b600] [c000000000206184] .mpage_readpages+0xa4/0x184
[c00000000135b750] [c0000000001ff8fc] .blkdev_readpages+0x24/0x38
[c00000000135b7c0] [c0000000001589f0] .read_pages+0x6c/0x1a8
[c00000000135b8b0] [c000000000158c74] .__do_page_cache_readahead+0x118/0x184
[c00000000135b9b0] [c0000000001591a8] .force_page_cache_readahead+0xe4/0xe8
[c00000000135ba50] [c00000000014fc24] .generic_file_read_iter+0x1d8/0x830
[c00000000135bb50] [c0000000001ffadc] .blkdev_read_iter+0x40/0x5c
[c00000000135bbc0] [c0000000001b9e00] .new_sync_read+0x144/0x1a0
[c00000000135bcd0] [c0000000001bc454] .vfs_read+0xa0/0x124
[c00000000135bd70] [c0000000001bc7a4] .ksys_read+0x70/0xd8
[c00000000135be20] [c00000000000a524] system_call+0x5c/0x70
Instruction dump:
7fe3fb78 482e30dc 7c0802a6 482e3085 7c9e2378 f821ff71 7ca42b78 7d3e00d0
7c7d1b78 79290fe0 7cc53378 69290001 <0b090000> 81230028 7bca0020 7929ba62
[ end trace 313fec760f30aa1f ]---

The problem originates from setting the segment boundary of the request
queue to -1UL. This makes get_max_segment_size() return zero when offset
is zero, whatever the max segment size. The test with BLK_SEG_BOUNDARY_MASK
fails and 'mask - (mask & offset) + 1' overflows to zero in the return
statement.

Not setting the segment boundary and using the default value
(BLK_SEG_BOUNDARY_MASK) fixes the problem.
Maybe BLK_SEG_BOUNDARY_MASK should be set to -1UL? It's currently set to
only 0xFFFFFFFFUL. I don't know if that would break anything.

Signed-off-by: Emmanuel Nicolet <emmanuel.nicolet@gmail.com>
Signed-off-by: Geoff Levand <geoff@infradead.org>
---
 drivers/block/ps3disk.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/block/ps3disk.c b/drivers/block/ps3disk.c
index c5c6487a19d5..7b55811c2a81 100644
--- a/drivers/block/ps3disk.c
+++ b/drivers/block/ps3disk.c
@@ -454,7 +454,6 @@ static int ps3disk_probe(struct ps3_system_bus_device *_dev)
 	queue->queuedata = dev;
 
 	blk_queue_max_hw_sectors(queue, dev->bounce_size >> 9);
-	blk_queue_segment_boundary(queue, -1UL);
 	blk_queue_dma_alignment(queue, dev->blk_size-1);
 	blk_queue_logical_block_size(queue, dev->blk_size);
 
-- 
2.20.1



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

* [PATCH v2 8/9] powerpc/ps3: Fix kexec shutdown hang
  2020-05-09 18:58 [PATCH v2 0/9] powerpc + ps3 patches Geoff Levand
                   ` (5 preceding siblings ...)
  2020-05-09 18:58 ` [PATCH v2 7/9] powerpc/ps3: Add check for otheros image size Geoff Levand
@ 2020-05-09 18:58 ` Geoff Levand
  2020-05-09 18:58 ` [PATCH v2 6/9] ps3disk: use the default segment boundary Geoff Levand
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 21+ messages in thread
From: Geoff Levand @ 2020-05-09 18:58 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: linuxppc-dev, Geert Uytterhoeven, Markus Elfring, Emmanuel Nicolet

The ps3_mm_region_destroy() and ps3_mm_vas_destroy() routines
are called very late in the shutdown via kexec's mmu_cleanup_all
routine.  By the time mmu_cleanup_all runs it is too late to use
udbg_printf, and calling it will cause PS3 systems to hang.

Remove all debugging statements from ps3_mm_region_destroy() and
ps3_mm_vas_destroy() and replace any error reporting with calls
to lv1_panic.

With this change builds with 'DEBUG' defined will not cause kexec
reboots to hang, and builds with 'DEBUG' defined or not will end
in lv1_panic if an error is encountered.

Signed-off-by: Geoff Levand <geoff@infradead.org>
---
 arch/powerpc/platforms/ps3/mm.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/arch/powerpc/platforms/ps3/mm.c b/arch/powerpc/platforms/ps3/mm.c
index 423be34f0f5f..f42fe4e86ce5 100644
--- a/arch/powerpc/platforms/ps3/mm.c
+++ b/arch/powerpc/platforms/ps3/mm.c
@@ -200,13 +200,14 @@ void ps3_mm_vas_destroy(void)
 {
 	int result;
 
-	DBG("%s:%d: map.vas_id    = %llu\n", __func__, __LINE__, map.vas_id);
-
 	if (map.vas_id) {
 		result = lv1_select_virtual_address_space(0);
-		BUG_ON(result);
-		result = lv1_destruct_virtual_address_space(map.vas_id);
-		BUG_ON(result);
+		result += lv1_destruct_virtual_address_space(map.vas_id);
+
+		if (result) {
+			lv1_panic(0);
+		}
+
 		map.vas_id = 0;
 	}
 }
@@ -304,19 +305,20 @@ static void ps3_mm_region_destroy(struct mem_region *r)
 	int result;
 
 	if (!r->destroy) {
-		pr_info("%s:%d: Not destroying high region: %llxh %llxh\n",
-			__func__, __LINE__, r->base, r->size);
 		return;
 	}
 
-	DBG("%s:%d: r->base = %llxh\n", __func__, __LINE__, r->base);
-
 	if (r->base) {
 		result = lv1_release_memory(r->base);
-		BUG_ON(result);
+
+		if (result) {
+			lv1_panic(0);
+		}
+
 		r->size = r->base = r->offset = 0;
 		map.total = map.rm.size;
 	}
+
 	ps3_mm_set_repository_highmem(NULL);
 }
 
-- 
2.20.1



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

* [PATCH v2 9/9] hvc_console: Allow backends to set I/O buffer size
  2020-05-09 18:58 [PATCH v2 0/9] powerpc + ps3 patches Geoff Levand
                   ` (3 preceding siblings ...)
  2020-05-09 18:58 ` [PATCH v2 2/9] powerpc/wrapper: Output linker map file Geoff Levand
@ 2020-05-09 18:58 ` Geoff Levand
  2020-05-10 19:05   ` Markus Elfring
  2020-05-10 22:50   ` [PATCH v3 " Geoff Levand
  2020-05-09 18:58 ` [PATCH v2 7/9] powerpc/ps3: Add check for otheros image size Geoff Levand
                   ` (4 subsequent siblings)
  9 siblings, 2 replies; 21+ messages in thread
From: Geoff Levand @ 2020-05-09 18:58 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: linuxppc-dev, Geert Uytterhoeven, Markus Elfring, Emmanuel Nicolet

To allow HVC backends to set the I/O buffer sizes to values
that are most efficient for the backend, change the macro
definitions where the buffer sizes are set to be conditional
on whether or not the macros are already defined.  Also,
rename the macros from N_OUTBUF to HVC_N_OUBUF and from
N_INBUF to HVC_N_INBUF.

Typical usage in the backend source file would be:

Signed-off-by: Geoff Levand <geoff@infradead.org>
---
 drivers/tty/hvc/hvc_console.c | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c
index 436cc51c92c3..2928bad057fc 100644
--- a/drivers/tty/hvc/hvc_console.c
+++ b/drivers/tty/hvc/hvc_console.c
@@ -42,12 +42,15 @@
 #define HVC_CLOSE_WAIT (HZ/100) /* 1/10 of a second */
 
 /*
- * These sizes are most efficient for vio, because they are the
- * native transfer size. We could make them selectable in the
- * future to better deal with backends that want other buffer sizes.
+ * These default sizes are most efficient for vio, because they are
+ * the native transfer size.
  */
-#define N_OUTBUF	16
-#define N_INBUF		16
+#if !defined(HVC_N_OUTBUF)
+# define HVC_N_OUTBUF	16
+#endif
+#if !defined(HVC_N_INBUF)
+# define HVC_N_INBUF	16
+#endif
 
 #define __ALIGNED__ __attribute__((__aligned__(sizeof(long))))
 
@@ -151,7 +154,7 @@ static uint32_t vtermnos[MAX_NR_HVC_CONSOLES] =
 static void hvc_console_print(struct console *co, const char *b,
 			      unsigned count)
 {
-	char c[N_OUTBUF] __ALIGNED__;
+	char c[HVC_N_OUTBUF] __ALIGNED__;
 	unsigned i = 0, n = 0;
 	int r, donecr = 0, index = co->index;
 
@@ -640,7 +643,7 @@ static int __hvc_poll(struct hvc_struct *hp, bool may_sleep)
 {
 	struct tty_struct *tty;
 	int i, n, count, poll_mask = 0;
-	char buf[N_INBUF] __ALIGNED__;
+	char buf[HVC_N_INBUF] __ALIGNED__;
 	unsigned long flags;
 	int read_total = 0;
 	int written_total = 0;
@@ -681,7 +684,7 @@ static int __hvc_poll(struct hvc_struct *hp, bool may_sleep)
 
  read_again:
 	/* Read data if any */
-	count = tty_buffer_request_room(&hp->port, N_INBUF);
+	count = tty_buffer_request_room(&hp->port, HVC_N_INBUF);
 
 	/* If flip is full, just reschedule a later read */
 	if (count == 0) {
-- 
2.20.1


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

* [PATCH v2 7/9] powerpc/ps3: Add check for otheros image size
  2020-05-09 18:58 [PATCH v2 0/9] powerpc + ps3 patches Geoff Levand
                   ` (4 preceding siblings ...)
  2020-05-09 18:58 ` [PATCH v2 9/9] hvc_console: Allow backends to set I/O buffer size Geoff Levand
@ 2020-05-09 18:58 ` Geoff Levand
  2020-05-15  2:02   ` Michael Ellerman
  2020-05-16 16:20   ` [PATCH v3 " Geoff Levand
  2020-05-09 18:58 ` [PATCH v2 8/9] powerpc/ps3: Fix kexec shutdown hang Geoff Levand
                   ` (3 subsequent siblings)
  9 siblings, 2 replies; 21+ messages in thread
From: Geoff Levand @ 2020-05-09 18:58 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: linuxppc-dev, Geert Uytterhoeven, Markus Elfring, Emmanuel Nicolet

The ps3's otheros flash loader has a size limit of 16 MiB for the
uncompressed image.  If that limit will be reached output the
flash image file as 'otheros-too-big.bld'.

Signed-off-by: Geoff Levand <geoff@infradead.org>
---
 arch/powerpc/boot/wrapper | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index 35ace40d9fc2..ab1e3ddc79f3 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -571,7 +571,20 @@ ps3)
         count=$overlay_size bs=1
 
     odir="$(dirname "$ofile.bin")"
-    rm -f "$odir/otheros.bld"
-    gzip -n --force -9 --stdout "$ofile.bin" > "$odir/otheros.bld"
+
+    # The ps3's flash loader has a size limit of 16 MiB for the uncompressed
+    # image.  If a compressed image that exceeded this limit is written to
+    # flash the loader will decompress that image until the 16 MiB limit is
+    # reached, then enter the system reset vector of the partially decompressed
+    # image.  No warning is issued.
+    rm -f "$odir"/{otheros,otheros-too-big}.bld
+    size=$(${CROSS}nm --no-sort --radix=d "$ofile" | egrep ' _end$' | cut -d' ' -f1)
+    bld="otheros.bld"
+    if [ $size -gt $((0x1000000)) ]; then
+        bld="otheros-too-big.bld"
+        echo "  INFO: Uncompressed kernel is too large to program into PS3 flash memory;" \
+        "size=0x$(printf "%x\n" $size), limit=0x1000000."
+    fi
+    gzip -n --force -9 --stdout "$ofile.bin" > "$odir/$bld"
     ;;
 esac
-- 
2.20.1



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

* Re: [PATCH v2 4/9] drivers/ps3: Remove duplicate error messages
  2020-05-09 18:58 ` [PATCH v2 4/9] drivers/ps3: Remove duplicate error messages Geoff Levand
@ 2020-05-10 18:15   ` Markus Elfring
  0 siblings, 0 replies; 21+ messages in thread
From: Markus Elfring @ 2020-05-10 18:15 UTC (permalink / raw)
  To: Geoff Levand, Michael Ellerman, linuxppc-dev
  Cc: Geert Uytterhoeven, Emmanuel Nicolet

> Remove duplicate memory allocation failure error messages.

Will another background information be relevant for the final commit message?

ps3: Delete an error message for a failed memory allocation in two functions
https://lore.kernel.org/linuxppc-dev/58807b28-b2b9-7e77-11b8-21db43c9d5ba@users.sourceforge.net/
https://lore.kernel.org/patchwork/patch/864037/
https://lkml.org/lkml/2017/12/16/107

Regards,
Markus

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

* Re: [PATCH v2 5/9] net/ps3_gelic_net: Remove duplicate error message
  2020-05-09 18:58 ` [PATCH v2 5/9] net/ps3_gelic_net: Remove duplicate error message Geoff Levand
@ 2020-05-10 18:25   ` Markus Elfring
  0 siblings, 0 replies; 21+ messages in thread
From: Markus Elfring @ 2020-05-10 18:25 UTC (permalink / raw)
  To: Geoff Levand, Michael Ellerman, David S. Miller, linuxppc-dev
  Cc: Geert Uytterhoeven, Emmanuel Nicolet

> Remove an extra message for a memory allocation failure in
> function gelic_descr_prepare_rx().

Will another background information be relevant for the final commit message?

ps3_gelic_net: Delete an error message for a failed memory allocation in gelic_descr_prepare_rx()
https://lore.kernel.org/linuxppc-dev/9613bfbf-11cc-1e66-484a-84fcda022861@users.sourceforge.net/
https://lore.kernel.org/patchwork/patch/869518/
https://lkml.org/lkml/2018/1/3/365

Regards,
Markus

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

* Re: [PATCH v2 9/9] hvc_console: Allow backends to set I/O buffer size
  2020-05-09 18:58 ` [PATCH v2 9/9] hvc_console: Allow backends to set I/O buffer size Geoff Levand
@ 2020-05-10 19:05   ` Markus Elfring
  2020-05-10 22:50   ` [PATCH v3 " Geoff Levand
  1 sibling, 0 replies; 21+ messages in thread
From: Markus Elfring @ 2020-05-10 19:05 UTC (permalink / raw)
  To: Geoff Levand, Michael Ellerman, linuxppc-dev
  Cc: Geert Uytterhoeven, Emmanuel Nicolet

> Typical usage in the backend source file would be:

Is there any information missing in this change description accidentally?

Regards,
Markus

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

* Re: [PATCH v3 9/9] hvc_console: Allow backends to set I/O buffer size
  2020-05-09 18:58 ` [PATCH v2 9/9] hvc_console: Allow backends to set I/O buffer size Geoff Levand
  2020-05-10 19:05   ` Markus Elfring
@ 2020-05-10 22:50   ` Geoff Levand
  1 sibling, 0 replies; 21+ messages in thread
From: Geoff Levand @ 2020-05-10 22:50 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: linuxppc-dev, Geert Uytterhoeven, Markus Elfring, Emmanuel Nicolet

To allow HVC backends to set the I/O buffer sizes to values
that are most efficient for the backend, change the macro
definitions where the buffer sizes are set to be conditional
on whether or not the macros are already defined.  Also,
rename the macros from N_OUTBUF to HVC_N_OUBUF and from
N_INBUF to HVC_N_INBUF.

Typical usage in the backend source file would be:

 #define HVC_N_OUTBUF 32
 #define HVC_N_INBUF 32
 #include "hvc_console.h"

Signed-off-by: Geoff Levand <geoff@infradead.org>
---
 drivers/tty/hvc/hvc_console.c | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c
index 436cc51c92c3..2928bad057fc 100644
--- a/drivers/tty/hvc/hvc_console.c
+++ b/drivers/tty/hvc/hvc_console.c
@@ -42,12 +42,15 @@
 #define HVC_CLOSE_WAIT (HZ/100) /* 1/10 of a second */
 
 /*
- * These sizes are most efficient for vio, because they are the
- * native transfer size. We could make them selectable in the
- * future to better deal with backends that want other buffer sizes.
+ * These default sizes are most efficient for vio, because they are
+ * the native transfer size.
  */
-#define N_OUTBUF	16
-#define N_INBUF		16
+#if !defined(HVC_N_OUTBUF)
+# define HVC_N_OUTBUF	16
+#endif
+#if !defined(HVC_N_INBUF)
+# define HVC_N_INBUF	16
+#endif
 
 #define __ALIGNED__ __attribute__((__aligned__(sizeof(long))))
 
@@ -151,7 +154,7 @@ static uint32_t vtermnos[MAX_NR_HVC_CONSOLES] =
 static void hvc_console_print(struct console *co, const char *b,
 			      unsigned count)
 {
-	char c[N_OUTBUF] __ALIGNED__;
+	char c[HVC_N_OUTBUF] __ALIGNED__;
 	unsigned i = 0, n = 0;
 	int r, donecr = 0, index = co->index;
 
@@ -640,7 +643,7 @@ static int __hvc_poll(struct hvc_struct *hp, bool may_sleep)
 {
 	struct tty_struct *tty;
 	int i, n, count, poll_mask = 0;
-	char buf[N_INBUF] __ALIGNED__;
+	char buf[HVC_N_INBUF] __ALIGNED__;
 	unsigned long flags;
 	int read_total = 0;
 	int written_total = 0;
@@ -681,7 +684,7 @@ static int __hvc_poll(struct hvc_struct *hp, bool may_sleep)
 
  read_again:
 	/* Read data if any */
-	count = tty_buffer_request_room(&hp->port, N_INBUF);
+	count = tty_buffer_request_room(&hp->port, HVC_N_INBUF);
 
 	/* If flip is full, just reschedule a later read */
 	if (count == 0) {
-- 
2.20.1


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

* Re: [PATCH v2 7/9] powerpc/ps3: Add check for otheros image size
  2020-05-09 18:58 ` [PATCH v2 7/9] powerpc/ps3: Add check for otheros image size Geoff Levand
@ 2020-05-15  2:02   ` Michael Ellerman
  2020-05-16 16:03     ` Geoff Levand
  2020-05-16 16:20   ` [PATCH v3 " Geoff Levand
  1 sibling, 1 reply; 21+ messages in thread
From: Michael Ellerman @ 2020-05-15  2:02 UTC (permalink / raw)
  To: Geoff Levand
  Cc: linuxppc-dev, Geert Uytterhoeven, Markus Elfring, Emmanuel Nicolet

Hi Geoff,

Geoff Levand <geoff@infradead.org> writes:
> The ps3's otheros flash loader has a size limit of 16 MiB for the
> uncompressed image.  If that limit will be reached output the
> flash image file as 'otheros-too-big.bld'.
>
> Signed-off-by: Geoff Levand <geoff@infradead.org>
> ---
>  arch/powerpc/boot/wrapper | 17 +++++++++++++++--
>  1 file changed, 15 insertions(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
> index 35ace40d9fc2..ab1e3ddc79f3 100755
> --- a/arch/powerpc/boot/wrapper
> +++ b/arch/powerpc/boot/wrapper
> @@ -571,7 +571,20 @@ ps3)
>          count=$overlay_size bs=1
>  
>      odir="$(dirname "$ofile.bin")"
> -    rm -f "$odir/otheros.bld"
> -    gzip -n --force -9 --stdout "$ofile.bin" > "$odir/otheros.bld"
> +
> +    # The ps3's flash loader has a size limit of 16 MiB for the uncompressed
> +    # image.  If a compressed image that exceeded this limit is written to
> +    # flash the loader will decompress that image until the 16 MiB limit is
> +    # reached, then enter the system reset vector of the partially decompressed
> +    # image.  No warning is issued.
> +    rm -f "$odir"/{otheros,otheros-too-big}.bld
> +    size=$(${CROSS}nm --no-sort --radix=d "$ofile" | egrep ' _end$' | cut -d' ' -f1)
> +    bld="otheros.bld"
> +    if [ $size -gt $((0x1000000)) ]; then
> +        bld="otheros-too-big.bld"
> +        echo "  INFO: Uncompressed kernel is too large to program into PS3 flash memory;" \

This now appears on all my ppc64_defconfig builds, which I don't really
like.

That does highlight the fact that ppc64_defconfig including
CONFIG_PPC_PS3 is not really helpful for people actually wanting to run
the kernel on a PS3.

So I wonder if we should drop CONFIG_PPC_PS3 from ppc64_defconfig, in
which case I'd be happy to keep the INFO message because it should only
appear on ps3 specific builds.

The other option would be to drop the message, or only print it when
we're doing a verbose build.

Thoughts?

cheers

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

* Re: [PATCH v2 7/9] powerpc/ps3: Add check for otheros image size
  2020-05-15  2:02   ` Michael Ellerman
@ 2020-05-16 16:03     ` Geoff Levand
  2020-05-18  6:31       ` Michael Ellerman
  0 siblings, 1 reply; 21+ messages in thread
From: Geoff Levand @ 2020-05-16 16:03 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: linuxppc-dev, Geert Uytterhoeven, Markus Elfring, Emmanuel Nicolet

Hi Michael,

On 5/14/20 7:02 PM, Michael Ellerman wrote:
> Geoff Levand <geoff@infradead.org> writes:
...
>> +    # The ps3's flash loader has a size limit of 16 MiB for the uncompressed
>> +    # image.  If a compressed image that exceeded this limit is written to
>> +    # flash the loader will decompress that image until the 16 MiB limit is
>> +    # reached, then enter the system reset vector of the partially decompressed
>> +    # image.  No warning is issued.
>> +    rm -f "$odir"/{otheros,otheros-too-big}.bld
>> +    size=$(${CROSS}nm --no-sort --radix=d "$ofile" | egrep ' _end$' | cut -d' ' -f1)
>> +    bld="otheros.bld"
>> +    if [ $size -gt $((0x1000000)) ]; then
>> +        bld="otheros-too-big.bld"
>> +        echo "  INFO: Uncompressed kernel is too large to program into PS3 flash memory;" \
> 
> This now appears on all my ppc64_defconfig builds, which I don't really
> like.

No, neither do I.  I didn't think of that case.

> That does highlight the fact that ppc64_defconfig including
> CONFIG_PPC_PS3 is not really helpful for people actually wanting to run
> the kernel on a PS3.

No, this is just for the bootloader image (.bld) that can be
programed into flash memory.  This is what is used to create,
for example, a petitboot bootloader image.

Normal usage is for the bootloader in flash to load a vmlinux
image from disk or network, in which case running a ppc64_defconfig
image would be fine.

> So I wonder if we should drop CONFIG_PPC_PS3 from ppc64_defconfig, in
> which case I'd be happy to keep the INFO message because it should only
> appear on ps3 specific builds.

I'd like to keep CONFIG_PPC_PS3 set in ppc64_defconfig.  I feel it
useful to get some build testing of the PS3 platform code.

> The other option would be to drop the message, or only print it when
> we're doing a verbose build.

Building a boatloader image to program into flash memory is
something only very advanced users would be doing.  I don't
think they would need this message.  They would see the file
name and understand the situation.  I'll post a v3 patch that
removes the message.

-Geoff 

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

* [PATCH v3 7/9] powerpc/ps3: Add check for otheros image size
  2020-05-09 18:58 ` [PATCH v2 7/9] powerpc/ps3: Add check for otheros image size Geoff Levand
  2020-05-15  2:02   ` Michael Ellerman
@ 2020-05-16 16:20   ` Geoff Levand
  2020-06-09  5:56     ` Michael Ellerman
  1 sibling, 1 reply; 21+ messages in thread
From: Geoff Levand @ 2020-05-16 16:20 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: linuxppc-dev, Geert Uytterhoeven, Markus Elfring, Emmanuel Nicolet

The ps3's otheros flash loader has a size limit of 16 MiB for the
uncompressed image.  If that limit will be reached output the
flash image file as 'otheros-too-big.bld'.

Signed-off-by: Geoff Levand <geoff@infradead.org>
---
v2: Change from decimal to hex values. Output an INFO message to screen.
v3: Remove the INFO message.

 arch/powerpc/boot/wrapper | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index 35ace40d9fc2..d0b5f202c49c 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -571,7 +571,18 @@ ps3)
         count=$overlay_size bs=1
 
     odir="$(dirname "$ofile.bin")"
-    rm -f "$odir/otheros.bld"
-    gzip -n --force -9 --stdout "$ofile.bin" > "$odir/otheros.bld"
+
+    # The ps3's flash loader has a size limit of 16 MiB for the uncompressed
+    # image.  If a compressed image that exceeded this limit is written to
+    # flash the loader will decompress that image until the 16 MiB limit is
+    # reached, then enter the system reset vector of the partially decompressed
+    # image.  No warning is issued.
+    rm -f "$odir"/{otheros,otheros-too-big}.bld
+    size=$(${CROSS}nm --no-sort --radix=d "$ofile" | egrep ' _end$' | cut -d' ' -f1)
+    bld="otheros.bld"
+    if [ $size -gt $((0x1000000)) ]; then
+        bld="otheros-too-big.bld"
+    fi
+    gzip -n --force -9 --stdout "$ofile.bin" > "$odir/$bld"
     ;;
 esac
-- 
2.20.1


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

* Re: [PATCH v2 7/9] powerpc/ps3: Add check for otheros image size
  2020-05-16 16:03     ` Geoff Levand
@ 2020-05-18  6:31       ` Michael Ellerman
  0 siblings, 0 replies; 21+ messages in thread
From: Michael Ellerman @ 2020-05-18  6:31 UTC (permalink / raw)
  To: Geoff Levand
  Cc: linuxppc-dev, Geert Uytterhoeven, Markus Elfring, Emmanuel Nicolet

Geoff Levand <geoff@infradead.org> writes:
> Hi Michael,
>
> On 5/14/20 7:02 PM, Michael Ellerman wrote:
>> Geoff Levand <geoff@infradead.org> writes:
> ...
>>> +    # The ps3's flash loader has a size limit of 16 MiB for the uncompressed
>>> +    # image.  If a compressed image that exceeded this limit is written to
>>> +    # flash the loader will decompress that image until the 16 MiB limit is
>>> +    # reached, then enter the system reset vector of the partially decompressed
>>> +    # image.  No warning is issued.
>>> +    rm -f "$odir"/{otheros,otheros-too-big}.bld
>>> +    size=$(${CROSS}nm --no-sort --radix=d "$ofile" | egrep ' _end$' | cut -d' ' -f1)
>>> +    bld="otheros.bld"
>>> +    if [ $size -gt $((0x1000000)) ]; then
>>> +        bld="otheros-too-big.bld"
>>> +        echo "  INFO: Uncompressed kernel is too large to program into PS3 flash memory;" \
>> 
>> This now appears on all my ppc64_defconfig builds, which I don't really
>> like.
>
> No, neither do I.  I didn't think of that case.
>
>> That does highlight the fact that ppc64_defconfig including
>> CONFIG_PPC_PS3 is not really helpful for people actually wanting to run
>> the kernel on a PS3.
>
> No, this is just for the bootloader image (.bld) that can be
> programed into flash memory.  This is what is used to create,
> for example, a petitboot bootloader image.
>
> Normal usage is for the bootloader in flash to load a vmlinux
> image from disk or network, in which case running a ppc64_defconfig
> image would be fine.

Ah yep, that rings a bell.

>> So I wonder if we should drop CONFIG_PPC_PS3 from ppc64_defconfig, in
>> which case I'd be happy to keep the INFO message because it should only
>> appear on ps3 specific builds.
>
> I'd like to keep CONFIG_PPC_PS3 set in ppc64_defconfig.  I feel it
> useful to get some build testing of the PS3 platform code.
>
>> The other option would be to drop the message, or only print it when
>> we're doing a verbose build.
>
> Building a boatloader image to program into flash memory is
> something only very advanced users would be doing.  I don't
> think they would need this message.  They would see the file
> name and understand the situation.  I'll post a v3 patch that
> removes the message.

Great, thanks.

cheers

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

* Re: [PATCH v2 0/9] powerpc + ps3 patches
  2020-05-09 18:58 [PATCH v2 0/9] powerpc + ps3 patches Geoff Levand
                   ` (8 preceding siblings ...)
  2020-05-09 18:58 ` [PATCH v2 5/9] net/ps3_gelic_net: Remove duplicate error message Geoff Levand
@ 2020-05-20 10:59 ` Michael Ellerman
  9 siblings, 0 replies; 21+ messages in thread
From: Michael Ellerman @ 2020-05-20 10:59 UTC (permalink / raw)
  To: Michael Ellerman, Jens Axboe, Geoff Levand, David S. Miller
  Cc: Geert Uytterhoeven, linuxppc-dev, Markus Elfring, Emmanuel Nicolet

On Sat, 09 May 2020 18:58:31 +0000, Geoff Levand wrote:
> This is a combined V2 of the two patch sets I sent out on March 27th,
> 'PS3 patches for v5.7' and 'powerpc: Minor updates to improve build debugging'.
> 
> I've dropped these two patches that were in my 'PS3 patches for v5.7' set:
> 
>       powerpc/ps3: Add lv1_panic
>       powerpc/ps3: Add udbg_panic
> 
> [...]

Patches 1-6 and 8 applied to powerpc/next.

[1/9] powerpc/head_check: Automatic verbosity
      https://git.kernel.org/powerpc/c/4c592a34391ea4987d29c1718f931b50416ca015
[2/9] powerpc/wrapper: Output linker map file
      https://git.kernel.org/powerpc/c/f61200d3e3386e78d49677dfb3911c9d7c0dfe4b
[3/9] powerpc/head_check: Avoid broken pipe
      https://git.kernel.org/powerpc/c/331aa46aaf51325d8532a4948f5127b2edc441a5
[4/9] drivers/ps3: Remove duplicate error messages
      https://git.kernel.org/powerpc/c/6a8aa782cece2330322c33452a767f53f8ba38c9
[5/9] net/ps3_gelic_net: Remove duplicate error message
      https://git.kernel.org/powerpc/c/7b27b95a894d6a85c076f8d1f00e35316739bf51
[6/9] ps3disk: use the default segment boundary
      https://git.kernel.org/powerpc/c/720bc316690bd27dea9d71510b50f0cd698ffc32
[8/9] powerpc/ps3: Fix kexec shutdown hang
      https://git.kernel.org/powerpc/c/126554465d93b10662742128918a5fc338cda4aa

cheers

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

* Re: [PATCH v3 7/9] powerpc/ps3: Add check for otheros image size
  2020-05-16 16:20   ` [PATCH v3 " Geoff Levand
@ 2020-06-09  5:56     ` Michael Ellerman
  0 siblings, 0 replies; 21+ messages in thread
From: Michael Ellerman @ 2020-06-09  5:56 UTC (permalink / raw)
  To: Geoff Levand
  Cc: Geert Uytterhoeven, linuxppc-dev, Markus Elfring, Emmanuel Nicolet

On Sat, 2020-05-16 at 16:20:46 UTC, Geoff Levand wrote:
> The ps3's otheros flash loader has a size limit of 16 MiB for the
> uncompressed image.  If that limit will be reached output the
> flash image file as 'otheros-too-big.bld'.
> 
> Signed-off-by: Geoff Levand <geoff@infradead.org>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/aa3bc365ee73765af5059678bf55b0f3e4a3e6c4

cheers

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

* [PATCH V2 7/9] powerpc/ps3: Add check for otheros image size
  2020-03-27 20:26 ` [PATCH 7/9] powerpc/ps3: Add check for otheros image size Geoff Levand
@ 2020-03-30  3:11   ` Geoff Levand
  0 siblings, 0 replies; 21+ messages in thread
From: Geoff Levand @ 2020-03-30  3:11 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: linuxppc-dev, Geert Uytterhoeven, Markus Elfring, Dan Carpenter,
	Emmanuel Nicolet

The ps3's otheros flash loader has a size limit of 16 MiB for the
uncompressed image.  If that limit will be reached output the
flash image file as 'otheros-too-big.bld'.

Signed-off-by: Geoff Levand <geoff@infradead.org>
---
 arch/powerpc/boot/wrapper | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index 35ace40d9fc2..ab1e3ddc79f3 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -571,7 +571,20 @@ ps3)
         count=$overlay_size bs=1
 
     odir="$(dirname "$ofile.bin")"
-    rm -f "$odir/otheros.bld"
-    gzip -n --force -9 --stdout "$ofile.bin" > "$odir/otheros.bld"
+
+    # The ps3's flash loader has a size limit of 16 MiB for the uncompressed
+    # image.  If a compressed image that exceeded this limit is written to
+    # flash the loader will decompress that image until the 16 MiB limit is
+    # reached, then enter the system reset vector of the partially decompressed
+    # image.  No warning is issued.
+    rm -f "$odir"/{otheros,otheros-too-big}.bld
+    size=$(${CROSS}nm --no-sort --radix=d "$ofile" | egrep ' _end$' | cut -d' ' -f1)
+    bld="otheros.bld"
+    if [ $size -gt $((0x1000000)) ]; then
+        bld="otheros-too-big.bld"
+        echo "  INFO: Uncompressed kernel is too large to program into PS3 flash memory;" \
+        "size=0x$(printf "%x\n" $size), limit=0x1000000."
+    fi
+    gzip -n --force -9 --stdout "$ofile.bin" > "$odir/$bld"
     ;;
 esac
-- 
2.20.1


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

end of thread, other threads:[~2020-06-09  7:02 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-09 18:58 [PATCH v2 0/9] powerpc + ps3 patches Geoff Levand
2020-05-09 18:58 ` [PATCH v2 3/9] powerpc/head_check: Avoid broken pipe Geoff Levand
2020-05-09 18:58 ` [PATCH v2 4/9] drivers/ps3: Remove duplicate error messages Geoff Levand
2020-05-10 18:15   ` Markus Elfring
2020-05-09 18:58 ` [PATCH v2 1/9] powerpc/head_check: Automatic verbosity Geoff Levand
2020-05-09 18:58 ` [PATCH v2 2/9] powerpc/wrapper: Output linker map file Geoff Levand
2020-05-09 18:58 ` [PATCH v2 9/9] hvc_console: Allow backends to set I/O buffer size Geoff Levand
2020-05-10 19:05   ` Markus Elfring
2020-05-10 22:50   ` [PATCH v3 " Geoff Levand
2020-05-09 18:58 ` [PATCH v2 7/9] powerpc/ps3: Add check for otheros image size Geoff Levand
2020-05-15  2:02   ` Michael Ellerman
2020-05-16 16:03     ` Geoff Levand
2020-05-18  6:31       ` Michael Ellerman
2020-05-16 16:20   ` [PATCH v3 " Geoff Levand
2020-06-09  5:56     ` Michael Ellerman
2020-05-09 18:58 ` [PATCH v2 8/9] powerpc/ps3: Fix kexec shutdown hang Geoff Levand
2020-05-09 18:58 ` [PATCH v2 6/9] ps3disk: use the default segment boundary Geoff Levand
2020-05-09 18:58 ` [PATCH v2 5/9] net/ps3_gelic_net: Remove duplicate error message Geoff Levand
2020-05-10 18:25   ` Markus Elfring
2020-05-20 10:59 ` [PATCH v2 0/9] powerpc + ps3 patches Michael Ellerman
  -- strict thread matches above, loose matches on Subject: below --
2020-03-27 20:26 [PATCH 0/9] PS3 patches for v5.7 Geoff Levand
2020-03-27 20:26 ` [PATCH 7/9] powerpc/ps3: Add check for otheros image size Geoff Levand
2020-03-30  3:11   ` [PATCH V2 " Geoff Levand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).