From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01DE4C00A89 for ; Thu, 5 Nov 2020 09:41:07 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 659F42080D for ; Thu, 5 Nov 2020 09:41:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="AWC71KdY"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="lKpQaFbU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 659F42080D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=MTWJ0clj8kx5d0EOc7vIawpxldSpzLVeCM+SicXBeis=; b=AWC71KdYA/n0ziT/eUxTvp2Bn nXi6f5CuDUG/BqIQFcifsJzZMeBcbIV6nye8mMpny1zW7cwLqwh9lsC8El8/Yb6S7Lm8j918USpat HJQJISUb+mq8b/kMomUfS98etBvSh0P4Qaa2Kua/KWHh7Vr5rp1d7scXY5WjC6KzgnjqO+Lepx88j SOsEuPS02FrDb8tf5KSzXiAgyvcefoL+R8QR7Vdf1a1Juh6s3SiI0cwDttLYXOfVxo31G3gDcJIps XnH8lbjylYQYY88xVt7hQOLbYMAVq6MlB1eW4uDQOLCw92FMfTU4fNzDWksKuwAR+WDAwt0PrBoAd Dbo8jhsHw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kabkG-0004eo-6q; Thu, 05 Nov 2020 09:39:52 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kabkD-0004eR-Hg for linux-arm-kernel@lists.infradead.org; Thu, 05 Nov 2020 09:39:50 +0000 Received: by mail-wr1-x444.google.com with SMTP id 33so927369wrl.7 for ; Thu, 05 Nov 2020 01:39:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=O1Ptw4Z6fyBehqHYaSzRs4kWOAuaPAg0Ode7nAckbcI=; b=lKpQaFbU6i/iQQXHpRtJTGXfYs5EE0e3aodsqlp9QeGZmsffh7RlWk6IgDeVl3o0xu pCR6lgT2aiZdhtCXaEuOujnJnud52nziMgKE/ONeqKy0MceI3gfkv1uZ9s99xqbjxUIO Vpo4p2Ieo08cBXUL1E7nyc9W3Vw9jo8uYdI0Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=O1Ptw4Z6fyBehqHYaSzRs4kWOAuaPAg0Ode7nAckbcI=; b=ZYRsnkGe8JhVK5zT2MadBH9yIV0EofNbaAT+mNtbucCIlPemqmV9DmERnPMX1H/qvD bCv0Lo/VTZ/d/LD8JkmA213dUlcw1YAYrgckNe+Q0Q4b+CSTIrZYIUm0cyy0uwJvd8EH 7idv9wJeSdb0HzDkLgLef7UM3wibgaMwL5mSPwWAgjpiDmPnVcbULpdQF6jET7dLAEos K0J63vwWm3uTl+xna59uOEFiLx0pTsUbpYZntJafkeUNs00PaCjWBF/dU4dgNjt6wX5N 8wYg8YKL7s1168dhcSrdzJD1sXOIJzk8f/83m7ZloxMTJASH8Oo8H8xNfmNyvjFwmSjx HYWQ== X-Gm-Message-State: AOAM5323xanGgnnLXF7W4QKyLglF0wiz4JW5SoiDCseTZNhgX4rt1YQQ Gvva3vsPBrjGiQDu/QRPfMmrOf1lLbuwtblq X-Google-Smtp-Source: ABdhPJx0auxQhwpogPi8nd2blZkbW8w0U5S07Gfgt4vJP6rs0bEwZ2m6v9NXVsnccnnz4cQ4Yr52UQ== X-Received: by 2002:a5d:424e:: with SMTP id s14mr1796145wrr.131.1604569188294; Thu, 05 Nov 2020 01:39:48 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id c2sm1720811wmf.47.2020.11.05.01.39.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2020 01:39:47 -0800 (PST) Date: Thu, 5 Nov 2020 10:39:45 +0100 From: Daniel Vetter To: Marek Vasut Subject: Re: [PATCH] drm/stm: Enable RPM during fbdev registration Message-ID: <20201105093945.GS401619@phenom.ffwll.local> References: <20201104125200.259639-1-marex@denx.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201104125200.259639-1-marex@denx.de> X-Operating-System: Linux phenom 5.7.0-1-amd64 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201105_043949_647842_46321B66 X-CRM114-Status: GOOD ( 25.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Torgue , Philippe Cornu , dri-devel@lists.freedesktop.org, Yannick =?iso-8859-1?Q?Fertr=E9?= , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Benjamin Gaignard Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Nov 04, 2020 at 01:52:00PM +0100, Marek Vasut wrote: > Enable runtime PM before registering the fbdev emulation and disable it > afterward, otherwise register access to the LTDC IP during the fbdev > emulation registration might hang the system. > = > The problem happens because RPM is activated at the end of ltdc_load(), > but the fbdev emulation registration happens only after that, and ends > up calling ltdc_crtc_mode_set_nofb(), which checks whether RPM is active > and only if it is not active, calls pm_runtime_get_sync() to enable the > clock and so on. If the clock are not enabled, any register access in > ltdc_crtc_mode_set_nofb() could hang the platform completely. > = > This patch makes sure that ltdc_crtc_mode_set_nofb() is called within > pm_runtime_get_sync(), so with clock enabled. > = > Signed-off-by: Marek Vasut > Cc: Alexandre Torgue > Cc: Benjamin Gaignard > Cc: Philippe Cornu > Cc: Yannick Fertr=E9 > Cc: dri-devel@lists.freedesktop.org > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-stm32@st-md-mailman.stormreply.com This looks like you're papering over a bug in your modeset code. If userspace later on does a setpar on the fbdev chardev, the exact same thing could happen. You need to fix your modeset code to avoid this, not sprinkle temporary rpm_get/put all over some top level entry points, because you can't even patch those all. -Daniel > --- > drivers/gpu/drm/stm/drv.c | 2 ++ > 1 file changed, 2 insertions(+) > = > diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c > index 411103f013e2..d8921edc83db 100644 > --- a/drivers/gpu/drm/stm/drv.c > +++ b/drivers/gpu/drm/stm/drv.c > @@ -197,7 +197,9 @@ static int stm_drm_platform_probe(struct platform_dev= ice *pdev) > if (ret) > goto err_put; > = > + pm_runtime_get_sync(ddev->dev); > drm_fbdev_generic_setup(ddev, 16); > + pm_runtime_put_sync(ddev->dev); > = > return 0; > = > -- = > 2.28.0 > = > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- = Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel