Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp457389imm; Thu, 26 Jul 2018 06:37:22 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdgEmgb8ZPKhs30qaD5S6BFCFa/tOTrSq1nr3ypPj/W9aBJ/2QpGWaOYoKTlHKoQR74dleA X-Received: by 2002:a17:902:b28:: with SMTP id 37-v6mr1969710plq.337.1532612242220; Thu, 26 Jul 2018 06:37:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532612242; cv=none; d=google.com; s=arc-20160816; b=ChNzMnuG2XJh00aClL7AJSayZ8uIuXHHEPDXFf5rbLWdI3JwNkl0ZX4BMETmZxwQ2m vwEkp3F+dy7zrRO+FqSXPAw0F9IZLJJBlDte8a9JFMGyELusgmTQPMDXLTbuE3fLT9UC WGEDbb4m98wInqFCmNE9Qzh4PJEjGEYodorW0ZGD0w69RxAc7CsnKDVDbTI7ha5AEY48 vjhKjWqnJRg+p43rsCIYUt0l8+Z2gpLcM81yd/51T2Dc0nieurbovsc9BvGNDipVLl3k 2qAPovk/emvzbWOBkFScc10Iq/WUEG6+PcTf2FW1m/BtnOvnN9ULsnqQbpjAaUOwtznZ KLHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=30oDltP7/vKP6oTX6UwpMIgFDD8ejlNRnvq8I2WNAKI=; b=UhAAIsfAei/5qnf+W0t7G3IXc2TUbQ2UYU0nK4J94TJV8HgNki0hdbJRsIGA4kFalD ANYGI+QtI/kyxuqk/Q3lpuz89QOCnicg4Mc+0X7aqFTXiTY2R2LY6yx1soQCQuJrdjaV +LBGsJenBfzyVQT73ynfhDsb+ATQCM48VUhBQRIv7r36xk+sGrjAcRx5Ah9voZeiGoJk 4s7DImDWXcEWFnQ+6PAuvYNP+8pCtKcuKddQGCZ4dWua1DbUAUqqu9/x1vKEqSW6r7eQ unDTWZ4ngdoEmaPftoqe+inIqOqdKX3uaDOP8pCDiQ/Jenl75hGxTfDS3LPe0yRn1ahL re3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b="vjv+Y2M/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u9-v6si1441777pfg.62.2018.07.26.06.37.06; Thu, 26 Jul 2018 06:37:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b="vjv+Y2M/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730843AbeGZOxI (ORCPT + 99 others); Thu, 26 Jul 2018 10:53:08 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:56442 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730106AbeGZOxG (ORCPT ); Thu, 26 Jul 2018 10:53:06 -0400 Received: from trochilidae.toradex.int (unknown [46.140.72.82]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 88D7B5C1E35; Thu, 26 Jul 2018 15:36:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1532612170; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:content-type:content-transfer-encoding: in-reply-to:references; bh=30oDltP7/vKP6oTX6UwpMIgFDD8ejlNRnvq8I2WNAKI=; b=vjv+Y2M/6JzgEySlGJPPi9KsCvfjeOq5la9quok8SYx9IMlTlcnLtpz6BhH9/krXWawyPO RAP/PgViOPqPLx5iDSm+XCQKAzdcUClvOhQtZzHE1x7+YHodxcRJ5izLNIv57RrVNuFvDd 8KnP3bbUIElBzxxx9ZVGz6+XcmY3EZI= From: Stefan Agner To: thierry.reding@gmail.com, airlied@linux.ie Cc: jonathanh@nvidia.com, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, Stefan Agner Subject: [PATCH] drm/tegra: return with probe defer if GPIO subsystem is not ready Date: Thu, 26 Jul 2018 15:36:06 +0200 Message-Id: <20180726133606.14587-1-stefan@agner.ch> X-Mailer: git-send-email 2.18.0 X-Spamd-Result: default: False [-2.10 / 15.00]; TO_MATCH_ENVRCPT_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_SEVEN(0.00)[7]; FROM_EQ_ENVFROM(0.00)[]; DKIM_SIGNED(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; MID_CONTAINS_FROM(1.00)[]; ASN(0.00)[asn:6830, ipnet:46.140.0.0/17, country:AT]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If the GPIO subsystem is not ready make sure to return -EPROBE_DEFER instead of silently continuing without HPD. Reported-by: Marcel Ziswiler Signed-off-by: Stefan Agner --- drivers/gpu/drm/tegra/output.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tegra/output.c b/drivers/gpu/drm/tegra/output.c index ffe34bd0bb9d..4bcefe455afd 100644 --- a/drivers/gpu/drm/tegra/output.c +++ b/drivers/gpu/drm/tegra/output.c @@ -133,7 +133,9 @@ int tegra_output_probe(struct tegra_output *output) output->hpd_gpio = of_get_named_gpio_flags(output->of_node, "nvidia,hpd-gpio", 0, &output->hpd_gpio_flags); - if (gpio_is_valid(output->hpd_gpio)) { + if (output->hpd_gpio == -EPROBE_DEFER) { + return -EPROBE_DEFER; + } else if (gpio_is_valid(output->hpd_gpio)) { unsigned long flags; err = gpio_request_one(output->hpd_gpio, GPIOF_DIR_IN, -- 2.18.0