All of lore.kernel.org
 help / color / mirror / Atom feed
* problems with boards with CONFIG_DM disabled
@ 2021-05-25 23:27 Marek Behun
  2021-05-26  0:25 ` Marek Behun
  0 siblings, 1 reply; 4+ messages in thread
From: Marek Behun @ 2021-05-25 23:27 UTC (permalink / raw)
  To: Tom Rini, Simon Glass; +Cc: u-boot

Tom, Simon,

now that LTO is merged I am working on
  Support SPI NORs and OF partitions in `mtd list`

but CI fails for some boards, see
https://github.com/u-boot/u-boot/pull/55

The reason is that there are still several boards which do not use
CONFIG_DM.

On the previous version Simon commented that I should use
  if (IS_ENABLED(...))
instead of
  #if
but this does not currently work for those boards with CONFIG_DM
disabled (struct udevice's members are not visible at all, and
functions from dm/device.h do not exist).

There are multiple possible workarounds:
- use #if (until all boards are at CONFIG_DM)
- create static inline versions of functions from dm/device.h returning
  failures when CONFIG_DM is not set (this would be rather big :( )
- wait till all those boards with CONFIG_DM disabled are removed
- ...

What should I do?

Thanks,

Marek

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

* Re: problems with boards with CONFIG_DM disabled
  2021-05-25 23:27 problems with boards with CONFIG_DM disabled Marek Behun
@ 2021-05-26  0:25 ` Marek Behun
  2021-05-26 12:52   ` Tom Rini
  0 siblings, 1 reply; 4+ messages in thread
From: Marek Behun @ 2021-05-26  0:25 UTC (permalink / raw)
  To: Tom Rini, Simon Glass; +Cc: u-boot

On Wed, 26 May 2021 01:27:56 +0200
Marek Behun <marek.behun@nic.cz> wrote:

> Tom, Simon,
> 
> now that LTO is merged I am working on
>   Support SPI NORs and OF partitions in `mtd list`
> 
> but CI fails for some boards, see
> https://github.com/u-boot/u-boot/pull/55
> 
> The reason is that there are still several boards which do not use
> CONFIG_DM.
> 
> On the previous version Simon commented that I should use
>   if (IS_ENABLED(...))
> instead of
>   #if
> but this does not currently work for those boards with CONFIG_DM
> disabled (struct udevice's members are not visible at all, and
> functions from dm/device.h do not exist).
> 
> There are multiple possible workarounds:
> - use #if (until all boards are at CONFIG_DM)
> - create static inline versions of functions from dm/device.h returning
>   failures when CONFIG_DM is not set (this would be rather big :( )
> - wait till all those boards with CONFIG_DM disabled are removed
> - ...

Since there is rather a large number of defconfigs with CONFIG_DM
disabled, and since the relevant code was rather complex

	if (!is_part && dev && mtd->dev == dev) ||
	    !strcmp(name, mtd->name) ||
	    (is_part && mtd->dev && !strcmp(name, mtd->dev->name))

I moved the code into a separate name matching function and for now
created a non-DM version.

Hopefully this will be acceptable and pass CI.

Marek

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

* Re: problems with boards with CONFIG_DM disabled
  2021-05-26  0:25 ` Marek Behun
@ 2021-05-26 12:52   ` Tom Rini
  2021-05-26 13:51     ` Marek Behún
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Rini @ 2021-05-26 12:52 UTC (permalink / raw)
  To: Marek Behun; +Cc: Simon Glass, u-boot

[-- Attachment #1: Type: text/plain, Size: 2110 bytes --]

On Wed, May 26, 2021 at 02:25:54AM +0200, Marek Behun wrote:
> On Wed, 26 May 2021 01:27:56 +0200
> Marek Behun <marek.behun@nic.cz> wrote:
> 
> > Tom, Simon,
> > 
> > now that LTO is merged I am working on
> >   Support SPI NORs and OF partitions in `mtd list`
> > 
> > but CI fails for some boards, see
> > https://github.com/u-boot/u-boot/pull/55
> > 
> > The reason is that there are still several boards which do not use
> > CONFIG_DM.
> > 
> > On the previous version Simon commented that I should use
> >   if (IS_ENABLED(...))
> > instead of
> >   #if
> > but this does not currently work for those boards with CONFIG_DM
> > disabled (struct udevice's members are not visible at all, and
> > functions from dm/device.h do not exist).
> > 
> > There are multiple possible workarounds:
> > - use #if (until all boards are at CONFIG_DM)
> > - create static inline versions of functions from dm/device.h returning
> >   failures when CONFIG_DM is not set (this would be rather big :( )
> > - wait till all those boards with CONFIG_DM disabled are removed
> > - ...
> 
> Since there is rather a large number of defconfigs with CONFIG_DM
> disabled, and since the relevant code was rather complex
> 
> 	if (!is_part && dev && mtd->dev == dev) ||
> 	    !strcmp(name, mtd->name) ||
> 	    (is_part && mtd->dev && !strcmp(name, mtd->dev->name))
> 
> I moved the code into a separate name matching function and for now
> created a non-DM version.
> 
> Hopefully this will be acceptable and pass CI.

There's two parts to it, I suppose.  First, looking at the failed build:
https://dev.azure.com/u-boot/u-boot/_build/results?buildId=2297&view=logs&j=9905d24b-10d5-587f-b981-9e43e4414ee0&t=4fbb7fc6-2c55-511b-8011-58267bbd0b81&l=510
that's not a no-CONFIG_DM migration (SPL_DM is not required).  Second, I
wonder what it would look like on top of my WIP/make-DM_USB-fatal branch
as that has removed a number of non-migrated boards.  The deadline for
CONFIG_DM causing removal itself is still a bit away, but that branch
does remove a number of boards.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

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

* Re: problems with boards with CONFIG_DM disabled
  2021-05-26 12:52   ` Tom Rini
@ 2021-05-26 13:51     ` Marek Behún
  0 siblings, 0 replies; 4+ messages in thread
From: Marek Behún @ 2021-05-26 13:51 UTC (permalink / raw)
  To: Tom Rini; +Cc: Simon Glass, u-boot

On Wed, 26 May 2021 08:52:58 -0400
Tom Rini <trini@konsulko.com> wrote:

> On Wed, May 26, 2021 at 02:25:54AM +0200, Marek Behun wrote:
> > On Wed, 26 May 2021 01:27:56 +0200
> > Marek Behun <marek.behun@nic.cz> wrote:
> >   
> > > Tom, Simon,
> > > 
> > > now that LTO is merged I am working on
> > >   Support SPI NORs and OF partitions in `mtd list`
> > > 
> > > but CI fails for some boards, see
> > > https://github.com/u-boot/u-boot/pull/55
> > > 
> > > The reason is that there are still several boards which do not use
> > > CONFIG_DM.
> > > 
> > > On the previous version Simon commented that I should use
> > >   if (IS_ENABLED(...))
> > > instead of
> > >   #if
> > > but this does not currently work for those boards with CONFIG_DM
> > > disabled (struct udevice's members are not visible at all, and
> > > functions from dm/device.h do not exist).
> > > 
> > > There are multiple possible workarounds:
> > > - use #if (until all boards are at CONFIG_DM)
> > > - create static inline versions of functions from dm/device.h
> > > returning failures when CONFIG_DM is not set (this would be
> > > rather big :( )
> > > - wait till all those boards with CONFIG_DM disabled are removed
> > > - ...  
> > 
> > Since there is rather a large number of defconfigs with CONFIG_DM
> > disabled, and since the relevant code was rather complex
> > 
> > 	if (!is_part && dev && mtd->dev == dev) ||
> > 	    !strcmp(name, mtd->name) ||
> > 	    (is_part && mtd->dev && !strcmp(name, mtd->dev->name))
> > 
> > I moved the code into a separate name matching function and for now
> > created a non-DM version.
> > 
> > Hopefully this will be acceptable and pass CI.  
> 
> There's two parts to it, I suppose.  First, looking at the failed
> build:
> https://dev.azure.com/u-boot/u-boot/_build/results?buildId=2297&view=logs&j=9905d24b-10d5-587f-b981-9e43e4414ee0&t=4fbb7fc6-2c55-511b-8011-58267bbd0b81&l=510
> that's not a no-CONFIG_DM migration (SPL_DM is not required).
> Second, I wonder what it would look like on top of my
> WIP/make-DM_USB-fatal branch as that has removed a number of
> non-migrated boards.  The deadline for CONFIG_DM causing removal
> itself is still a bit away, but that branch does remove a number of
> boards.
> 

I've solved this for now, hopefully in an acceptable way, check it out:
https://patchwork.ozlabs.org/project/uboot/patch/20210526120826.8045-10-marek.behun@nic.cz/

look for mtd_device_matches_name, there are 2 implementations guarded
by macros.

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

end of thread, other threads:[~2021-05-26 13:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-25 23:27 problems with boards with CONFIG_DM disabled Marek Behun
2021-05-26  0:25 ` Marek Behun
2021-05-26 12:52   ` Tom Rini
2021-05-26 13:51     ` Marek Behún

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.