Received: by 2002:a05:7412:f584:b0:e2:908c:2ebd with SMTP id eh4csp2395526rdb; Wed, 6 Sep 2023 03:36:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGzym8rEGNGIxeFsPsJoPnzzX/Xikz3b+LcFDKND4VKYht0imQUdNEmkbj8QQ5O6Il0v0h1 X-Received: by 2002:a17:906:74c4:b0:9a1:d29c:6aaa with SMTP id z4-20020a17090674c400b009a1d29c6aaamr1907232ejl.39.1693996577935; Wed, 06 Sep 2023 03:36:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693996577; cv=none; d=google.com; s=arc-20160816; b=V8lqaTeqylY2qbznXJxy7H6+MenPnW6iH2E5GGnEEMOw92XpJ3x33VDCq8mEpACf9R 7ii+xfdwJklvAywYpaugmgyhchS+QpTZd6tnU/SCYWScHFxfNBZCaIPGhI0yvnN2H7I1 qttqza7CL15R8O2c5K6eNk+40hRzntjoG5bca5IWfxhKS1Yk1fYPpQA3IuDaPwsI/HNq kn1kTfOpxp+Y2RIEcRAAqWXSAjB8d0lbvjYC0UjNqf0l1Tuk1My6nT9tZ6lc0dhY01gh U3889VqAQf3GER4XIvMpcnJd7PlqpQVfTR5/xoQ7gucL9XjDJGZPfGcwKF3fhOxWxnwg 47YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id; bh=LQF0ERQzzX5qKAb45UnIPLz6oIGXCp+Zpkc4pbBu/Yg=; fh=1Qkc6VXpgVZU2tSaX6C2B4NNDg9PSrcKZpR/x84/+V8=; b=a5uSw6kBuJNKf05QouZMeAy3573cOPT2Hhjrh0LbHHAm40G//BURLQA74TMCRi/SbG /GtfuH69szA0npQ5AsXoMyQmUJ6f/hiozxIp16S7KGzgOHAr+cqadLLDvTVV/u/40fR+ wdrzRuhOHfFPHHS5/40geTkhM5rHJ/igPduNwR6Q/qrZhnok8FB4cWXNvAd0yB3gFKag T8+2rt9IbfisD8x0wBIQtRl2asU1tdElEAI7b3/lX8p4WnTSBbtKYpWpyLpErAsSmqQX pEhbDpBNTdUFBSar7mXLhZaEV3wvhLrRilM5rgNlVJKUzAPqrbIW/FOpLdK3W1vPcxGE xlWg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i7-20020a170906444700b00992ee06bddbsi9057365ejp.176.2023.09.06.03.35.52; Wed, 06 Sep 2023 03:36:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238881AbjIFFrl convert rfc822-to-8bit (ORCPT + 99 others); Wed, 6 Sep 2023 01:47:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230129AbjIFFrk (ORCPT ); Wed, 6 Sep 2023 01:47:40 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C515DD for ; Tue, 5 Sep 2023 22:47:35 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qdlNy-0003L2-Ug; Wed, 06 Sep 2023 07:47:30 +0200 Received: from [2a0a:edc0:0:900:1d::4e] (helo=lupine) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1qdlNx-004MDD-Pt; Wed, 06 Sep 2023 07:47:29 +0200 Received: from pza by lupine with local (Exim 4.96) (envelope-from ) id 1qdlNx-0002Fq-0r; Wed, 06 Sep 2023 07:47:29 +0200 Message-ID: Subject: Re: [RFT PATCH 13/15] drm/imx/ipuv3: Call drm_atomic_helper_shutdown() at shutdown/unbind time From: Philipp Zabel To: Doug Anderson Cc: dri-devel@lists.freedesktop.org, Maxime Ripard , Sascha Hauer , airlied@gmail.com, daniel@ffwll.ch, festevam@gmail.com, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com, linux-kernel@vger.kernel.org, shawnguo@kernel.org Date: Wed, 06 Sep 2023 07:47:29 +0200 In-Reply-To: References: <20230901234202.566951-1-dianders@chromium.org> <20230901164111.RFT.13.I0a9940ff6f387d6acf4e71d8c7dbaff8c42e3aaa@changeid> <32186b941d6228a102b5e799aadf34206b58ac15.camel@pengutronix.de> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.46.4-2 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Di, 2023-09-05 at 13:29 -0700, Doug Anderson wrote: > Hi, > > On Mon, Sep 4, 2023 at 1:30 AM Philipp Zabel wrote: > > > > On Fr, 2023-09-01 at 16:41 -0700, Douglas Anderson wrote: > > > Based on grepping through the source code this driver appears to be > > > missing a call to drm_atomic_helper_shutdown() at system shutdown time > > > and at driver unbind 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 and at driver remove (or unbind) time comes > > > straight out of the kernel doc "driver instance overview" in > > > drm_drv.c. > > > > > > A few notes about this fix: > > > - When adding drm_atomic_helper_shutdown() to the unbind path, I added > > > it after drm_kms_helper_poll_fini() since that's when other drivers > > > seemed to have it. > > > - Technically with a previous patch, ("drm/atomic-helper: > > > drm_atomic_helper_shutdown(NULL) should be a noop"), we don't > > > actually need to check to see if our "drm" pointer is NULL before > > > calling drm_atomic_helper_shutdown(). We'll leave the "if" test in, > > > though, so that this patch can land without any dependencies. It > > > could potentially be removed later. > > > - This patch also makes sure to set the drvdata to NULL in the case of > > > bind errors to make sure that shutdown can't access freed data. > > > > > > Suggested-by: Maxime Ripard > > > Signed-off-by: Douglas Anderson > > > > Thank you, > > Tested-by: Philipp Zabel > > Thanks! I notice that: > > ./scripts/get_maintainer.pl --scm -f drivers/gpu/drm/imx/ipuv3/imx-drm-core.c > > Doesn't say drm-misc but also when I look at the MAINTAINERS file and > find the section for "DRM DRIVERS FOR FREESCALE IMX" That should probably say "IMX5/6" nowadays. There are a lot more i.MX that do not use IPUv3 than those that do. > it doesn't explicitly list a different git tree. I used to send pull requests from git.pengutronix.de/git/pza/linux, same as for the reset controller framework. I might still have to do that for changes in drivers/gpu/ipu-v3 that need coordination between drm and v4l2, but usually pure drm/imx/ipuv3 changes are pushed to drm- misc. > I guess the "shawnguo" git tree listed by get_maintainer.pl is just > from regex matching? The "N: imx" pattern in "ARM/FREESCALE IMX / MXC ARM ARCHITECTURE", I think. > Would you expect this to go through drm-misc? If so, I'll probably > land it sooner rather than later. I can also post up a patch making it > obvious that "DRM DRIVERS FOR FREESCALE IMX" goes through drm-misc if > you don't object. Yes, both would be great. regards Philipp