From patchwork Wed Dec 20 11:32:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume Tucker X-Patchwork-Id: 122457 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5445726qgn; Wed, 20 Dec 2017 03:33:08 -0800 (PST) X-Google-Smtp-Source: ACJfBotgL0WoaRgGaNwIzm5eswDz/3RylrYTwq8nEuPUgXFLWHK20HmdDaSAStCWqc3m5pCXsIMy X-Received: by 10.99.176.69 with SMTP id z5mr6254306pgo.131.1513769588680; Wed, 20 Dec 2017 03:33:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513769588; cv=none; d=google.com; s=arc-20160816; b=oIvVeJs8/fOZXk7Pyad7p8WVOuBot+L9fjZPqkOLNTUcp3dQCkxZ0xlKi6P/4d6Nig i5s9QCb0kOxcIv3mS33EKE4MwvBeLLwkedbHMuQdylA2aSs/8I7mzuXrQTFDUx0UNYFG UosF94C+4B567hsEX7q8MYs1Q8PoiOztU/s+kapYY+1pZrN7Jei/ANUmLzhKbJB59db9 p66Xea8NXb7ZxRt2vuCNogoE9t+OeSruiPLy0feiVY+5q37nfpJfejMo52cOr5Xj9GVE c4Et9cvbm5LP6Od02Jb/t9ye/JfAjyHddiX6LoWGflp+AP+JpyJhWE+HDzyl7xSLsMq2 zjZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:references:in-reply-to:references:in-reply-to :message-id:date:subject:to:from:delivered-to :arc-authentication-results; bh=LoMIo1bYiaLrzhJmO/2Z6vSKz3Kpax3NFpHGFOhnGko=; b=hKK70zhVHS7HX0zmfXeDBY6Wa2y7BUpD781t5wCgbOUp5H8jYAmluZwANxstC6xqMT Ko8q5eyCOTDIo5/aN1nYl/TN0iVxZcLszKr2joqXm5sR9EIg0yYlRRIci6cQJcuAH/27 ZfiVHaHn8wDjxnbP5w6PM23uyVpc6BFoUsyeGtkW78U2E/J4u2C/bUiMlVBo26fela0j QIo+5JewEAv4A4e7nxpLtS/aLjLZMsTVeruiIwFRzhIPQ22wZ7awMZg2xfvyPzkLtfSy AC97uMU6GZXP6VwHSryHuRS4IxYWI0Ls8Jv49OJ5e0pHS2zE//M3dcxl0pM4Fqi7cJ8N E2UQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id h1si12885277pln.798.2017.12.20.03.33.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Dec 2017 03:33:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 67861899D6; Wed, 20 Dec 2017 11:33:07 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by gabe.freedesktop.org (Postfix) with ESMTPS id 71FE3899D6 for ; Wed, 20 Dec 2017 11:33:06 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: gtucker) with ESMTPSA id 493882717FE From: Guillaume Tucker To: Thierry Reding , Jon Hunter , David Airlie Subject: [RFC PATCH v2 1/1] drm/tegra: sor: Fix hang on tegra124 due to NULL clk_out Date: Wed, 20 Dec 2017 11:32:23 +0000 Message-Id: <0f776b7500ee0e74b316b9803803b309779d2ff7.1513768618.git.guillaume.tucker@collabora.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: Cc: linux-tegra@vger.kernel.org, Guillaume Tucker , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" When neither HDMI nor DP is supported such as on the tegra124, the sor->clk_out is not initialised and remains NULL. In this case, the parent clock can't be assigned to it so revert to the previous behaviour of assigning it to the main sor->clk instead. This fixes a kernel hang on tegra124 and should also affect tegra210 as they both don't support HDMI and DP. Tested on tegra124 only. Fixes: e1335e2f0cfc ("drm/tegra: sor: Reimplement pad clock") Signed-off-by: Guillaume Tucker CC: Thierry Reding --- drivers/gpu/drm/tegra/sor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c index b0a1dedac802..a344f66d4ecb 100644 --- a/drivers/gpu/drm/tegra/sor.c +++ b/drivers/gpu/drm/tegra/sor.c @@ -255,7 +255,7 @@ static int tegra_sor_set_parent_clock(struct tegra_sor *sor, struct clk *parent) clk_disable_unprepare(sor->clk); - err = clk_set_parent(sor->clk_out, parent); + err = clk_set_parent(sor->clk_out ? sor->clk_out : sor->clk, parent); if (err < 0) return err;