Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1592153rdh; Mon, 25 Sep 2023 18:58:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEYHVZCrAZ5bZM13LHJRLEqttDp1HhLkafBCBL3tUtUfl5K+Oaldb92jSxNS4SOxjaSQ6cB X-Received: by 2002:a05:6870:c227:b0:1db:3679:198a with SMTP id z39-20020a056870c22700b001db3679198amr9827315oae.24.1695693488801; Mon, 25 Sep 2023 18:58:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695693488; cv=none; d=google.com; s=arc-20160816; b=FzCDJBw+b2OyhvWSfPm3mU/8srjyFWpzUCQHwV2NuFgjolH1uA5GMCm6o63OxKcUaj 9DM/KX6aITppymHotee54R7rYM/obojHafXvBdtIclsj3ULjrQd6d3DIqYj8OqPdFFUw zUvDMrbKBnAxwyGGtOCBJ2Yr4FTN3zMb6n4RurrgHOduLVlcCza0t29HI/com+IYJ8B1 op//g8OwaE1EZqXkc3D0dFztEsuj82DX2DaqZadZlZi1JJ9ExqtGskGFgr/K4rSGZE5R R5Bnn5a56y+e7emhIeBCQSjXWSrxexew4s5iUmWkdgfr8IsZOdxoFKmTG0sa+B3HEgZ1 Qj1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=6cwEuixmjVjieATmQA+XE8BdmzJIt5P+ghGd9MnmN4o=; fh=lMgDvE6UqTSMf/mo1IV+5dMRzzDzrCkKyx+HBBMPFGY=; b=w8+R1PlUM+ENAb8VcmN47ETqrWCKOv7WGsjfZmocqCXlbPER+HO/8HyLIGZ4qNatSD vM5QTBanvTv5oT4xb1t7jmuIb+8/+9Oeb3cOKZ8kOkJqk52T+89A7F6iv85iyxFDopSJ rF65UssTKVtvroZQz89XYftdyk9Ywn14Q5tlSm7vw4F1+iPZVjJfFbucR81Ki4AjRV8v lhwMVg2tv4w3VpejADNQM6FoVwf9iQIv8yBuD7uJewd7itIPCYW6tuoW1c5yTWApzQQm jxRYrXwE/jKtAR85HEQDfbuv5/ZOjVLHidqbgMq4EJHDDFrWrapLciZJ4wmd9ld54RYY MXzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=DwSaGvG3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id x26-20020a63171a000000b0057cbd803b37si9267590pgl.463.2023.09.25.18.58.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 18:58:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=DwSaGvG3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 37A8B80950A2; Mon, 25 Sep 2023 09:10:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233186AbjIYQKW (ORCPT + 99 others); Mon, 25 Sep 2023 12:10:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231698AbjIYQKU (ORCPT ); Mon, 25 Sep 2023 12:10:20 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2654410A for ; Mon, 25 Sep 2023 09:10:13 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-9a648f9d8e3so900198166b.1 for ; Mon, 25 Sep 2023 09:10:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695658209; x=1696263009; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=6cwEuixmjVjieATmQA+XE8BdmzJIt5P+ghGd9MnmN4o=; b=DwSaGvG3lAkuEu7faXgfXIajdRZ9XWr7g1Hd+c7xYXx1BZW5sR8gXEoYzOiXaS3QKF Ay3KV1y2KJrdo+/JLYkjWr6fmwEV8qAzb8VY5pxZUaVpxUpivXCBWPFEBWF3KALUHGBs uUD5+RLIhEGoYpGFv08Q/TGNx89xH+q87lEv4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695658209; x=1696263009; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6cwEuixmjVjieATmQA+XE8BdmzJIt5P+ghGd9MnmN4o=; b=an+KJ5lexyiu79kL1flmx2M3OhATxsVbkHd9SRJC1s4iycAzx7DSrJZmuG6Y2vnVC7 BlCungTPg+ZWkMEitILP5Ybe+J6lVGSQcM0QTnMHu/RkgeP68SzKuDHehVwVRaygsBia a1tRP5mjrVqsz3YVsCrMEBmqIvidqZez98gHnEb4gS74HpQ3Gu2WpSRELByAwT9A01l7 kHkB5ykEggIw9BMq1wDPpwYcH7gPw/oiNfLrrqx28I8uwA54+DlXb7lylyV3NeuC4Ue7 1l/8mUP9aC2y0O71Zn30kbfWGYnNSwen15Gx1MbIVfY2ZhZjweKIpRH1yM8im84mDN9Z D/fQ== X-Gm-Message-State: AOJu0YwR4BkPYm234dqYUAgKynsAetmUCmcyO6PXakJLWorl4ljBwFsA VvgYSS1zVP9W2DSyatBurABIHeztGCeDuBlvB43dlA== X-Received: by 2002:a17:906:18:b0:9ae:4054:5d2a with SMTP id 24-20020a170906001800b009ae40545d2amr7996847eja.16.1695658209099; Mon, 25 Sep 2023 09:10:09 -0700 (PDT) Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com. [209.85.128.44]) by smtp.gmail.com with ESMTPSA id k5-20020a1709062a4500b009934b1eb577sm6587544eje.77.2023.09.25.09.10.07 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 25 Sep 2023 09:10:08 -0700 (PDT) Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-4053f24c900so144865e9.1 for ; Mon, 25 Sep 2023 09:10:07 -0700 (PDT) X-Received: by 2002:a05:600c:502b:b0:404:74f8:f47c with SMTP id n43-20020a05600c502b00b0040474f8f47cmr117221wmr.5.1695658207419; Mon, 25 Sep 2023 09:10:07 -0700 (PDT) MIME-Version: 1.0 References: <20230921192749.1542462-1-dianders@chromium.org> <20230921122641.RFT.v2.11.I022cfc2dcd30e77d4f7005a2d912dd7ab76c0338@changeid> In-Reply-To: From: Doug Anderson Date: Mon, 25 Sep 2023 09:09:54 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFT PATCH v2 11/12] drm/radeon: Call drm_helper_force_disable_all() at shutdown/remove time To: "Deucher, Alexander" Cc: "dri-devel@lists.freedesktop.org" , Maxime Ripard , "Pan, Xinhui" , "airlied@gmail.com" , "amd-gfx@lists.freedesktop.org" , "Koenig, Christian" , "daniel@ffwll.ch" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 25 Sep 2023 09:10:29 -0700 (PDT) Hi, On Mon, Sep 25, 2023 at 8:49=E2=80=AFAM Deucher, Alexander wrote: > > [Public] > > > -----Original Message----- > > From: Douglas Anderson > > Sent: Thursday, September 21, 2023 3:27 PM > > To: dri-devel@lists.freedesktop.org; Maxime Ripard > > Cc: Douglas Anderson ; Pan, Xinhui > > ; airlied@gmail.com; Deucher, Alexander > > ; amd-gfx@lists.freedesktop.org; Koenig, > > Christian ; daniel@ffwll.ch; linux- > > kernel@vger.kernel.org > > Subject: [RFT PATCH v2 11/12] drm/radeon: Call > > drm_helper_force_disable_all() at shutdown/remove time > > > > Based on grepping through the source code, this driver appears to be mi= ssing > > a call to drm_atomic_helper_shutdown(), or in this case the non-atomic > > equivalent drm_helper_force_disable_all(), at system shutdown time and = at > > driver remove time. This is important because > > drm_helper_force_disable_all() will cause panels to get disabled cleanl= y which > > may be important for their power sequencing. Future changes will remove= any > > custom powering off in individual panel drivers so the DRM drivers need= to > > start getting this right. > > > > The fact that we should call drm_atomic_helper_shutdown(), or in this c= ase > > the non-atomic equivalent drm_helper_force_disable_all(), in the case o= f OS > > shutdown/restart comes straight out of the kernel doc "driver instance > > overview" in drm_drv.c. > > > > NOTE: in order to get things inserted in the right place, I had to repl= ace the > > old/deprecated drm_put_dev() function with the equivalent new calls. > > > > Suggested-by: Maxime Ripard > > Reviewed-by: Maxime Ripard > > Signed-off-by: Douglas Anderson > > --- > > I honestly have no idea if I got this patch right. The shutdown() funct= ion > > already had some special case logic for PPC, Loongson, and VMs and I do= n't > > 100% for sure know how this interacts with those. Everything here is ju= st > > compile tested. > > I think the reason for most of this funniness is to reduce shutdown time.= Lots of users complain if driver takes a while to shutdown and there is a= point to be made that if the system is going into power down, there is not= much reason to spend a lot of time messing with the hardware. Sure, you don't want to do too much at shutdown time. That's the whole reason that "shutdown" doesn't do a full remove / uninitialization of all drivers. ...but drm_atomic_helper_shutdown() is documented to do the things that are important for shutdown. Specifically, it cleanly disables all of the displays. Depending on the display, this could avoid temporary garbage on the display at reboot time or it could even be important for the long term health of the panel. -Doug