Received: by 2002:a05:7412:f584:b0:e2:908c:2ebd with SMTP id eh4csp2060057rdb; Tue, 5 Sep 2023 13:07:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFpnwR4Zdyy7OwRZ7Fh6m/jNhP4Tj6g4Qezq+ucX4OBKVf4wYacaBoPsBWao9C5PsG87nwk X-Received: by 2002:a17:90a:ea92:b0:269:32d2:5ac4 with SMTP id h18-20020a17090aea9200b0026932d25ac4mr13876247pjz.25.1693944472063; Tue, 05 Sep 2023 13:07:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693944472; cv=none; d=google.com; s=arc-20160816; b=u3ifC8BbPG+mDbQoP4bQYqTlTrLT97d7+mKGhecfvzkjSO8PiiJn70AKiOFb/DzDrv NDIjcH/QzMFq2mL9RAuHpTPstHUIW33ek93ghRMzDiPMiY+Fec/Imbik8Bbdabn5iGos If0eKk33Vo8CNhyXS5e2p+xYVNdvPpHk8B9CQHt5N5Mpk4V/GkaNuL9/lYCqgOgOpJl8 PVcII2I1XbIB4kwPWOzcootS9/oStialJvmCeOexn7P/T4RUlLQImgPFzg753DorrOWC /mD/xI/EPPdmBHkIFlclR8vKjGxvHKQSrtdh7MxkUdaP0h0xw2gVuU1iTUPEDpAI7xT4 z+lA== 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=inXeCG/cEx+Jw194TNi+Whyu96dOK3GXZan8S7oya+M=; fh=SOHt+LDZY60XLuxa/2WsK6LqSjGxqkGwAyru6t5Ry5U=; b=j74hp0TgtHuKQYpiDFmyq7ZxcTydoGwqAmf18DM5XUrtzWGIbYP+M2/+B5t3tdgQFP WMH2GOIMr9Vf4r+Pb0cBrSqrQVh0/kf5T9x4jLoJByVJjgxleXrNZH/3j6cCs+9BLPeC 0ZVOHKWpQnjo3fahfzDxtKdMWgS9Tpb58v5Fu+2gh3YmPwtVRP3ze0Co6bxIJq51+tuX bLAbRhuxfRxnm6j88THIwI+kySSxhMSS0uuu7qdAGxzbByvSZbJSQVy+FgjNjl7MOWkX 5EkRPYqL2tScvGsWAj8FQPIR+muFUJkgUFNRl2Oof2q7s6y46hyxk2U1PPeTjVCiGXUK N+fw== 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 c14-20020a17090abf0e00b00262ffca5a31si12693083pjs.161.2023.09.05.13.07.50; Tue, 05 Sep 2023 13:07:52 -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 S235456AbjIDItW convert rfc822-to-8bit (ORCPT + 7 others); Mon, 4 Sep 2023 04:49:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229847AbjIDItW (ORCPT ); Mon, 4 Sep 2023 04:49:22 -0400 X-Greylist: delayed 1107 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 04 Sep 2023 01:49:18 PDT 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 5F8F4128 for ; Mon, 4 Sep 2023 01:49:18 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1qd4yl-0000TY-S1; Mon, 04 Sep 2023 10:30:39 +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 1qd4yk-003plv-G3; Mon, 04 Sep 2023 10:30:38 +0200 Received: from pza by lupine with local (Exim 4.96) (envelope-from ) id 1qd4yk-0005BW-0h; Mon, 04 Sep 2023 10:30:38 +0200 Message-ID: <32186b941d6228a102b5e799aadf34206b58ac15.camel@pengutronix.de> Subject: Re: [RFT PATCH 13/15] drm/imx/ipuv3: Call drm_atomic_helper_shutdown() at shutdown/unbind time From: Philipp Zabel To: Douglas Anderson , dri-devel@lists.freedesktop.org, Maxime Ripard Cc: 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: Mon, 04 Sep 2023 10:30:38 +0200 In-Reply-To: <20230901164111.RFT.13.I0a9940ff6f387d6acf4e71d8c7dbaff8c42e3aaa@changeid> References: <20230901234202.566951-1-dianders@chromium.org> <20230901164111.RFT.13.I0a9940ff6f387d6acf4e71d8c7dbaff8c42e3aaa@changeid> 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 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 regards Philipp