Re: [PATCH] loads: Block writes into LMB reserved areas of U-Boot

2021-10-26 Thread Tom Rini
On Sun, Oct 10, 2021 at 11:52:41PM +0200, marek.va...@gmail.com wrote: > From: Marek Vasut > > The loads srec loading may overwrite piece of U-Boot accidentally. > Prevent that by using LMB to detect whether upcoming write would > overwrite piece of reserved U-Boot code, and if that is the

Re: [PATCH] loads: Block writes into LMB reserved areas of U-Boot

2021-10-15 Thread Marek Vasut
On 10/15/21 6:09 PM, Tom Rini wrote: [...] This code looks OK but I don't know what lmb_reserve() and lmb_free() do. Can you add comments to the header file? Not here, the entire LMB stuff needs (better) documentation, that's where (all) such clarification should go. Is that you saying

Re: [PATCH] loads: Block writes into LMB reserved areas of U-Boot

2021-10-15 Thread Tom Rini
On Fri, Oct 15, 2021 at 04:23:27PM +0200, Marek Vasut wrote: > On 10/14/21 5:10 PM, Simon Glass wrote: > [...] > > > @@ -137,6 +138,7 @@ static int do_load_serial(struct cmd_tbl *cmdtp, int > > > flag, int argc, > > > > > > static ulong load_serial(long offset) > > > { > > > + struct

Re: [PATCH] loads: Block writes into LMB reserved areas of U-Boot

2021-10-15 Thread Marek Vasut
On 10/14/21 5:10 PM, Simon Glass wrote: [...] @@ -137,6 +138,7 @@ static int do_load_serial(struct cmd_tbl *cmdtp, int flag, int argc, static ulong load_serial(long offset) { + struct lmb lmb; charrecord[SREC_MAXRECLEN + 1]; /* buffer for one S-Record */

Re: [PATCH] loads: Block writes into LMB reserved areas of U-Boot

2021-10-14 Thread Simon Glass
Hi Marek, On Sun, 10 Oct 2021 at 15:52, wrote: > > From: Marek Vasut > > The loads srec loading may overwrite piece of U-Boot accidentally. > Prevent that by using LMB to detect whether upcoming write would > overwrite piece of reserved U-Boot code, and if that is the case, > abort the srec

[PATCH] loads: Block writes into LMB reserved areas of U-Boot

2021-10-10 Thread marek . vasut
From: Marek Vasut The loads srec loading may overwrite piece of U-Boot accidentally. Prevent that by using LMB to detect whether upcoming write would overwrite piece of reserved U-Boot code, and if that is the case, abort the srec loading. Signed-off-by: Marek Vasut Cc: Simon Glass Cc: Tom