From patchwork Fri Sep 24 15:23:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 12515709 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52800C433F5 for ; Fri, 24 Sep 2021 15:26:25 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 15EFA610D1 for ; Fri, 24 Sep 2021 15:26:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 15EFA610D1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=JpcGPWSX3Ytko4ozolIIBUXqfVhPH+7ceOVniB6gN/Y=; b=0m4KSDDNUpjHNd SY/MigSwmyRiawbbBXmcMqgRGdcKmmd1SsAF0P87TdLOgB3R9PW1EjpsY/h9lIuOAru/XlvK3Br3w qASeuRUjfSwODs6fTtQqaoBc8C+9+AcCkVvyMaw2TKlD2+CjqSd6Tn9bGmIaya8gHx/jVaI5hw/RF QaEg7eNPBjy+KKrPOBYHonW3uf/oFp0XBYtdIShsfTpzHqyZclosJcFiM8Q9wchfVs00LdpB9vK39 UF8VEPwHM3/oyTJkXp2vSmVDSmjsrQb8CCohXAHbaTBqeSJgppfEDHozmW1wfKKUrL9naduSKzcQb +rb3h5e2eyFOhaXAd76g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mTn3Y-00Ewr4-OR; Fri, 24 Sep 2021 15:24:08 +0000 Received: from new4-smtp.messagingengine.com ([66.111.4.230]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mTn3J-00EwqC-SE; Fri, 24 Sep 2021 15:23:55 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id 3D8DB580B9E; Fri, 24 Sep 2021 11:23:49 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 24 Sep 2021 11:23:49 -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=fm3; bh=QrihLJw+PqMglt9vJ3rR+dt0k5 kPyBCPrYDIyvIpEzQ=; b=x9JpMeRDQFUVZm8pA+hhuJZb4bY76XQM24kPY4KCCz oWFvky+Neuc4g1jJuBgZsly7slktI914mXrAlKJz4AwKC+NfVDqReuKX4kF+sT+h iC6rMknXBPctbsyb3obNX2TnRtN1J/4h97pDNFaVnyAQ9FmbEkq+4Zwy23XtZMP2 c/YIeMIcziuXWUIPXuG9SmnLjaihh/dEQKHPdPaKexUY2mLHLkqM7ltosVMIoF4C QqT2w4xLcRcMjroyHaMhoj55XmnSk/RBuw5aSkV72i0iHRuXFKYLzbleKASjabBW Zjn9xyBe5GUgXwLBEdk55WH6elnW5oc4IkuYdsu/1aMQ== 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=fm3; bh=QrihLJw+PqMglt9vJ 3rR+dt0k5kPyBCPrYDIyvIpEzQ=; b=n8t6FSRVLtr1+65tm2AjyYGhyvmnu3kdk MjUyPBx8dpwBowQ7wUK8nslp+LXM85msoodfvvMymNPsdV3OHVojkaUs9tSfcn9j 7+uNN2MaQsRPzMVDlcl/pdi6iZ/2H/YwEU+qvEWMH9bcTi5L3/Fwduocmfu5uY5d VSWahKtQ1vnEcPpnibYU2aAtV7bvTLkqLUBVUklBBKlLGp3Zfv7R2KDzpTcQr7Fy RdkyOqGF/mY/ffjHjGLKVgaX8D/llscjafEpeeED2t9FgolTpAroTYabmxHHSb5T gm7Yu21+/nSkK9BITCMFe8lPcaSAaRsxVXa7FprMQzGRqbX0+x/TQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudejuddgkeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffoggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhmvgcu tfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrthhtvg hrnhepjeffheduvddvvdelhfegleelfffgieejvdehgfeijedtieeuteejteefueekjeeg necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhgrgi himhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 24 Sep 2021 11:23:46 -0400 (EDT) From: Maxime Ripard To: Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Daniel Vetter , David Airlie Cc: Linus Torvalds , linux-rpi-kernel@lists.infradead.org, Florian Fainelli , Nicolas Saenz Julienne , linux-arm-kernel@lists.infradead.org, Nathan Chancellor , Randy Dunlap , Stephen Rothwell Subject: [PATCH v2] drm/vc4: Unselect PM Date: Fri, 24 Sep 2021 17:23:34 +0200 Message-Id: <20210924152334.1342630-1-maxime@cerno.tech> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210924_082354_245040_07D42DC2 X-CRM114-Status: GOOD ( 16.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org It turns out we can't select PM when allowing the compilation for COMPILE_TEST. Indeed, PM might not be defined at all, or come with extra requirements we can't meet. This select was initially introduced since we need to call the vc4_hdmi_runtime_resume() at probe time to make sure our device is properly powered at bind time, no matter whether PM is there or not, and we needed to make sure we didn't have a defined but not used warning for vc4_hdmi_runtime_suspend(). This will still happen on platforms that don't define PM though, since SET_RUNTIME_PM_OPS will then be a nop. In order to fix both issues, let's remove the select, and add a __maybe_unused attribute to vc4_hdmi_runtime_resume(). Reported-by: Randy Dunlap Signed-off-by: Maxime Ripard Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor # build Acked-by: Randy Dunlap # build-tested --- I'm not sure how to merge this one, since this commit has been reverted in Linus tree, and un-reverted in linux-next. Should we wait a bit until the reworked version of the original commit has been merged again? Maxime Changes from v1: - remove select - add __maybe_unused to vc4_hdmi_runtime_resume - reword the commit log --- drivers/gpu/drm/vc4/Kconfig | 1 - drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vc4/Kconfig b/drivers/gpu/drm/vc4/Kconfig index 52a1c309cb4a..345a5570a3da 100644 --- a/drivers/gpu/drm/vc4/Kconfig +++ b/drivers/gpu/drm/vc4/Kconfig @@ -9,7 +9,6 @@ config DRM_VC4 select DRM_KMS_CMA_HELPER select DRM_GEM_CMA_HELPER select DRM_PANEL_BRIDGE - select PM select SND_PCM select SND_PCM_ELD select SND_SOC_GENERIC_DMAENGINE_PCM diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 500cdd56b335..1f2690ed8542 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -2122,7 +2122,7 @@ static int vc5_hdmi_init_resources(struct vc4_hdmi *vc4_hdmi) return 0; } -static int vc4_hdmi_runtime_suspend(struct device *dev) +static int __maybe_unused vc4_hdmi_runtime_suspend(struct device *dev) { struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev);