From: Marek Vasut Date: Wed, 21 Oct 2020 00:24:59 +0200 Subject: [PATCH 1/2] dm: core: Add late driver remove option In-Reply-To: References: <20201011160318.574650-1-marek.vasut+renesas@gmail.com> Message-ID: <2263a3f9-49ea-4fab-13fd-bef84646ddde@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 10/12/20 10:31 AM, Marek Vasut wrote: [...] >>> Add another flag to the DM core which could be assigned to drivers and >>> which makes those drivers call their remove callbacks last, just before >>> booting OS and after all the other drivers finished with their remove >>> callbacks. This is necessary for things like clock drivers, where the >>> other drivers might depend on the clock driver in their remove callbacks. >>> Prime example is the mmc subsystem, which can reconfigure a card from HS >>> mode to slower modes in the remove callback and for that it needs to >>> reconfigure the controller clock. > > [...] > >>> arch/arm/lib/bootm.c | 1 + >>> board/Marvell/octeontx2/board.c | 4 ++-- >>> drivers/core/device-remove.c | 11 ++++++++--- >>> drivers/core/root.c | 2 ++ >>> drivers/core/uclass.c | 32 +++++++++++++++++++++++++------- >>> include/dm/device.h | 4 ++++ >>> include/dm/uclass-internal.h | 3 ++- >>> test/dm/core.c | 21 ++++++++++++--------- >>> test/dm/test-main.c | 30 +++++++++++++++++------------- >>> 9 files changed, 73 insertions(+), 35 deletions(-) >> >> I remember seeing a similar patch before. Do you have a change log? > > Nothing changed since except for the octeon fix, I still require this > patch in to correctly stop SD/MMC controller and then the clock before > booting Linux. This patch is still missing from upstream, and I see no feedback. I have multiple patches depending on this functionality too, and it already missed two merge windows.