public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/4 v2] arm: bootm: Add dm_remove_devices_flags() call to announce_and_cleanup()
Date: Mon, 20 Mar 2017 12:51:50 +0100	[thread overview]
Message-ID: <20170320115151.15155-3-sr@denx.de> (raw)
In-Reply-To: <20170320115151.15155-1-sr@denx.de>

This patch adds a call to dm_remove_devices_flags() to
announce_and_cleanup() so that drivers that have one of the removal flags
set (e.g. DM_FLAG_ACTIVE_DMA_REMOVE) in their driver struct, may do some
last-stage cleanup before the OS is started.

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
v2:
- Added Simons Reviewed-by

 arch/arm/lib/bootm.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index 8125cf023f..426bee6da5 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -14,6 +14,8 @@
 
 #include <common.h>
 #include <command.h>
+#include <dm/device.h>
+#include <dm/root.h>
 #include <image.h>
 #include <u-boot/zlib.h>
 #include <asm/byteorder.h>
@@ -91,6 +93,13 @@ static void announce_and_cleanup(int fake)
 
 	board_quiesce_devices();
 
+	/*
+	 * 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_flags(DM_REMOVE_ACTIVE_ALL);
+
 	cleanup_before_linux();
 }
 
-- 
2.12.0

  parent reply	other threads:[~2017-03-20 11:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-20 11:51 [U-Boot] [PATCH 1/4 v2] dm: core: Add flags parameter to device_remove() Stefan Roese
2017-03-20 11:51 ` [U-Boot] [PATCH 2/4 v2] dm: core: Add dm_remove_devices_flags() and hook it into device_remove() Stefan Roese
2017-03-20 11:51 ` Stefan Roese [this message]
2017-04-05  3:27   ` [U-Boot] [PATCH 3/4 v2] arm: bootm: Add dm_remove_devices_flags() call to announce_and_cleanup() Simon Glass
2017-03-20 11:51 ` [U-Boot] [PATCH 4/4 v2] dm: test: Add test for device removal Stefan Roese
2017-03-26  3:52   ` Simon Glass
2017-03-27  6:48     ` Stefan Roese
2017-03-22  6:28 ` [U-Boot] [PATCH 2/4 v3] dm: core: Add dm_remove_devices_flags() and hook it into device_remove() Stefan Roese
2017-03-26  1:17   ` Simon Glass
2017-03-26  3:52     ` Simon Glass
2017-03-27  8:31       ` Stefan Roese
2017-03-26  1:17 ` [U-Boot] [PATCH 1/4 v2] dm: core: Add flags parameter to device_remove() Simon Glass
2017-04-05  3:27   ` 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=20170320115151.15155-3-sr@denx.de \
    --to=sr@denx.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox