From patchwork Mon Mar 20 11:51:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Roese X-Patchwork-Id: 740974 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3vmvSt17Rdz9s76 for ; Mon, 20 Mar 2017 22:52:29 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id C54A9C21C73; Mon, 20 Mar 2017 11:52:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 4163EC21C2C; Mon, 20 Mar 2017 11:51:59 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 9BFC5C21C58; Mon, 20 Mar 2017 11:51:57 +0000 (UTC) Received: from mx2.mailbox.org (mx2.mailbox.org [80.241.60.215]) by lists.denx.de (Postfix) with ESMTPS id 45A62C21C2C for ; Mon, 20 Mar 2017 11:51:57 +0000 (UTC) Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 272C145195 for ; Mon, 20 Mar 2017 12:51:57 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter01.heinlein-hosting.de (spamfilter01.heinlein-hosting.de [80.241.56.115]) (amavisd-new, port 10030) with ESMTP id ZQzmEQ55TP28 for ; Mon, 20 Mar 2017 12:51:52 +0100 (CET) From: Stefan Roese To: u-boot@lists.denx.de Date: Mon, 20 Mar 2017 12:51:50 +0100 Message-Id: <20170320115151.15155-3-sr@denx.de> In-Reply-To: <20170320115151.15155-1-sr@denx.de> References: <20170320115151.15155-1-sr@denx.de> Subject: [U-Boot] [PATCH 3/4 v2] arm: bootm: Add dm_remove_devices_flags() call to announce_and_cleanup() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 Reviewed-by: Simon Glass --- 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 #include +#include +#include #include #include #include @@ -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(); }