From patchwork Tue Jun 13 23:15:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 775528 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3wnR6g6bFBz9sCX for ; Wed, 14 Jun 2017 09:38:51 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="j7/wo7NO"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753382AbdFMXiv (ORCPT ); Tue, 13 Jun 2017 19:38:51 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:36506 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753217AbdFMXiu (ORCPT ); Tue, 13 Jun 2017 19:38:50 -0400 Received: by mail-lf0-f67.google.com with SMTP id x81so14865255lfb.3 for ; Tue, 13 Jun 2017 16:38:49 -0700 (PDT) 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 :in-reply-to:references; bh=YrYLUhxk+YAcdlEwOB/1QO3dBXRVJMb0jHEld++o/d8=; b=j7/wo7NOTJCkyYa5nAz45NWWbUE0Mf3viwo94EMEmM2Skx+OBWM4FpNI0UuHbM2Pe6 OzEy3BMh0W3Te5AYMBq7bYAtCGar9zRHOfVTTuacNdTVtzpR58Awb1KZgIow3vyCutIH 7xlJRm5t0Z2penhQmF+Zb5CbmK/EDO7ukzXXvLWqun1MH02rgScNmTpgE9Rlt+KhBr6j Eepi9hYTsK9LlKK/bhZMYbCukxj5ewhIyXVJjijFml9psl4XTaJZF0AhjCI5bPmi/sYb y58LEUmVh+8uU7pmNKcL+ok2XJbk53Np9TyBJiZQjLFN/bZt5QK6iEX6lKxCic2CU8FT pqww== 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:in-reply-to:references; bh=YrYLUhxk+YAcdlEwOB/1QO3dBXRVJMb0jHEld++o/d8=; b=SrHXL9V/BYxX24nl9eMSD3HFpA3JjwH0HahaKz0LpwHv//0y7l9rEHcPKzD7kOCZFq 1Zmwi1avK/pE0UVMNTUKSsVV72iafi3Du/8COzIocAXcA2HXtJPKlHA9ts+636T9oWRJ xpTYjJCY+C/Mw/LUmz7SBF80MMP+N1xm6yPrYWWYmJn0JhB+NkjS+0mb8bRc5IOR87q4 Xq/npbTc7169A9XCrdd3sG8TTbRkMxJULgW0UwGSIiJT8Pv1RMMUt7r2OZNUFzlKxUyr Kw/EAQBDOlzddWD/9P4+Nsz9IyaD4DtpqaF9xLiMjtiqCKsa+I46ZSTC4olIgeCiK+Cy kJFA== X-Gm-Message-State: AKS2vOwG6rp6nBj3VY6M238MVyjuCCvYK8rDsIXNPWlRt2gZUE688PjW Fbia8cKMa2PZsv1c03c= X-Received: by 10.46.87.72 with SMTP id r8mr711240ljd.68.1497397128951; Tue, 13 Jun 2017 16:38:48 -0700 (PDT) Received: from localhost.localdomain (ppp109-252-91-7.pppoe.spdop.ru. [109.252.91.7]) by smtp.gmail.com with ESMTPSA id f27sm3785725lfa.27.2017.06.13.16.38.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Jun 2017 16:38:48 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Mikko Perttunen , Erik Faye-Lund Cc: linux-tegra@vger.kernel.org, DRI Development Subject: [PATCH v2 06/22] drm/tegra: dc: Avoid reset asserts on Tegra20 Date: Wed, 14 Jun 2017 02:15:45 +0300 Message-Id: <1c7b0c7bf713401073d648f9f228fa152c094a5a.1497394243.git.digetx@gmail.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org Commit 33a8eb8 ("Implement runtime PM") introduced HW reset control. It causes a hang on Tegra20 if both display controllers are utilized (RGB panel and HDMI). The TRM suggests that each display controller has its own reset control, apparently it is not correct. Fixes: 33a8eb8d40ee ("drm/tegra: dc: Implement runtime PM") Signed-off-by: Dmitry Osipenko Reviewed-by: Erik Faye-Lund --- drivers/gpu/drm/tegra/dc.c | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index 95b373f739f2..98ee6abb056c 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -30,6 +30,7 @@ struct tegra_dc_soc_info { bool supports_block_linear; unsigned int pitch_align; bool has_powergate; + bool broken_reset; }; struct tegra_plane { @@ -1856,6 +1857,7 @@ static const struct tegra_dc_soc_info tegra20_dc_soc_info = { .supports_block_linear = false, .pitch_align = 8, .has_powergate = false, + .broken_reset = true, }; static const struct tegra_dc_soc_info tegra30_dc_soc_info = { @@ -1865,6 +1867,7 @@ static const struct tegra_dc_soc_info tegra30_dc_soc_info = { .supports_block_linear = false, .pitch_align = 8, .has_powergate = false, + .broken_reset = false, }; static const struct tegra_dc_soc_info tegra114_dc_soc_info = { @@ -1874,6 +1877,7 @@ static const struct tegra_dc_soc_info tegra114_dc_soc_info = { .supports_block_linear = false, .pitch_align = 64, .has_powergate = true, + .broken_reset = false, }; static const struct tegra_dc_soc_info tegra124_dc_soc_info = { @@ -1883,6 +1887,7 @@ static const struct tegra_dc_soc_info tegra124_dc_soc_info = { .supports_block_linear = true, .pitch_align = 64, .has_powergate = true, + .broken_reset = false, }; static const struct tegra_dc_soc_info tegra210_dc_soc_info = { @@ -1892,6 +1897,7 @@ static const struct tegra_dc_soc_info tegra210_dc_soc_info = { .supports_block_linear = true, .pitch_align = 64, .has_powergate = true, + .broken_reset = false, }; static const struct of_device_id tegra_dc_of_match[] = { @@ -1989,7 +1995,8 @@ static int tegra_dc_probe(struct platform_device *pdev) return PTR_ERR(dc->rst); } - reset_control_assert(dc->rst); + if (!dc->soc->broken_reset) + reset_control_assert(dc->rst); if (dc->soc->has_powergate) { if (dc->pipe == 0) @@ -2063,10 +2070,12 @@ static int tegra_dc_suspend(struct device *dev) struct tegra_dc *dc = dev_get_drvdata(dev); int err; - err = reset_control_assert(dc->rst); - if (err < 0) { - dev_err(dev, "failed to assert reset: %d\n", err); - return err; + if (!dc->soc->broken_reset) { + err = reset_control_assert(dc->rst); + if (err < 0) { + dev_err(dev, "failed to assert reset: %d\n", err); + return err; + } } if (dc->soc->has_powergate) @@ -2096,10 +2105,13 @@ static int tegra_dc_resume(struct device *dev) return err; } - err = reset_control_deassert(dc->rst); - if (err < 0) { - dev_err(dev, "failed to deassert reset: %d\n", err); - return err; + if (!dc->soc->broken_reset) { + err = reset_control_deassert(dc->rst); + if (err < 0) { + dev_err(dev, + "failed to deassert reset: %d\n", err); + return err; + } } }