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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 13906EED60D for ; Tue, 19 Sep 2023 07:31:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:To:Subject:MIME-Version: Date:Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=MfSC3y9kW3lo476MiaWoc4VyVoaVvzQs+R3aW937Cp0=; b=tMMQnxXHTHbi7TwQL5557gxHcH JWKLzP+tv3hixeIzeWUUbTu7V2TuVb6yWtgQW4CmjKUJyeX+46BXQ9+WahmvO+iLOCJ7W5xEinjrN RvZpWReRMHq+j9z2oZH8wcMPXG+8SFW115wP3Igd2xUhwsEDThMvwpKP6BertAIJOs1MlsO8Ki4dI C4/SWkbGDd10s9NkkttOewvduAtmd9wuTduqQdZw2doXu3W80fMNQ6ufOwnT99Slt1UePWp1v/+XS FHVyInJ7xi1xpTbbE2LgqIEhh4Elgg0cKX1hjP8YAzR0BGbS3RQsa5OilkV8G28S1hzzT6sY+g3ec BNlJAghg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qiVCV-00HExf-03; Tue, 19 Sep 2023 07:31:15 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qiVCS-00HEwA-1B for linux-arm-kernel@lists.infradead.org; Tue, 19 Sep 2023 07:31:13 +0000 Received: from [192.168.88.20] (91-154-35-171.elisa-laajakaista.fi [91.154.35.171]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 57854FA2; Tue, 19 Sep 2023 09:29:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1695108574; bh=DQnS4aIKIh13ovdc7BzfWH9E6TxBe1gPiyTE4ZjyNYY=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=BOesDxxoV/01VlAhluf7YLPC/1LY5v6DUSAmbryylQA/UVNncmcoPm89AX/9XYQ6d nW4D4fbSVh5QAPCRVAPFeL6NrYodQDHDg4hKu5ZyPB9+abblvv6BOZXW80KLAK5An8 zKVe1L0FDrNX/uErlZKXCnkz1zj3Og7O87huezYg= Message-ID: <06ac6d3b-e82e-dd25-ab21-90db76f3a5fd@ideasonboard.com> Date: Tue, 19 Sep 2023 10:31:05 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [RFT PATCH 2/6] drm: Call drm_atomic_helper_shutdown() at shutdown time for misc drivers Content-Language: en-US To: Douglas Anderson , dri-devel@lists.freedesktop.org, Maxime Ripard References: <20230901234015.566018-1-dianders@chromium.org> <20230901163944.RFT.2.I9115e5d094a43e687978b0699cc1fe9f2a3452ea@changeid> From: Tomi Valkeinen In-Reply-To: <20230901163944.RFT.2.I9115e5d094a43e687978b0699cc1fe9f2a3452ea@changeid> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230919_003112_556750_6EC884A0 X-CRM114-Status: GOOD ( 20.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.belloni@bootlin.com, xinliang.liu@linaro.org, linus.walleij@linaro.org, liviu.dudau@arm.com, linux-hyperv@vger.kernel.org, stefan@agner.ch, wens@csie.org, jstultz@google.com, kraxel@redhat.com, airlied@gmail.com, sumit.semwal@linaro.org, yongqin.liu@linaro.org, samuel@sholland.org, sam@ravnborg.org, javierm@redhat.com, jernej.skrabec@gmail.com, drawat.floss@gmail.com, kong.kongxinwei@hisilicon.com, alain.volmat@foss.st.com, linux-sunxi@lists.linux.dev, suijingfeng@loongson.cn, tzimmermann@suse.de, alison.wang@nxp.com, airlied@redhat.com, virtualization@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, jfalempe@redhat.com, bbrezillon@kernel.org, linux-kernel@vger.kernel.org, christian.koenig@amd.com, paul.kocialkowski@bootlin.com, spice-devel@lists.freedesktop.org, daniel@ffwll.ch, alexander.deucher@amd.com, tiantao6@hisilicon.com, claudiu.beznea@microchip.com, zackr@vmware.com Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 02/09/2023 02:39, Douglas Anderson wrote: > Based on grepping through the source code these drivers appear to be > missing a call to drm_atomic_helper_shutdown() at system shutdown > time. Among other things, this means that if a panel is in use that it > won't be cleanly powered off at system shutdown time. > > The fact that we should call drm_atomic_helper_shutdown() in the case > of OS shutdown/restart comes straight out of the kernel doc "driver > instance overview" in drm_drv.c. > > All of the drivers in this patch were fairly straightforward to fix > since they already had a call to drm_atomic_helper_shutdown() at > remove/unbind time but were just lacking one at system shutdown. The > only hitch is that some of these drivers use the component model to > register/unregister their DRM devices. The shutdown callback is part > of the original device. The typical solution here, based on how other > DRM drivers do this, is to keep track of whether the device is bound > based on drvdata. In most cases the drvdata is the drm_device, so we > can just make sure it is NULL when the device is not bound. In some > drivers, this required minor code changes. To make things simpler, > drm_atomic_helper_shutdown() has been modified to consider a NULL > drm_device as a noop in the patch ("drm/atomic-helper: > drm_atomic_helper_shutdown(NULL) should be a noop"). > > Suggested-by: Maxime Ripard > Signed-off-by: Douglas Anderson For omapdrm: Reviewed-by: Tomi Valkeinen Tested-by: Tomi Valkeinen Tomi _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel