public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Josua Mayer <josua@solid-run.com>
To: Simon Glass <sjg@chromium.org>
Cc: u-boot@lists.denx.de, Stefan Roese <sr@denx.de>,
	Baruch Siach <baruch@tkos.co.il>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>
Subject: Re: [[PATCH v2] 4/4] cmd: tlv_eeprom: enable 'dev' subcommand before 'read'
Date: Sat, 13 May 2023 11:39:29 +0300	[thread overview]
Message-ID: <2947525b-d5a4-fea8-fdc8-5ee701bd45f6@solid-run.com> (raw)
In-Reply-To: <CAPnjgZ08mAVVpOUH00pBbvBSKXprdg_B5PJ6uRrpM6RE8gkQBA@mail.gmail.com>

Hi Simon,

I have a private rewrite of the tlv functionality as a seperate library 
outside of the command implementation.
Originally I had hoped to finish upstreaming that about a year ago but 
got sidetracked.

Hopefully within the coming weeks I can submit another version as RFC 
that can address your concerns more easily than the current eeprom_tlv 
implementation.

Sincerely
Josua Mayer

Am 08.05.23 um 17:42 schrieb Simon Glass:
> Hi,
>
> On Fri, 5 May 2023 at 02:22, Josua Mayer <josua@solid-run.com> wrote:
>> Move the handler for "tlv_eeprom dev X" command to the beginning of
>> do_tlv_eeprom, to allow using it before issuing a "read" command for
>> currently selected eeprom.
>>
>> Also remove the check if eeprom exists, since that can only work after
>> the first execution of read_eeprom triggered device lookup.
>> Instead accept values up to the defined array size (MAX_TLV_DEVICES).
>>
>> Signed-off-by: Josua Mayer <josua@solid-run.com>
>> Reviewed-by: Stefan Roese <sr@denx.de>
>> Cc: Stefan Roese <sr@denx.de>
>> Cc: Baruch Siach <baruch@tkos.co.il>
>> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
>> ---
>>   cmd/tlv_eeprom.c | 26 ++++++++++++++++----------
>>   1 file changed, 16 insertions(+), 10 deletions(-)
> Can someone take a look at fixing up the driver model code?
>
> For example:
> - it maintains its own array of eproms, when it should use driver
> model to find them.
> - the has_been_read flag seems to track only one EEPROM, but the code
> indicates there might be two (should be in the device's private data)
> - current_dev should be a pointer to a device
> - ideally all state should be either in the device or the uclass, so
> it can be used before relocation, etc.
>
> Regards,
> Simon

      reply	other threads:[~2023-05-13  8:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-05  8:20 [[PATCH v2] 0/4] cmd: tlv_eeprom: global variables and error cleanup Josua Mayer
2023-05-05  8:20 ` [[PATCH v2] 1/4] cmd: tlv_eeprom: remove use of global variable current_dev Josua Mayer
2023-05-08  8:48   ` Stefan Roese
2023-05-05  8:20 ` [[PATCH v2] 2/4] cmd: tlv_eeprom: remove use of global variable has_been_read Josua Mayer
2023-05-05  8:20 ` [[PATCH v2] 3/4] cmd: tlv_eeprom: handle -ENODEV error from read_eeprom function Josua Mayer
2023-05-05  8:20 ` [[PATCH v2] 4/4] cmd: tlv_eeprom: enable 'dev' subcommand before 'read' Josua Mayer
2023-05-08 14:42   ` Simon Glass
2023-05-13  8:39     ` Josua Mayer [this message]

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=2947525b-d5a4-fea8-fdc8-5ee701bd45f6@solid-run.com \
    --to=josua@solid-run.com \
    --cc=baruch@tkos.co.il \
    --cc=sjg@chromium.org \
    --cc=sr@denx.de \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox