Received: by 2002:ab2:6f44:0:b0:1fd:c486:4f03 with SMTP id l4csp28145lqq; Wed, 12 Jun 2024 15:25:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX6CRtdoPB3wDpLmUT6aJojj0iQ/wy9AWtColtYczYZa/+Ufjw8DEy1XGLdEZDvJA7KIpSGAKCYlmrkrf31a7JgKb/ODn3WyAH5CVaLrg== X-Google-Smtp-Source: AGHT+IGkIzZRukbJdoLEnOJCGZ7JXOy6DJBhtTiqRNmGJYxdlcEVC/vEBA9juGLg0v2nA3gOj14E X-Received: by 2002:a05:620a:28c2:b0:795:5546:5d7d with SMTP id af79cd13be357-797f613012bmr339730785a.17.1718231132142; Wed, 12 Jun 2024 15:25:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718231132; cv=pass; d=google.com; s=arc-20160816; b=K2IYxC44WOTEKmBZLn17IvI2zx96BL0PyOjwV6ROoq3HSBq22R9w472WY6h1xsbhct rXhn8PXUl5LA4eFfyKg7q+QYsZ8nXE7BdUSV/1oUWYlCk3caVQ72xa4apA5VWkhZWcQ5 MymAZ3Wn09ecn29pqWEH0bqvIRPCbctkdkDACUcpMv9SzR8ZG8yYAE+YzWUzz9TSJScZ irQR7bCpuErJPndGxEPJk6P8WMwzqVZZD2xu0zWKZT+zdRprkAbCIPDou6e9DoUXzgQK gvEGWyxmN6MpEQAlDwQ+YYwtRnfKqdHhqd42wZY4ueZq/wmRfT6/Tk8C1qHD9xOLJaVB JFiA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=zpmQn9g7cRN67S7SSaIwDQvRoODph3OOMStNp4IKliA=; fh=bhBlLsyea6MhDCnCGUaaklm5vIY2gDmKKrsvibWEs6c=; b=orb4mkrGSVxbNPgfjOCJgVLuoXhTN6FU9xXCdiTWH5yv0wYvQoZnhdGY6TNvSf9oa1 t3Td77ftSb0hPG8ijRB4vCXfE/oToRmdHssArRFbxW/C5iCdYrxNGJBDyrlbP5x7ilms YJxvuFOwrLcryRqN+NEaa1AOZ5WJubPkeqHeoGX+36Oj+h69pHIgK0mpGcJviTt+MmgR YD73DQNh1cQYiGg2AIVr2Q/wd43bfTgSFz/rBkuUeE4aaUZmpBFWRnO+3hAwN1/uIWeE qHkMcYrQeqvfKJuIgIrcrqRgvnRp6I0u/SelmIO5HwBfUmPpAtXhZVlrtV8/D7P7U2eH u8oQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dP8qkp8L; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-212318-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212318-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-798abe598b7si1815785a.632.2024.06.12.15.25.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 15:25:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-212318-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dP8qkp8L; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-212318-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212318-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D73971C2270E for ; Wed, 12 Jun 2024 22:25:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DA90E12D1FF; Wed, 12 Jun 2024 22:24:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="dP8qkp8L" Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C9CAA12CDB2 for ; Wed, 12 Jun 2024 22:24:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718231094; cv=none; b=QIS/NFym4iaWVFVHt66VHrwlpqXmAL+HgocgPc/MfcxTVNDSmy0aauk2dMidFgSH6Sm7Kj30f4Xov6ne3yT3IJy6bU0d9jMQJfk52pJqn0GMhz+s2fQCTsNkVB/JqKVphr1N3f9rwpT47CNX2LygXNEjbLzbVCOF/nGOzLo0/BE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718231094; c=relaxed/simple; bh=t3yv9e1EzMXtPY6KnpScajrOJgyZidM/cqL/We5XO9Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CrZYAdkW8P8nv8vJTapm77gLUfzp+nCZvzhZ2SljjRLUfIDCitxZh+5L64aFNHC6NsvG8RkFYpon3wDe+RbCsYydCRGlgtsj6rpHFTeLk6A0nJEm2Gz1/ycAdyD7BBTrmp07hxOVCfsan6tNW29kyYfRASoGS/JyGCkqBBMIA58= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=dP8qkp8L; arc=none smtp.client-ip=209.85.214.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-1f6fabe9da3so3886215ad.0 for ; Wed, 12 Jun 2024 15:24:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718231092; x=1718835892; 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=zpmQn9g7cRN67S7SSaIwDQvRoODph3OOMStNp4IKliA=; b=dP8qkp8Lg+k1/d/wQ+63ftRNYeBDI742xoAoNOkKSXgBoCNZwuqLk53ZeuwlGJZcC0 FQDIeJ9qBrZU80fkWx1sghO6+QYEkKyRe0ZJC3In/r/sp1hHKsocsqzF1jR2+I0aMsY1 SUq2rwVbxT5xYl18m99gcxyNbZDd1lgBRAq14= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718231092; x=1718835892; 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=zpmQn9g7cRN67S7SSaIwDQvRoODph3OOMStNp4IKliA=; b=FNn/ixG0AWaFANvSjOSJWuihuMfPu1Aqcgy/g/a+GmwKCGjHsM/qFv11IkZ2IqE2OD Zl0fEdCpWRsI/ai6s2dHmgIgZ5FHcAvXC6B8V6kTMy8rrnmsR6PdZyeT71ZH02WrM4ag O6SfSWw1j0vJSDFKmIe75T9no3yT2r173Lvot5fPxPX2o2YrIhBp6YzFMdT+2Iw7RXP0 2YAStKtS8/UMjjvc31GQSs0VVa58ufgV4+gnOS5UeSB39gGOvhPLDJVdnGcrr7vJBC4f y074tKlQ2PI/M+AwbgzxtM4bw4Wwj8AijSXBiLaJ783lUqDxZC5DVChC7a1JUHSvOGY6 EpZA== X-Forwarded-Encrypted: i=1; AJvYcCUeMuQa4TrzSlQiG13VA+SEkphfC2UmcDgVWg2Lpd9gJPgABMflx7u2NKb2MgZtvmMk4H1iCs+vf4TDf3p7i9Ij1H6woABBgBWyz/e9 X-Gm-Message-State: AOJu0Yyxh1mgbmbO2xdaOSIwfiGwJDxrY5MOlHez5NjcVYYlpsCs8Lat NKZFi7aXs14YCDDk/MNjKANUFMND1EAAZdY5itxto8RIKJuIu/wMfBrzEAl3OQ== X-Received: by 2002:a17:902:e750:b0:1f7:2a95:f2f8 with SMTP id d9443c01a7336-1f83b55e32cmr41999395ad.14.1718231091823; Wed, 12 Jun 2024 15:24:51 -0700 (PDT) Received: from dianders.sjc.corp.google.com ([2620:15c:9d:2:2816:6a42:9074:18cc]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f6f30acda9sm87914105ad.198.2024.06.12.15.24.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 15:24:51 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Douglas Anderson , Daniel Vetter , David Airlie , Jonathan Hunter , Mikko Perttunen , Thierry Reding , linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH v2 3/8] drm/tegra: Call drm_atomic_helper_shutdown() at shutdown time Date: Wed, 12 Jun 2024 15:23:43 -0700 Message-ID: <20240612152336.v2.3.Ifb4450979b62976fd5a98847dade2e5b377d47c8@changeid> X-Mailer: git-send-email 2.45.2.505.gda0bf45e8d-goog In-Reply-To: <20240612222435.3188234-1-dianders@chromium.org> References: <20240612222435.3188234-1-dianders@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 03d1c76aec2d..d9f0728c3afd 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -1330,6 +1330,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) { @@ -1398,6 +1403,7 @@ static struct host1x_driver host1x_drm_driver = { }, .probe = host1x_drm_probe, .remove = host1x_drm_remove, + .shutdown = host1x_drm_shutdown, .subdevs = host1x_drm_subdevs, }; -- 2.45.2.505.gda0bf45e8d-goog