Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1451683pxu; Thu, 17 Dec 2020 10:13:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJyxtIw/jMZcWmdnTfGpri5WkFgQJ22ZzuLQhANgsOhwAxDsf4/HoaVXS3hCdSybTI3K82ZK X-Received: by 2002:a17:906:31d2:: with SMTP id f18mr196736ejf.407.1608228783103; Thu, 17 Dec 2020 10:13:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608228783; cv=none; d=google.com; s=arc-20160816; b=eRl2ppIUVcLW+N/kYiKjpY+DJ+bTR3niJCqkrmrkWNYcpdf4/rwHKn+DfsDZqPe2ae x0DgXGFOCtLVDJI2AI/L15BKpfGadl+L0GMhQTUF7jHfTKXQTUulQU1R/SVVX+Ze0v/S AyiCzDdyYLrztifDSn4aAowKeceMrq8rmA7lM3gcpjHrqDzfDNcPQJLikP5JUPVmely6 16nLxuzXl5Dnuf1VmvgyTJGaCaGQS6XVg37w/RegCq7m8DpitLT0PICfrvbZYGOatOZp Eo5Sfmh9ovVbHH1+xe5IBB/s++zR8v2a9k2xWxgLUs5IAkLIStr0gDzsKMWmEVMBengi Fi1Q== 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=wuUSQP0OtIE+mP7axrK+mquBQR4cpQ2zlYIqVpImR1U=; b=QV9KaOQR2UkFpahlTKsIuPgfEs2/of1JZ9L6AJNnNbStMDySbJvfj1YYpZKEmovk4A +8OoIq+ZGIYvhXeKh5rnWP5X5a2OyCIAQmLZJT3Lgsk761ZvitAUs1cARM0r1wy4nkKU NfxD9Qg0RV0ztGLai0LVv2S/TV5Y8ZFWb6LNX9IKg382Avf2u1KXbB0f5E+eNBxUOnx9 HC6ReD1d31CP2VJDnigU021mUMl0rKmAn05Xq72Gii3bwaoJnnWdRKXo1TeJm5pzk3GX 1nnLhuwMbgxlj2MJkc586yiFJoYOd82BaFZTyyfxGkRVCAensAmmYPsu6sirRmNgqSCJ 2Mww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MZKp8LNg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e22si4669617edv.437.2020.12.17.10.12.38; Thu, 17 Dec 2020 10:13:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MZKp8LNg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731100AbgLQSJU (ORCPT + 99 others); Thu, 17 Dec 2020 13:09:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730915AbgLQSJN (ORCPT ); Thu, 17 Dec 2020 13:09:13 -0500 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F1DAC061142; Thu, 17 Dec 2020 10:08:06 -0800 (PST) Received: by mail-lf1-x130.google.com with SMTP id m25so59783468lfc.11; Thu, 17 Dec 2020 10:08:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wuUSQP0OtIE+mP7axrK+mquBQR4cpQ2zlYIqVpImR1U=; b=MZKp8LNgdIqZ2QOb3p3qyevaT+0a/84boORQxHR3hMaNXrSC3gadV90vMzkpXywlqO FckztaIM7VXhOnRqguINXOzS4tF2j9k6itr8yj4O2R9bvxTZ/5XixyVBxPEKIdnIzXxo K9gvy8DIjfa3cSxXV0BsPlII7FabiMWQBhxX1bphvlTMt5TlBRx/Lqpr0Dj3sXiRPgcU tPbBkxDFx22kc8Mr/3oOm9b66RzF8/Qd6eZel5uaevmeWnNeT6xQAp9AqNyvnwQYUoKA ikQV9S/5J0i2cxw4+ghP0Hu85LAVoVOVLj9Qy1KHWVmv6zagA/Zo/kAP7wNFjF7gI+2L n4nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wuUSQP0OtIE+mP7axrK+mquBQR4cpQ2zlYIqVpImR1U=; b=kpvHECqxdjxRnf+0/ZSbe+nils5ouRtkbnQC7FfV4fxsdVu0jvMzkxZDtKgVJ4kT00 +cpajaLooNxU0aSwButrh+0DMc6CTWezQJHKVdn0UQhVu6LY2+q6iaFeM71KsEv29U5P p24RQEEfyCqo+JMCun1aGA2VKJX7efW4zlZtyExPyAtPMUNZdcC1U5AvS0NDSWBIFmUA +t0xyV2/1TD7ZBcV/7iHbyWxq1PdVF7fM0THt5iDVb8H81h0F65vBAQPp9ZhItf6c47/ JyivWiqk3Cis8k/nwTn6ep45Nk/O8tMvTPcKisNNCjho8zCwBB6XuTSRQF01bSWLd/4p tiOw== X-Gm-Message-State: AOAM532CdN36ieJ4HSYDcuKS/aZzrtu3ec3s12+N6MQnNK/ZOisDGny6 70OPdKerPsTa7ibUIFXTW4Q= X-Received: by 2002:a2e:b70f:: with SMTP id j15mr240665ljo.60.1608228485098; Thu, 17 Dec 2020 10:08:05 -0800 (PST) Received: from localhost.localdomain (109-252-192-57.dynamic.spd-mgts.ru. [109.252.192.57]) by smtp.gmail.com with ESMTPSA id u5sm655596lff.78.2020.12.17.10.08.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Dec 2020 10:08:04 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Liam Girdwood , Ulf Hansson , Mauro Carvalho Chehab , Rob Herring , Peter Geis , Nicolas Chauvet , Krzysztof Kozlowski , "Rafael J. Wysocki" , Kevin Hilman , Peter De Schrijver , Viresh Kumar , Stephen Boyd , Michael Turquette Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, linux-tegra@vger.kernel.org, linux-clk@vger.kernel.org Subject: [PATCH v2 39/48] drm/tegra: vic: Stop channel before suspending Date: Thu, 17 Dec 2020 21:06:29 +0300 Message-Id: <20201217180638.22748-40-digetx@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201217180638.22748-1-digetx@gmail.com> References: <20201217180638.22748-1-digetx@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Host1x channel should be idling before hardware is turned off, hence stop the channel in the suspend callback. Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/tegra/vic.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/gpu/drm/tegra/vic.c b/drivers/gpu/drm/tegra/vic.c index ade56b860cf9..92d3d48c4277 100644 --- a/drivers/gpu/drm/tegra/vic.c +++ b/drivers/gpu/drm/tegra/vic.c @@ -510,8 +510,23 @@ static int vic_remove(struct platform_device *pdev) return 0; } +static __maybe_unused int vic_suspend(struct device *dev) +{ + struct vic *vic = dev_get_drvdata(dev); + int err; + + host1x_channel_stop(vic->channel); + + err = pm_runtime_force_suspend(dev); + if (err < 0) + return err; + + return 0; +} + static const struct dev_pm_ops vic_pm_ops = { SET_RUNTIME_PM_OPS(vic_runtime_suspend, vic_runtime_resume, NULL) + SET_SYSTEM_SLEEP_PM_OPS(vic_suspend, pm_runtime_force_resume) }; struct platform_driver tegra_vic_driver = { -- 2.29.2