linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Geoff Levand <geoff@infradead.org>
Cc: linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	Markus Elfring <elfring@users.sourceforge.net>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Emmanuel Nicolet <emmanuel.nicolet@gmail.com>
Subject: Re: [PATCH 7/9] powerpc/ps3: Add check for otheros image size
Date: Sun, 29 Mar 2020 16:00:20 +0200	[thread overview]
Message-ID: <CAMuHMdU1qLs1u3JuJM+r4jV0gGQuq4B11gbSDsX6JHUBFQAX3w@mail.gmail.com> (raw)
In-Reply-To: <e0dc92ba82a993c845f8d2bf3ace7465ef5ea996.1585340156.git.geoff@infradead.org>

Hi Geoff,

On Fri, Mar 27, 2020 at 9:26 PM Geoff Levand <geoff@infradead.org> 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>

Thanks for your patch!

> --- a/arch/powerpc/boot/wrapper
> +++ b/arch/powerpc/boot/wrapper
> @@ -570,7 +570,16 @@ 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"
> +    [ $size -le 16777216 ] || bld="otheros-too-big.bld"
> +    gzip -n --force -9 --stdout "$ofile.bin" > "$odir/$bld"
>      ;;
>  esac

Why not print an error message and exit 1 instead, like is done for
other fatal errors?

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  reply	other threads:[~2020-03-29 14:02 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-27 20:26 [PATCH 0/9] PS3 patches for v5.7 Geoff Levand
2020-03-27 20:26 ` [PATCH 5/9] ps3disk: use the default segment boundary Geoff Levand
2020-03-27 20:26 ` [PATCH 9/9] powerpc/ps3: Add udbg_panic Geoff Levand
2020-03-27 20:26 ` [PATCH 6/9] powerpc/ps3: Set CONFIG_UEVENT_HELPER=y in ps3_defconfig Geoff Levand
2020-04-06 13:05   ` Michael Ellerman
2020-03-27 20:26 ` [PATCH 8/9] powerpc/ps3: Add lv1_panic Geoff Levand
2020-03-27 20:26 ` [PATCH 7/9] powerpc/ps3: Add check for otheros image size Geoff Levand
2020-03-29 14:00   ` Geert Uytterhoeven [this message]
2020-03-30  3:10     ` Geoff Levand
2020-03-30  3:11   ` [PATCH V2 " Geoff Levand
2020-03-27 20:26 ` [PATCH 4/9] powerpc/ps3: remove an unneeded NULL check Geoff Levand
2020-04-06 13:05   ` Michael Ellerman
2020-03-27 20:26 ` [PATCH 1/9] powerpc/ps3: Remove duplicate error messages Geoff Levand
2020-03-28 17:09   ` Markus Elfring
2020-04-06 13:05   ` Michael Ellerman
2020-03-27 20:26 ` [PATCH 3/9] net/ps3_gelic_net: Remove duplicate error message Geoff Levand
2020-03-27 20:26 ` [PATCH 2/9] drivers/ps3: Remove duplicate error messages Geoff Levand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMuHMdU1qLs1u3JuJM+r4jV0gGQuq4B11gbSDsX6JHUBFQAX3w@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=dan.carpenter@oracle.com \
    --cc=elfring@users.sourceforge.net \
    --cc=emmanuel.nicolet@gmail.com \
    --cc=geoff@infradead.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).