From patchwork Thu Sep 21 19:26:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 143060 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp5252773vqi; Thu, 21 Sep 2023 18:22:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHg+f8Zg93eRt7J3FxvlvE6dNxv7hhkbjoBlPq21FIXiqnbZPCoqMR0J3B0YytUQnfTK26q X-Received: by 2002:a05:6a00:24d2:b0:68f:c057:b54c with SMTP id d18-20020a056a0024d200b0068fc057b54cmr7186231pfv.1.1695345763247; Thu, 21 Sep 2023 18:22:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695345763; cv=none; d=google.com; s=arc-20160816; b=TklIYWcYAXDOeahmmH26FigICXiAIOWXlsqZERk5+atv4HmM1i5MCjxozfBCegRxB8 SqmydpXLkwuxobVvd3wU1uDSG4s5v1q/2x68eva9HV2yfYtfiz2QjEIvmcH0nV7k6lvC h2lbnCOCtKzWR+6JtDDe39kBGm9IruBgEBrv2QTnMnYItEM7XRELSYpKo6676nteIVMB USaK4jvGLVfa+SIDUj+7BVJek3aY3mCN4OpMZSbuVLITMS1Y5kST1GpbESB3vWi0LcPu O3ag8pSvUcirrYn5YNZ3HOQj+bf7dpxi/xf3y39shoQ+8bZL0QHwhm3EtmY0ofrntW7S Uzig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=EjE+v7+9YV8M91Wchnv2I6StT/F66BSqTQ0jlAjsGeo=; fh=IcQ7t2jYSX2sUMSLAAHg4fLKyqTczA22Et3CECFZmTs=; b=eHenYI6lnpn4aUO5nSQVIeLOKvHofw8J9JOmviN0oVG8T54QmD/BIA0iCmDVkGRZoz IpuQBbCtqGVPkDZoNIsEYYybUx0cJnEco970WCPKEnUlyQPjGdsgzzMYZw7uTNp0zseZ waYj71Ct0oUPoF7KhxN+ZVx3ZDGDivGvSQM4rOTdCOozRfdXwY+rvoEewSTk9SBhpGdG ILUcui7NwsOjBUt8imU9Fob9v7+KJaAHyJ8yd1cDz4pQOhgI+DVrR1HIaidDillKQsrl NHNqX8QgzYWAD20z5hJnw1coeLzNUjy9roBHK3aGj7pkH6q0TWf+as13ZX0cBiq70XS8 9kGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Bz1MvDOX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id bt25-20020a056a00439900b006901504b6a3si2693656pfb.153.2023.09.21.18.22.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 18:22:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Bz1MvDOX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 7E0C58080EF1; Thu, 21 Sep 2023 12:47:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230486AbjIUTr0 (ORCPT + 28 others); Thu, 21 Sep 2023 15:47:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230451AbjIUTrQ (ORCPT ); Thu, 21 Sep 2023 15:47:16 -0400 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 836DCA239E for ; Thu, 21 Sep 2023 12:28:30 -0700 (PDT) Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-577fb90bb76so797268a12.2 for ; Thu, 21 Sep 2023 12:28:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695324510; x=1695929310; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EjE+v7+9YV8M91Wchnv2I6StT/F66BSqTQ0jlAjsGeo=; b=Bz1MvDOX7w4+rP0FNtborBxKeiu3FaZeNyukwwR+dENSq0XFjkS3x58nk6JLljhkut 9Bf5b1xmPqCpm0hKi/d5PjJfmXDqp1C++oies7+hAuEvwdeDvUD+M9+tjdhGOuIU4DWz mbPP0JazvVEMqW6y57JGa1DfJhLXtbTvLXRAY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695324510; x=1695929310; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EjE+v7+9YV8M91Wchnv2I6StT/F66BSqTQ0jlAjsGeo=; b=sEHVOZ55Vqy1DsHbgRndFo5jgJ5Wb4EEIs5YgE+FnsR60Svx7brQVVqUrNOEfRpWGY KL8T0p2xzQFYcr3Kwh2TM+FcjDishqiRXHmPnku7P3Y/YX95WfNQcWv98/MFXgIFSQQK WJvqArh5+anY+LEOrqYaB3OEvlhlIItOLOPLKzv1znd0h1CkVZDp2z484bwj9GcVg2xQ Yzdj2lKP/lcEu9C3Zw8MuWOyApD4XucqmCt/4H+PbSX1/rHR+JaR9sJfruvEgVv70F2A Exr0z7mkrVWbDcEj6nVxFnhjU0Hil+o8tFYYDQam5Q+WYaXl+CibaBC+2pSHYgFo4X2r OS+g== X-Gm-Message-State: AOJu0YwWnkhOqGQzMnzqmbV0fLmarb7fHaa/pMJL0TPoFxM88sNdCPxf ubbxvJKNjQEk8LpmEuU66OP1GQ== X-Received: by 2002:a05:6a20:840d:b0:154:6480:83b4 with SMTP id c13-20020a056a20840d00b00154648083b4mr7513077pzd.14.1695324509805; Thu, 21 Sep 2023 12:28:29 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:e6ed:6d49:f262:8041]) by smtp.gmail.com with ESMTPSA id w8-20020a1709029a8800b001b9f032bb3dsm1892875plp.3.2023.09.21.12.28.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 12:28:28 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Douglas Anderson , airlied@gmail.com, daniel@ffwll.ch, jonathanh@nvidia.com, linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org, mperttunen@nvidia.com, thierry.reding@gmail.com Subject: [RFT PATCH v2 05/12] drm/tegra: Call drm_atomic_helper_shutdown() at shutdown time Date: Thu, 21 Sep 2023 12:26:48 -0700 Message-ID: <20230921122641.RFT.v2.5.Ifb4450979b62976fd5a98847dade2e5b377d47c8@changeid> X-Mailer: git-send-email 2.42.0.515.g380fc7ccd1-goog In-Reply-To: <20230921192749.1542462-1-dianders@chromium.org> References: <20230921192749.1542462-1-dianders@chromium.org> MIME-Version: 1.0 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,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Thu, 21 Sep 2023 12:47:47 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777698878670020952 X-GMAIL-MSGID: 1777698878670020952 Based on grepping through the source code this driver appears 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. Suggested-by: Maxime Ripard Reviewed-by: Maxime Ripard Signed-off-by: Douglas Anderson --- This commit is only compile-time tested. (no changes since v1) drivers/gpu/drm/tegra/drm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index ff36171c8fb7..ce2d4153f7bd 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -1312,6 +1312,11 @@ static int host1x_drm_remove(struct host1x_device *dev) return 0; } +static void host1x_drm_shutdown(struct host1x_device *dev) +{ + drm_atomic_helper_shutdown(dev_get_drvdata(&dev->dev)); +} + #ifdef CONFIG_PM_SLEEP static int host1x_drm_suspend(struct device *dev) { @@ -1380,6 +1385,7 @@ static struct host1x_driver host1x_drm_driver = { }, .probe = host1x_drm_probe, .remove = host1x_drm_remove, + .shutdown = host1x_drm_shutdown, .subdevs = host1x_drm_subdevs, };