All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] dm: core: Add a flag for power domain control on device removal
@ 2020-02-17 11:36 Anatolij Gustschin
  2020-02-17 11:36 ` [PATCH 2/2] video: meson: keep power domain up after booting Anatolij Gustschin
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Anatolij Gustschin @ 2020-02-17 11:36 UTC (permalink / raw)
  To: u-boot

In various cases a power domain must stay enabled after device
removal when booting OS (i.e. serial debug console or display).
Add a flag to selectively skip switching off a power domain.

Fixes: 52edfed65de9 ("dm: core: device: switch off power domain after device removal")
Signed-off-by: Anatolij Gustschin <agust@denx.de>
---
 drivers/core/device-remove.c | 5 +++--
 include/dm/device.h          | 6 ++++++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/core/device-remove.c b/drivers/core/device-remove.c
index 444e34b492..ff5b28cb6a 100644
--- a/drivers/core/device-remove.c
+++ b/drivers/core/device-remove.c
@@ -194,8 +194,9 @@ int device_remove(struct udevice *dev, uint flags)
 		}
 	}
 
-	if (!(drv->flags & DM_FLAG_DEFAULT_PD_CTRL_OFF) &&
-	    (dev != gd->cur_serial_dev))
+	if (!(drv->flags &
+	      (DM_FLAG_DEFAULT_PD_CTRL_OFF | DM_FLAG_REMOVE_WITH_PD_ON)) &&
+	    dev != gd->cur_serial_dev)
 		dev_power_domain_off(dev);
 
 	if (flags_remove(flags, drv->flags)) {
diff --git a/include/dm/device.h b/include/dm/device.h
index ab806d0b7e..a56164b19b 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -67,6 +67,12 @@ struct driver_info;
 /* Driver platdata has been read. Cleared when the device is removed */
 #define DM_FLAG_PLATDATA_VALID		(1 << 12)
 
+/*
+ * Device is removed without switching off its power domain. This might
+ * be required, i. e. for serial console (debug) output when booting OS.
+ */
+#define DM_FLAG_REMOVE_WITH_PD_ON	(1 << 13)
+
 /*
  * One or multiple of these flags are passed to device_remove() so that
  * a selective device removal as specified by the remove-stage and the
-- 
2.17.1

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

* [PATCH 2/2] video: meson: keep power domain up after booting
  2020-02-17 11:36 [PATCH 1/2] dm: core: Add a flag for power domain control on device removal Anatolij Gustschin
@ 2020-02-17 11:36 ` Anatolij Gustschin
  2020-02-17 16:55   ` Neil Armstrong
  2020-03-03  2:46   ` sjg at google.com
  2020-02-17 16:55 ` [PATCH 1/2] dm: core: Add a flag for power domain control on device removal Neil Armstrong
  2020-02-18 18:31 ` Simon Glass
  2 siblings, 2 replies; 9+ messages in thread
From: Anatolij Gustschin @ 2020-02-17 11:36 UTC (permalink / raw)
  To: u-boot

Add driver flag to skip power domain disabling on device removal.

Fixes: 52edfed65de9 ("dm: core: device: switch off power domain after device removal")
Signed-off-by: Anatolij Gustschin <agust@denx.de>
---
 drivers/video/meson/meson_vpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/meson/meson_vpu.c b/drivers/video/meson/meson_vpu.c
index 4eb66398d0..aa8c0a962f 100644
--- a/drivers/video/meson/meson_vpu.c
+++ b/drivers/video/meson/meson_vpu.c
@@ -210,5 +210,5 @@ U_BOOT_DRIVER(meson_vpu) = {
 	.probe = meson_vpu_probe,
 	.bind = meson_vpu_bind,
 	.priv_auto_alloc_size = sizeof(struct meson_vpu_priv),
-	.flags  = DM_FLAG_PRE_RELOC,
+	.flags  = DM_FLAG_PRE_RELOC | DM_FLAG_REMOVE_WITH_PD_ON,
 };
-- 
2.17.1

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

* [PATCH 1/2] dm: core: Add a flag for power domain control on device removal
  2020-02-17 11:36 [PATCH 1/2] dm: core: Add a flag for power domain control on device removal Anatolij Gustschin
  2020-02-17 11:36 ` [PATCH 2/2] video: meson: keep power domain up after booting Anatolij Gustschin
@ 2020-02-17 16:55 ` Neil Armstrong
  2020-02-18 18:31 ` Simon Glass
  2 siblings, 0 replies; 9+ messages in thread
From: Neil Armstrong @ 2020-02-17 16:55 UTC (permalink / raw)
  To: u-boot

On 17/02/2020 12:36, Anatolij Gustschin wrote:
> In various cases a power domain must stay enabled after device
> removal when booting OS (i.e. serial debug console or display).
> Add a flag to selectively skip switching off a power domain.
> 
> Fixes: 52edfed65de9 ("dm: core: device: switch off power domain after device removal")
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
> ---
>  drivers/core/device-remove.c | 5 +++--
>  include/dm/device.h          | 6 ++++++
>  2 files changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/core/device-remove.c b/drivers/core/device-remove.c
> index 444e34b492..ff5b28cb6a 100644
> --- a/drivers/core/device-remove.c
> +++ b/drivers/core/device-remove.c
> @@ -194,8 +194,9 @@ int device_remove(struct udevice *dev, uint flags)
>  		}
>  	}
>  
> -	if (!(drv->flags & DM_FLAG_DEFAULT_PD_CTRL_OFF) &&
> -	    (dev != gd->cur_serial_dev))
> +	if (!(drv->flags &
> +	      (DM_FLAG_DEFAULT_PD_CTRL_OFF | DM_FLAG_REMOVE_WITH_PD_ON)) &&
> +	    dev != gd->cur_serial_dev)
>  		dev_power_domain_off(dev);
>  
>  	if (flags_remove(flags, drv->flags)) {
> diff --git a/include/dm/device.h b/include/dm/device.h
> index ab806d0b7e..a56164b19b 100644
> --- a/include/dm/device.h
> +++ b/include/dm/device.h
> @@ -67,6 +67,12 @@ struct driver_info;
>  /* Driver platdata has been read. Cleared when the device is removed */
>  #define DM_FLAG_PLATDATA_VALID		(1 << 12)
>  
> +/*
> + * Device is removed without switching off its power domain. This might
> + * be required, i. e. for serial console (debug) output when booting OS.
> + */
> +#define DM_FLAG_REMOVE_WITH_PD_ON	(1 << 13)
> +
>  /*
>   * One or multiple of these flags are passed to device_remove() so that
>   * a selective device removal as specified by the remove-stage and the
> 

Acked-by: Neil Armstrong <narmstrong@baylibre.com>

and

Tested-by: Guillaume La Roque <glaroque@baylibre.com>

Thanks,
Neil

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

* [PATCH 2/2] video: meson: keep power domain up after booting
  2020-02-17 11:36 ` [PATCH 2/2] video: meson: keep power domain up after booting Anatolij Gustschin
@ 2020-02-17 16:55   ` Neil Armstrong
  2020-03-03  2:46   ` sjg at google.com
  1 sibling, 0 replies; 9+ messages in thread
From: Neil Armstrong @ 2020-02-17 16:55 UTC (permalink / raw)
  To: u-boot

On 17/02/2020 12:36, Anatolij Gustschin wrote:
> Add driver flag to skip power domain disabling on device removal.
> 
> Fixes: 52edfed65de9 ("dm: core: device: switch off power domain after device removal")
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
> ---
>  drivers/video/meson/meson_vpu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/video/meson/meson_vpu.c b/drivers/video/meson/meson_vpu.c
> index 4eb66398d0..aa8c0a962f 100644
> --- a/drivers/video/meson/meson_vpu.c
> +++ b/drivers/video/meson/meson_vpu.c
> @@ -210,5 +210,5 @@ U_BOOT_DRIVER(meson_vpu) = {
>  	.probe = meson_vpu_probe,
>  	.bind = meson_vpu_bind,
>  	.priv_auto_alloc_size = sizeof(struct meson_vpu_priv),
> -	.flags  = DM_FLAG_PRE_RELOC,
> +	.flags  = DM_FLAG_PRE_RELOC | DM_FLAG_REMOVE_WITH_PD_ON,
>  };
> 

Acked-by: Neil Armstrong <narmstrong@baylibre.com>

and

Tested-by: Guillaume La Roque <glaroque@baylibre.com>

Thanks,
Neil

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

* [PATCH 1/2] dm: core: Add a flag for power domain control on device removal
  2020-02-17 11:36 [PATCH 1/2] dm: core: Add a flag for power domain control on device removal Anatolij Gustschin
  2020-02-17 11:36 ` [PATCH 2/2] video: meson: keep power domain up after booting Anatolij Gustschin
  2020-02-17 16:55 ` [PATCH 1/2] dm: core: Add a flag for power domain control on device removal Neil Armstrong
@ 2020-02-18 18:31 ` Simon Glass
  2020-02-18 19:42   ` Anatolij Gustschin
  2 siblings, 1 reply; 9+ messages in thread
From: Simon Glass @ 2020-02-18 18:31 UTC (permalink / raw)
  To: u-boot

Hi Anatolij,

On Mon, 17 Feb 2020 at 04:36, Anatolij Gustschin <agust@denx.de> wrote:
>
> In various cases a power domain must stay enabled after device
> removal when booting OS (i.e. serial debug console or display).
> Add a flag to selectively skip switching off a power domain.
>
> Fixes: 52edfed65de9 ("dm: core: device: switch off power domain after device removal")
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
> ---
>  drivers/core/device-remove.c | 5 +++--
>  include/dm/device.h          | 6 ++++++
>  2 files changed, 9 insertions(+), 2 deletions(-)

This seems OK. Should we add a device tree property for this? Or is
the driver-level side enough.

Regards,
Simon

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

* [PATCH 1/2] dm: core: Add a flag for power domain control on device removal
  2020-02-18 18:31 ` Simon Glass
@ 2020-02-18 19:42   ` Anatolij Gustschin
  2020-02-18 23:59     ` Simon Glass
  2020-03-03  2:46     ` sjg at google.com
  0 siblings, 2 replies; 9+ messages in thread
From: Anatolij Gustschin @ 2020-02-18 19:42 UTC (permalink / raw)
  To: u-boot

Hi Simon,

On Tue, 18 Feb 2020 11:31:26 -0700
Simon Glass sjg at chromium.org wrote:

> Hi Anatolij,
> 
> On Mon, 17 Feb 2020 at 04:36, Anatolij Gustschin <agust@denx.de> wrote:
> >
> > In various cases a power domain must stay enabled after device
> > removal when booting OS (i.e. serial debug console or display).
> > Add a flag to selectively skip switching off a power domain.
> >
> > Fixes: 52edfed65de9 ("dm: core: device: switch off power domain after device removal")
> > Signed-off-by: Anatolij Gustschin <agust@denx.de>
> > ---
> >  drivers/core/device-remove.c | 5 +++--
> >  include/dm/device.h          | 6 ++++++
> >  2 files changed, 9 insertions(+), 2 deletions(-)  
> 
> This seems OK. Should we add a device tree property for this? Or is
> the driver-level side enough.

For all potential users I'm currently aware of the driver-level
side is enough. Should this ever be required per device, then we
can add a property later.

--
Anatolij

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

* [PATCH 1/2] dm: core: Add a flag for power domain control on device removal
  2020-02-18 19:42   ` Anatolij Gustschin
@ 2020-02-18 23:59     ` Simon Glass
  2020-03-03  2:46     ` sjg at google.com
  1 sibling, 0 replies; 9+ messages in thread
From: Simon Glass @ 2020-02-18 23:59 UTC (permalink / raw)
  To: u-boot

Hi Anatolij,

On Tue, 18 Feb 2020 at 12:42, Anatolij Gustschin <agust@denx.de> wrote:
>
> Hi Simon,
>
> On Tue, 18 Feb 2020 11:31:26 -0700
> Simon Glass sjg at chromium.org wrote:
>
> > Hi Anatolij,
> >
> > On Mon, 17 Feb 2020 at 04:36, Anatolij Gustschin <agust@denx.de> wrote:
> > >
> > > In various cases a power domain must stay enabled after device
> > > removal when booting OS (i.e. serial debug console or display).
> > > Add a flag to selectively skip switching off a power domain.
> > >
> > > Fixes: 52edfed65de9 ("dm: core: device: switch off power domain after device removal")
> > > Signed-off-by: Anatolij Gustschin <agust@denx.de>
> > > ---
> > >  drivers/core/device-remove.c | 5 +++--
> > >  include/dm/device.h          | 6 ++++++
> > >  2 files changed, 9 insertions(+), 2 deletions(-)
> >
> > This seems OK. Should we add a device tree property for this? Or is
> > the driver-level side enough.
>
> For all potential users I'm currently aware of the driver-level
> side is enough. Should this ever be required per device, then we
> can add a property later.

Reviewed-by: Simon Glass <sjg@chromium.org>

Thanks,
Simon

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

* [PATCH 2/2] video: meson: keep power domain up after booting
  2020-02-17 11:36 ` [PATCH 2/2] video: meson: keep power domain up after booting Anatolij Gustschin
  2020-02-17 16:55   ` Neil Armstrong
@ 2020-03-03  2:46   ` sjg at google.com
  1 sibling, 0 replies; 9+ messages in thread
From: sjg at google.com @ 2020-03-03  2:46 UTC (permalink / raw)
  To: u-boot

On 17/02/2020 12:36, Anatolij Gustschin wrote:
> Add driver flag to skip power domain disabling on device removal.
>
> Fixes: 52edfed65de9 ("dm: core: device: switch off power domain after device removal")
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
> ---
>  drivers/video/meson/meson_vpu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
Applied to u-boot-dm, thanks!

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

* [PATCH 1/2] dm: core: Add a flag for power domain control on device removal
  2020-02-18 19:42   ` Anatolij Gustschin
  2020-02-18 23:59     ` Simon Glass
@ 2020-03-03  2:46     ` sjg at google.com
  1 sibling, 0 replies; 9+ messages in thread
From: sjg at google.com @ 2020-03-03  2:46 UTC (permalink / raw)
  To: u-boot

Hi Anatolij,

On Tue, 18 Feb 2020 at 12:42, Anatolij Gustschin <agust@denx.de> wrote:
>
> Hi Simon,
>
> On Tue, 18 Feb 2020 11:31:26 -0700
> Simon Glass sjg at chromium.org wrote:
>
> > Hi Anatolij,
> >
> > On Mon, 17 Feb 2020 at 04:36, Anatolij Gustschin <agust@denx.de> wrote:
> > >
> > > In various cases a power domain must stay enabled after device
> > > removal when booting OS (i.e. serial debug console or display).
> > > Add a flag to selectively skip switching off a power domain.
> > >
> > > Fixes: 52edfed65de9 ("dm: core: device: switch off power domain after device removal")
> > > Signed-off-by: Anatolij Gustschin <agust@denx.de>
> > > ---
> > >  drivers/core/device-remove.c | 5 +++--
> > >  include/dm/device.h          | 6 ++++++
> > >  2 files changed, 9 insertions(+), 2 deletions(-)
> >
> > This seems OK. Should we add a device tree property for this? Or is
> > the driver-level side enough.
>
> For all potential users I'm currently aware of the driver-level
> side is enough. Should this ever be required per device, then we
> can add a property later.

Reviewed-by: Simon Glass <sjg@chromium.org>

Thanks,
Simon

Applied to u-boot-dm, thanks!

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

end of thread, other threads:[~2020-03-03  2:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-17 11:36 [PATCH 1/2] dm: core: Add a flag for power domain control on device removal Anatolij Gustschin
2020-02-17 11:36 ` [PATCH 2/2] video: meson: keep power domain up after booting Anatolij Gustschin
2020-02-17 16:55   ` Neil Armstrong
2020-03-03  2:46   ` sjg at google.com
2020-02-17 16:55 ` [PATCH 1/2] dm: core: Add a flag for power domain control on device removal Neil Armstrong
2020-02-18 18:31 ` Simon Glass
2020-02-18 19:42   ` Anatolij Gustschin
2020-02-18 23:59     ` Simon Glass
2020-03-03  2:46     ` sjg at google.com

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.