All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 4/5 v2] x86: bootm: Add dm_remove_devices_flags() call to bootm_announce_and_cleanup()
Date: Mon, 24 Apr 2017 09:48:03 +0200	[thread overview]
Message-ID: <20170424074804.15143-4-sr@denx.de> (raw)
In-Reply-To: <20170424074804.15143-1-sr@denx.de>

This patch adds a call to dm_remove_devices_flags() to
bootm_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>
Cc: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
v2:
- Added Simons RB line

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

diff --git a/arch/x86/lib/bootm.c b/arch/x86/lib/bootm.c
index 75bab90225..ecd4f4e6c6 100644
--- a/arch/x86/lib/bootm.c
+++ b/arch/x86/lib/bootm.c
@@ -10,6 +10,8 @@
 
 #include <common.h>
 #include <command.h>
+#include <dm/device.h>
+#include <dm/root.h>
 #include <errno.h>
 #include <fdt_support.h>
 #include <image.h>
@@ -46,6 +48,13 @@ void bootm_announce_and_cleanup(void)
 #ifdef CONFIG_BOOTSTAGE_REPORT
 	bootstage_report();
 #endif
+
+	/*
+	 * 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);
 }
 
 #if defined(CONFIG_OF_LIBFDT) && !defined(CONFIG_OF_NO_KERNEL)
-- 
2.12.2

  parent reply	other threads:[~2017-04-24  7:48 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-24  7:48 [U-Boot] [PATCH 1/5 v2] dm: device_remove: Don't return in device_chld_remove() upon error Stefan Roese
2017-04-24  7:48 ` [U-Boot] [PATCH 2/5 v2] serial: serial-uclass: Use force parameter in stdio_deregister_dev() Stefan Roese
2017-04-29  0:26   ` Simon Glass
2017-05-09  4:28     ` Bin Meng
2017-04-24  7:48 ` [U-Boot] [PATCH 3/5 v2] dm: core: Add DM_FLAG_OS_PREPARE flag Stefan Roese
2017-05-09  4:28   ` Bin Meng
2017-04-24  7:48 ` Stefan Roese [this message]
2017-05-09  4:28   ` [U-Boot] [PATCH 4/5 v2] x86: bootm: Add dm_remove_devices_flags() call to bootm_announce_and_cleanup() Bin Meng
2017-04-24  7:48 ` [U-Boot] [PATCH 5/5 v2] spi: ich: Configure SPI BIOS parameters for Linux upon U-Boot exit Stefan Roese
2017-05-09  4:28   ` Bin Meng
2017-05-09 11:14   ` Jagan Teki
2017-05-09 11:20     ` Stefan Roese
2017-05-10  0:47       ` Bin Meng
2017-05-10 12:31         ` Stefan Roese
2017-05-15  3:02         ` Simon Glass
2017-04-29  0:26 ` [U-Boot] [PATCH 1/5 v2] dm: device_remove: Don't return in device_chld_remove() upon error Simon Glass
2017-05-01  6:14   ` Stefan Roese
2017-05-02 11:27     ` Simon Glass
2017-05-02 11:45       ` Stefan Roese
2017-05-04 16:50         ` Simon Glass
2017-05-08  7:35           ` Stefan Roese
2017-05-09  3:20             ` 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=20170424074804.15143-4-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 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.