Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3044400rwb; Mon, 15 Aug 2022 16:48:12 -0700 (PDT) X-Google-Smtp-Source: AA6agR7VAr+QcmKahi9GWZvsp8v14RcbVIvubUgWO0OhOHsSs1aMaWStG0UvP/foDqroCklFiN4+ X-Received: by 2002:a17:90a:db0d:b0:1f3:a48e:46b3 with SMTP id g13-20020a17090adb0d00b001f3a48e46b3mr31149043pjv.72.1660607291830; Mon, 15 Aug 2022 16:48:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660607291; cv=none; d=google.com; s=arc-20160816; b=CRM7TD1UAymYpDi7tYJkstkG6qxi11Y2sCAST7FjDiW1nzVXWJlAKBcMpnuYEki50Y 6Y0mxGwafi5FpX2P9nJy9nTocHJsaobDiu6MKqoyw2kylUYRWOP+6i5BBiE/nJhLoeET 8ua8+DtfO0a2OFwot3kAFhwzup2yO/ZvPM2QuXkKH2nODaflSm53yZN7hsYUOaNpOwi1 AV+UMA7SPyJcBWDCGpSZNOorH9XXrGSHNMO1tr/QGt3myQ9OTPlTQIS0qgfbGkXbtkFF L+cjReCaPEHX1pubkGFSBwJ3he/zskdGycwnhd0itpVy2s7xpCV1Ar0m8oomkge3Pj1J v6Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PX23JEZ4NA11m1rcgsrlx3VP41XEeC7/FPG5M6AXTJk=; b=zGB60h9qkWoH6Kt6Mn3clS3iOl1sLuX6FmAakZCZMEPXrgogU2VB+HJ9O+cG9ydaZs Z58F7p+SMVGB61xrLx1TkrR4meDpZHq8Df+nvrUbe2knxKA99NBZS0bNaay/pIwrULvi Sash+4Gh/RCzOe75JNi/euKauivb5z+cVabv1wYmYiZek/u8IXEJ0rDbXyummlF3yGiO 0Oe9M+pVTp0RXx9B9tPT8hEwMs01R5091yR6G/degAHCF4OKd5C8TU9hNgmmE85ETcwg r6awFN6K7UwhI1GNg9E/WjTk5NHbnnXDbfE1r8yhNLmTdcfQAPwbFqUg/32V6dNLYoEs WBGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=o+CPzbWj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j63-20020a638042000000b00412aa5ca344si11863493pgd.614.2022.08.15.16.48.00; Mon, 15 Aug 2022 16:48:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=o+CPzbWj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354841AbiHOXqa (ORCPT + 99 others); Mon, 15 Aug 2022 19:46:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354322AbiHOXlx (ORCPT ); Mon, 15 Aug 2022 19:41:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BF9F2C660; Mon, 15 Aug 2022 13:12:31 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 294EB60B9B; Mon, 15 Aug 2022 20:12:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 192AFC433C1; Mon, 15 Aug 2022 20:12:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594350; bh=18v+vZT0Ed/9QFymO9brtDowoMMCn/h3TPlulZeogO8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o+CPzbWjGlBwbWOFN/bfbNMfF5/+aVeNil2ucPqgwljBJdcLZAE9vgLROYnzQVY96 RkMfIm4niG288oFKmSMwOeAQcBNGsMDnapnQBGMKfkIMZRzIlPVdBgys3JocBvVQdS JL7Qr3k7YkzyQMrIEE574LzXmTFXPLwrUCd9hTrY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dave Stevenson , Maxime Ripard , Sasha Levin Subject: [PATCH 5.19 0419/1157] drm/vc4: hdmi: Switch to pm_runtime_status_suspended Date: Mon, 15 Aug 2022 19:56:15 +0200 Message-Id: <20220815180456.434613174@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dave Stevenson [ Upstream commit fcef97e70094a33ded73b3eb9bef06698c6e9c12 ] If the controller isn't clocked or its domain powered up, the register accesses will either stall the CPU or return garbage, respectively. Thus, we had a warning in our register access function to complain when that kind of risky accesses were performed. In order to check the runtime_pm power state, we were using pm_runtime_active(), but it turns out that it will become active only once the runtime_resume hook has been executed. This prevents us from doing any WARN-free register access in our runtime_resume() implementation, while this is valid. Let's switch to pm_runtime_status_suspended() instead. Fixes: 14e193b95604 ("drm/vc4: hdmi: Warn if we access the controller while disabled") Signed-off-by: Dave Stevenson Link: https://lore.kernel.org/r/20220613144800.326124-23-maxime@cerno.tech Signed-off-by: Maxime Ripard Signed-off-by: Sasha Levin --- drivers/gpu/drm/vc4/vc4_hdmi_regs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi_regs.h b/drivers/gpu/drm/vc4/vc4_hdmi_regs.h index 549cc63dab39..0198de96c7b2 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi_regs.h +++ b/drivers/gpu/drm/vc4/vc4_hdmi_regs.h @@ -423,7 +423,7 @@ static inline u32 vc4_hdmi_read(struct vc4_hdmi *hdmi, const struct vc4_hdmi_variant *variant = hdmi->variant; void __iomem *base; - WARN_ON(!pm_runtime_active(&hdmi->pdev->dev)); + WARN_ON(pm_runtime_status_suspended(&hdmi->pdev->dev)); if (reg >= variant->num_registers) { dev_warn(&hdmi->pdev->dev, @@ -453,7 +453,7 @@ static inline void vc4_hdmi_write(struct vc4_hdmi *hdmi, lockdep_assert_held(&hdmi->hw_lock); - WARN_ON(!pm_runtime_active(&hdmi->pdev->dev)); + WARN_ON(pm_runtime_status_suspended(&hdmi->pdev->dev)); if (reg >= variant->num_registers) { dev_warn(&hdmi->pdev->dev, -- 2.35.1