All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Simon Glass <sjg@chromium.org>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	neil.armstrong@linaro.org, Jonas Karlman <jonas@kwiboo.se>,
	Bin Meng <bmeng.cn@gmail.com>,
	Caleb Connolly <caleb.connolly@linaro.org>,
	Janne Grunau <j@jannau.net>, Leo <ycliang@andestech.com>,
	Marek Vasut <marex@denx.de>,
	Matthew Garrett <mgarrett@aurora.tech>,
	Pavel Herrmann <morpheus.ibis@gmail.com>,
	Quentin Schulz <quentin.schulz@cherry.de>,
	Rasmus Villemoes <rasmus.villemoes@prevas.dk>,
	Rick Chen <rick@andestech.com>,
	Sughosh Ganu <sughosh.ganu@linaro.org>,
	U-Boot Mailing List <u-boot@lists.denx.de>
Subject: Re: [PATCH v2 4/4] dm: core: Rename dm_remove_devices_active()
Date: Mon, 7 Apr 2025 07:30:49 -0600	[thread overview]
Message-ID: <20250407133049.GI5495@bill-the-cat> (raw)
In-Reply-To: <CAFLszTgdCJMPVL6StLygGBT_GKJQXbpGGDT1tDqWMs9-kToEVQ@mail.gmail.com>

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

On Mon, Apr 07, 2025 at 10:49:11PM +1200, Simon Glass wrote:
> Hi Heinrich,
> 
> On Mon, 7 Apr 2025 at 19:57, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
> >
> > On 07.04.25 03:35, Simon Glass wrote:
> > > This function doesn't have a great name, since we talk of devices being
> > > active once they are probed.
> > >
> > > Rename it to dm_remove_dma_devices().
> > >
> > > Signed-off-by: Simon Glass <sjg@chromium.org>
> > > Suggested-by: Jonas Karlman <jonas@kwiboo.se>
> > > ---
> > >
> > > (no changes since v1)
> > >
> > >   arch/arm/lib/bootm.c          | 4 ++--
> > >   arch/riscv/lib/bootm.c        | 2 +-
> > >   arch/x86/lib/bootm.c          | 2 +-
> > >   drivers/core/root.c           | 2 +-
> > >   include/dm/root.h             | 6 +++---
> > >   lib/efi_loader/efi_boottime.c | 2 +-
> > >   test/dm/core.c                | 2 +-
> > >   7 files changed, 10 insertions(+), 10 deletions(-)
> > >
> > > diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
> > > index 688c2f3f29b..ef859a2cd4c 100644
> > > --- a/arch/arm/lib/bootm.c
> > > +++ b/arch/arm/lib/bootm.c
> > > @@ -74,10 +74,10 @@ static void announce_and_cleanup(int fake)
> > >        * Call remove function of all devices with a removal flag set.
> > >        * This may be useful for last-stage operations, like cancelling
> > >        * of DMA operation or releasing device internal buffers.
> > > -      * dm_remove_devices_active() ensures that vital devices are removed in
> > > +      * dm_remove_dma_devices() ensures that vital devices are removed in
> > >        * a second round.
> > >        */
> > > -     dm_remove_devices_active();
> > > +     dm_remove_dma_devices();
> > >
> > >       cleanup_before_linux();
> > >   }
> > > diff --git a/arch/riscv/lib/bootm.c b/arch/riscv/lib/bootm.c
> > > index 76c610bcee0..9aecaafef43 100644
> > > --- a/arch/riscv/lib/bootm.c
> > > +++ b/arch/riscv/lib/bootm.c
> > > @@ -57,7 +57,7 @@ static void announce_and_cleanup(int fake)
> > >        * This may be useful for last-stage operations, like cancelling
> > >        * of DMA operation or releasing device internal buffers.
> > >        */
> > > -     dm_remove_devices_active();
> > > +     dm_remove_dma_devices();
> > >
> > >       cleanup_before_linux();
> > >   }
> > > diff --git a/arch/x86/lib/bootm.c b/arch/x86/lib/bootm.c
> > > index 3c420b00936..91e8de4e1ad 100644
> > > --- a/arch/x86/lib/bootm.c
> > > +++ b/arch/x86/lib/bootm.c
> > > @@ -50,7 +50,7 @@ void bootm_announce_and_cleanup(void)
> > >        * This may be useful for last-stage operations, like cancelling
> > >        * of DMA operation or releasing device internal buffers.
> > >        */
> > > -     dm_remove_devices_active();
> > > +     dm_remove_dma_devices();
> > >   }
> > >
> > >   #if defined(CONFIG_OF_LIBFDT) && !defined(CONFIG_OF_NO_KERNEL)
> > > diff --git a/drivers/core/root.c b/drivers/core/root.c
> > > index c7fb58285ca..101cc4d43fa 100644
> > > --- a/drivers/core/root.c
> > > +++ b/drivers/core/root.c
> > > @@ -148,7 +148,7 @@ int dm_remove_devices_flags(uint flags)
> > >       return 0;
> > >   }
> > >
> > > -void dm_remove_devices_active(void)
> > > +void dm_remove_dma_devices(void)
> > >   {
> > >       /* Remove non-vital devices first */
> > >       device_remove(dm_root(), DM_REMOVE_ACTIVE_ALL | DM_REMOVE_NON_VITAL);
> > > diff --git a/include/dm/root.h b/include/dm/root.h
> > > index 5651b868c8b..39a069cd465 100644
> > > --- a/include/dm/root.h
> > > +++ b/include/dm/root.h
> > > @@ -169,16 +169,16 @@ int dm_uninit(void);
> > >   int dm_remove_devices_flags(uint flags);
> > >
> > >   /**
> > > - * dm_remove_devices_active - Call remove function of all active drivers heeding
> > > + * dm_remove_dma_devices - Call remove function of all active drivers heeding
> > >    *                            device dependencies as far as know, i.e. removing
> > >    *                            devices marked with DM_FLAG_VITAL last.
> > >    *
> > >    * All active devices will be removed
> > >    */
> > > -void dm_remove_devices_active(void);
> > > +void dm_remove_dma_devices(void);
> >
> > We have to remove all active devices. Not only DMA devices but also any
> > device that creates interrupts.
> >
> > The renaming is misleading.
> 
> Yes, but so is the existing name, as mentioned.
> 
> How about dm_remove_for_boot() ?

I think the name itself is fine and maybe just a bit more
documentation? It's dealing with the DM_REMOVE_ACTIVE_ALL flag
after all.

-- 
Tom

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

  reply	other threads:[~2025-04-07 13:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-07  1:35 [PATCH v2 0/4] dm: net: Assorted patches related to networking and DMA Simon Glass
2025-04-07  1:35 ` [PATCH v2 1/4] designware: Use the remove() method with related drivers Simon Glass
2025-04-07  7:31   ` neil.armstrong
2025-04-07  1:35 ` [PATCH v2 2/4] net: designware: Mark drivers as having active DMA Simon Glass
2025-04-07  7:31   ` neil.armstrong
2025-04-07  1:35 ` [PATCH v2 3/4] efi_loader: Move device-removal later in exit-boot-services Simon Glass
2025-04-07  7:54   ` Heinrich Schuchardt
2025-04-07 10:49     ` Simon Glass
2025-04-07 12:22       ` Mark Kettenis
2025-04-07  1:35 ` [PATCH v2 4/4] dm: core: Rename dm_remove_devices_active() Simon Glass
2025-04-07  7:56   ` Heinrich Schuchardt
2025-04-07 10:49     ` Simon Glass
2025-04-07 13:30       ` Tom Rini [this message]
2025-04-07 15:23         ` Simon Glass

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=20250407133049.GI5495@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=bmeng.cn@gmail.com \
    --cc=caleb.connolly@linaro.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=j@jannau.net \
    --cc=jonas@kwiboo.se \
    --cc=marex@denx.de \
    --cc=mgarrett@aurora.tech \
    --cc=morpheus.ibis@gmail.com \
    --cc=neil.armstrong@linaro.org \
    --cc=quentin.schulz@cherry.de \
    --cc=rasmus.villemoes@prevas.dk \
    --cc=rick@andestech.com \
    --cc=sjg@chromium.org \
    --cc=sughosh.ganu@linaro.org \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    --cc=ycliang@andestech.com \
    /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.