From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0863C04FF3 for ; Mon, 24 May 2021 13:19:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C6737610C8 for ; Mon, 24 May 2021 13:19:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232785AbhEXNU1 (ORCPT ); Mon, 24 May 2021 09:20:27 -0400 Received: from wnew3-smtp.messagingengine.com ([64.147.123.17]:37691 "EHLO wnew3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232401AbhEXNU0 (ORCPT ); Mon, 24 May 2021 09:20:26 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id 8A391395B; Mon, 24 May 2021 09:18:57 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 24 May 2021 09:18:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm2; bh=A4U8f622y15xN+ZagXBG9NpEC5 YDva9tV4Lav/1ucwM=; b=F3ynUO4APQaMxLO/ocrADPqrX6M27XLkniI2nEhnbj aajvXV6vvOKgSEAVvsP/4L600n9a4/MeUZop4nGHymNHJ9I9qeWDkMUzH2YwuR/x jxD2WIbA9mSTPMNFNaJZxAaLun4cWMRbTuh49L9+5/UeZ6pv30yED+lQ24N+ygn+ oxZ4pfaD3GgyvYf2BJvOdbvkc0Vhx/o7f17iX1jziXzqjKL35KeTLz9TATv3uIlW nR7UoVEDkYKC+Yaq7Cus6mSBBjCY2o7GjrHWvsNFAiyiiq996vQ61AYy5e70YK2Y 4h9Lkv1Am3AWkQVdsABgwSNvsiyBZ8OV5OL0yuOeIzwQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=A4U8f622y15xN+Zag XBG9NpEC5YDva9tV4Lav/1ucwM=; b=jzIUuTKnJfSXe7D9TrvlpHwRUFH+2/S9i pzlS0SNUF5ddkhNkJQ9qQSZx2gpAP89Si6joYT+wQ5N5uept7EPi13ostt4f9+CZ nrRVuWDIO1NlMZ1mcQo8WAiA8xDKxI45pF/c7gKdbInAZF4hHSi+PxuezivJG0TT ZyGJgWLoJlUIkb0Ak8u+KPTv4x7FbulGWerKZ95LakFglRyNV6zKgHp4Q+NsdunZ Hsna8g5QR8buCa54QsWtt7A44szBWcDDGyXJ4Q1qcTgnfBx3G63ipb3XswOYUt6j qXJDTWDeQoHrOVP2O9vyk70BwX7+RDj+duobk541KnIZSThwgtKmg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdejledgieegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffoggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhmvgcu tfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrthhtvg hrnhepjeffheduvddvvdelhfegleelfffgieejvdehgfeijedtieeuteejteefueekjeeg necukfhppeeltddrkeelrdeikedrjeeinecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomhepmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 24 May 2021 09:18:53 -0400 (EDT) From: Maxime Ripard To: dri-devel@lists.freedesktop.org, Daniel Vetter , David Airlie , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard Cc: Eric Anholt , linux-kernel@vger.kernel.org, Linus Wallei , Dave Stevenson , Phil Elwell , Tim Gover , Dom Cobley , Daniel Vetter , Hans Verkuil , Maxime Ripard Subject: [PATCH 1/2] drm/vc4: hdmi: Fix error path of hpd-gpios Date: Mon, 24 May 2021 15:18:51 +0200 Message-Id: <20210524131852.263883-1-maxime@cerno.tech> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If the of_get_named_gpio_flags call fails in vc4_hdmi_bind, we jump to the err_unprepare_hsm label. That label will then call pm_runtime_disable and put_device on the DDC device. We just retrieved the DDC device, so the latter is definitely justified. However at that point we still haven't called pm_runtime_enable, so the call to pm_runtime_disable is not supposed to be there. Fixes: 10ee275cb12f ("drm/vc4: prepare for CEC support") Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_hdmi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index c27b287d2053..ccc6c8079dc6 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -2039,7 +2039,7 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) &hpd_gpio_flags); if (vc4_hdmi->hpd_gpio < 0) { ret = vc4_hdmi->hpd_gpio; - goto err_unprepare_hsm; + goto err_put_ddc; } vc4_hdmi->hpd_active_low = hpd_gpio_flags & OF_GPIO_ACTIVE_LOW; @@ -2080,8 +2080,8 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) vc4_hdmi_connector_destroy(&vc4_hdmi->connector); err_destroy_encoder: drm_encoder_cleanup(encoder); -err_unprepare_hsm: pm_runtime_disable(dev); +err_put_ddc: put_device(&vc4_hdmi->ddc->dev); return ret; -- 2.31.1