All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nishanth Menon <nm@ti.com>
To: Tom Rini <trini@konsulko.com>
Cc: Robert Nelson <robertcnelson@gmail.com>, <gadiyar@ti.com>,
	Praneeth Bajjuri <praneeth@ti.com>,
	Jason Kridner <jkridner@gmail.com>, <u-boot@lists.denx.de>
Subject: Re: [PATCH 1/3] board: ti: common: Optimize boot when detecting consecutive bad records
Date: Fri, 17 Jun 2022 14:19:57 -0500	[thread overview]
Message-ID: <20220617191957.64ipzqk3mqqud5nm@parmesan> (raw)
In-Reply-To: <20220617185022.GB2484912@bill-the-cat>

On 14:50-20220617, Tom Rini wrote:
> On Fri, Jun 17, 2022 at 01:26:10PM -0500, Nishanth Menon wrote:
> 
> > The eeprom data area is much bigger than the data we intend to store,
> > however, with bad programming, we might end up reading bad records over
> > and over till we run out of eeprom space. instead just exit when 10
> > consecutive records are read.
> > 
> > Signed-off-by: Nishanth Menon <nm@ti.com>
> 
> Why not just stop at the first bad record?  Otherwise 10 seems like a

Because it could be just a couple of bad ones where the header.len
does'nt match up with record data. Some folks use a spreadsheet to
generate the records, some manually and some script it up - so,
attempting to get the best possible success chance while warning
invalid data to get people to fix things made sense.

> fine, small, arbitrary number.  If it's not arbitrary but number of
> total records, do we already enum the total number of records or
> something where we could say that we tried to read all possible records,
> everyone was bad, stop?

It is arbitrary small value - for all practical purposes, we have 6
types of records atm in u-boot, even looking ahead, we have'nt had
more than that I know of (I think display, camera and few other misc
types got added). The structure however, is by design flexible
with the END_LIST marker denoting the last record - and depending on
the eeprom size, you could theoretically have a large variation.

Considering this is attempting to recover from bad programming, the
chances are better when attempting a few more entries, but I dont
think going aggressive with a single record or conservative (as it is
right now) in scanning the entire eeprom is necessary. That leaves us
with some sort of practical number.

-- 
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D

  reply	other threads:[~2022-06-17 19:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-17 18:26 [PATCH 0/3] board: ti: common: Fixups and optimizations for eeprom handling Nishanth Menon
2022-06-17 18:26 ` [PATCH 1/3] board: ti: common: Optimize boot when detecting consecutive bad records Nishanth Menon
2022-06-17 18:50   ` Tom Rini
2022-06-17 19:19     ` Nishanth Menon [this message]
2022-06-17 20:31       ` Tom Rini
2022-07-07  1:56   ` Tom Rini
2022-06-17 18:26 ` [PATCH 2/3] board: ti: common: Handle the legacy eeprom address width properly Nishanth Menon
2022-06-18 17:04   ` Tom Rini
2022-07-07  1:56   ` Tom Rini
2022-06-17 18:26 ` [PATCH 3/3] board: ti: common: board_detect: Do 1byte address checks first Nishanth Menon
2022-06-18 17:04   ` Tom Rini
2022-07-07  1:56   ` Tom Rini

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=20220617191957.64ipzqk3mqqud5nm@parmesan \
    --to=nm@ti.com \
    --cc=gadiyar@ti.com \
    --cc=jkridner@gmail.com \
    --cc=praneeth@ti.com \
    --cc=robertcnelson@gmail.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.