Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2930336rwb; Mon, 15 Aug 2022 14:16:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR4Muy/wpWdnbTFZOZ/EzvjgdRf7LRm4bNLbjb1j0+21xRj7431rt5pCDIhijfcWPPrigt1h X-Received: by 2002:a17:90b:3a91:b0:1f5:2048:cb9f with SMTP id om17-20020a17090b3a9100b001f52048cb9fmr29663596pjb.174.1660598085460; Mon, 15 Aug 2022 14:14:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660598085; cv=none; d=google.com; s=arc-20160816; b=FINvs4HomfEY0DhKDihRWcwsTeRDoJ/0MTMwM3vNRCqu0SLDg4S5wMp9z5pxdNfbS+ zSB5d0Zh9yX4RrTaD/A3QTHaYdmqyTYbVX6LNXiKgiGp0wbMRgWtzu5efi4j4xZvWlLo grKb/2JFGWjSIHU/TYn1KqADRJHT60XACv7hJTZrmpeE0FFhvVEVBmajhKadxK7io2B1 cOzYVyjwPan4fknsrVN7JfDDEEbmk5E/dZUJtq40vZ6sDCaB+33F6z+xKDIOwy4F/scr YUMQamJTpU7B2/sLE+sq2Ggb+0YeDIgDRM6pcoZePywAWBWt6FlB1yK+sZ0qCyCgN1KY vpuA== 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=JFfQTAI4GQ1Chmlzz6WDcU22Wu7ZNrqMRwxqTKf2fkA=; b=KltbDjsAirsUU45No8Rfee28EjxUX6Qco1tNqlmlJlfK/vL35bVFm5zl2goyKquQ35 qzhsHTKBKQA7Oru9gG8+ryVYQxXN93VBf3CvSfITLqulxmNpq3aOdxSP8Yn55z5fpinb srjXlvRHYpO1vYMBi1BoYBo2hMb0K487V8hHp6elwA6ZXnGdCyFdND5FNyD/JNmbh7cq iFSysT64t4SkYIYMDJ35ELKrcI2T5yiCG2zmpnMNFCgcgupRyidiYFH4GR71hkO6URMj bjwSHiWCthnfrfcW9VodEAXwosKMz/JOVhzumk0z7rD3inPETP4CHXutvj74cchDl38+ a2/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TSOKaNJq; 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 y14-20020a17090322ce00b0016ef1d4c4fbsi13857351plg.320.2022.08.15.14.14.31; Mon, 15 Aug 2022 14:14:45 -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=TSOKaNJq; 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 S233007AbiHOVJZ (ORCPT + 99 others); Mon, 15 Aug 2022 17:09:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241522AbiHOVEQ (ORCPT ); Mon, 15 Aug 2022 17:04:16 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFEC1D5710; Mon, 15 Aug 2022 12:14:52 -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 sin.source.kernel.org (Postfix) with ESMTPS id E4E14CE1262; Mon, 15 Aug 2022 19:14:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D091EC433D6; Mon, 15 Aug 2022 19:14:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660590889; bh=qLnXxGHuebqquUUuCDId5Q1nQL5MJHCqyFlJRxfHHtc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TSOKaNJqK0o6vUnInbs50pslSLCy8Zjfn4ltMRRp5FSNiLfpYflLGQgDDcF2Dr/F2 qfY7r7oZzWNprygfw6CqHIIqtmc9T5owTTuYgbkrh/shf6B0VX7BsEi9eymq2/HgX6 LJLGTZynz4RrecoDjD2aVAExv5tXv9o1+ioBCeG0= 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.18 0396/1095] drm/vc4: hdmi: Switch to pm_runtime_status_suspended Date: Mon, 15 Aug 2022 19:56:35 +0200 Message-Id: <20220815180446.070314409@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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 24056441a4bb..72b769412482 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi_regs.h +++ b/drivers/gpu/drm/vc4/vc4_hdmi_regs.h @@ -417,7 +417,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, @@ -447,7 +447,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