From patchwork Mon Feb 17 09:10:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 1239056 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=0HgfcXXH; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48LdWF0hrSz9sRG for ; Mon, 17 Feb 2020 20:10:48 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A9C898079C; Mon, 17 Feb 2020 10:10:45 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="0HgfcXXH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C29E480EA2; Mon, 17 Feb 2020 10:10:43 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D13DD800DF for ; Mon, 17 Feb 2020 10:10:40 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=narmstrong@baylibre.com Received: by mail-wm1-x341.google.com with SMTP id p9so16304491wmc.2 for ; Mon, 17 Feb 2020 01:10:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=uHeJdEUD0Mgqm4efmsXme5r+hrkTdHh5xXk74Ajnc3Y=; b=0HgfcXXH1jEuiQEJCYR8+cwU9U3YYpfFraMMPgzrskg0E2RBFTHnZ7pY43v/VhcWk1 MVBiud6xrCxKN8tdeMS1waVn1YDaD6h1W7Udwxe2MOM7zbcz3t7iToEZhNNQCHdhHTSC 1mtuHNeobM2G0KLMyn1jpIVPUKYSJUhoxXViweq8rQMCX8CN0SYQe/xqozp4I1+FJHt6 dBuIXc7xmrzN1wqutRh5Cr7oI9Aa6az6z0GJdG/2Kq5JLCO98Z9+KAJqo91usZzb8VYm KLCYeuUJ4hUs7H8egjODqqJatrZnniwRo1080KKuDYtf1HcRv+AME710R3aAsqzyfl4n 5cXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=uHeJdEUD0Mgqm4efmsXme5r+hrkTdHh5xXk74Ajnc3Y=; b=aCRwEbOXU2piERjtO7IWIjYhAxjZiZ7fmE3XQvRzRYPn1StCrSIZ38/HfErzlF/Iwb I8OtaJfMJSSYiBpZqyWuWITNT0MkRcLqt3hycgAFLM47Q2Bqu7JsOzFf0mlB1BNij15Q iRUDknS+oSWD0QDe8xezJdQ/fOgmbIoyXqz66v8iokmhpOqOTfAgz0UmLysD3EtYbVgy 1wFhNaxl6ofPe1WaqswoWmaJiiFvEyrM8E/GiFjeqoMq7okLFS7h6+zYaHdyCU6/rs/o 9AfGiiezqAxnWGu4VECI144mLocppm4YkM1Y7rabgMD/WNo0ziNCDMS93Avd7GIaHUnb MnDg== X-Gm-Message-State: APjAAAX53f3sygPZLUIzFYWtxJXeoOkVSMTY6Sy7qLJiO/1iSrXXlrqO fP7V0flA4RdOQrThKRw+IBqmSA== X-Google-Smtp-Source: APXvYqwdiV6pYEkPf6S98/CBDLlj+ueifNEy/ys4bp3hVa/dL0OSnUTziUGzbaiF0y2l/66wOhDmoQ== X-Received: by 2002:a7b:c753:: with SMTP id w19mr21659377wmk.34.1581930640273; Mon, 17 Feb 2020 01:10:40 -0800 (PST) Received: from bender.baylibre.local (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id q1sm42671wrw.5.2020.02.17.01.10.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2020 01:10:39 -0800 (PST) From: Neil Armstrong To: sjg@chromium.org, trini@konsulko.com Cc: Neil Armstrong , oliver.graute@gmail.com, agust@denx.de, u-boot@lists.denx.de, u-boot-amlogic@groups.io, lokeshvutla@ti.com, sbabic@denx.de Subject: [PATCH] Revert "dm: core: device: switch off power domain after device removal" Date: Mon, 17 Feb 2020 10:10:36 +0100 Message-Id: <20200217091036.19028-1-narmstrong@baylibre.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.1 at phobos.denx.de X-Virus-Status: Clean This commit breaks Linux boot on Amlogic libretech-cc, libretech-ac, sei510, sei610 board by automatically disabling the power domain after device removal. This because the power domain associated to the video driver must be kept enabled for linux to boot. The only way is to use the introduced flag DM_FLAG_DEFAULT_PD_CTRL_OFF, which removes automatic handling of power domain. This flag is not a complete solution since it will force reverting to manually enable the power domain from the driver probe. Instead a flag to keep the power domain enabled after removal should be introduced. In the meantime revert this commit until a proper solution is found. This reverts commit 52edfed65de967a86983a55c51ba0727090efc43. Signed-off-by: Neil Armstrong --- Hi Simon, Tom, This revert is the simplest fix to make the boards boot again on v2020.04, the goal is to make this behavior happen again with a proper flag to keep the power domain enabled on specific drivers. I can push it on my next PR on my branch, is it ok ? Neil drivers/core/device-remove.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/core/device-remove.c b/drivers/core/device-remove.c index 444e34b492..5540053d3c 100644 --- a/drivers/core/device-remove.c +++ b/drivers/core/device-remove.c @@ -16,7 +16,6 @@ #include #include #include -#include int device_chld_unbind(struct udevice *dev, struct driver *drv) { @@ -194,10 +193,6 @@ int device_remove(struct udevice *dev, uint flags) } } - if (!(drv->flags & DM_FLAG_DEFAULT_PD_CTRL_OFF) && - (dev != gd->cur_serial_dev)) - dev_power_domain_off(dev); - if (flags_remove(flags, drv->flags)) { device_free(dev);