Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3722612pxb; Mon, 24 Jan 2022 16:20:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJxxYKP3wCxl6u47+9LgPovOWTsRTeLEDQM8U6NNmkOl8Eh9F3elE1KDMWINWPjaMBPUxZfy X-Received: by 2002:a17:90a:194e:: with SMTP id 14mr835042pjh.106.1643069935835; Mon, 24 Jan 2022 16:18:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643069935; cv=none; d=google.com; s=arc-20160816; b=Ft+TFUCCXc06F1ufB0HRuI00uUuWTCcsM3YM/izA99/DRySN4H31yN1JHECsjl5YIv InhRLWiNuEDpg/Byim6hI1EZHydXMwhiVp9S1qzz5DntXmkRc+3OHQ7mxKB+E2fNzFNP b1PgwhcOJN74+YR8YUkWUmZVJleF9DW64vHPpjVGniU7C6uqrfWOirDOXRu2bAvOnEVS XsOpVavDTzzzrGRKeAPo+JKND7vQuz+40SJjW5ZrJe290Y5a9yqoJRUX3tGQKsmRPMpu W9+vtcs6xmAxv2qYdXdkqtjsA0Poy10Bh4iUFa6c8qwC88gwzyXIU0NeW5Tx80xtKsrV jy3w== 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=bj144TWxD4DRvH/4lFAmDFY2oW1DAqzCylaLk1H+7Wo=; b=ck/2ONl3pfHLWelPRa8+xnMmXKtFyLYLpCE6sFtpPTmIj5LFjSp5tsFVTPf+fDlhMK YPH1MGT0CB1L40kFVWSKjjpjzPnQySENdeJks3qeH2KFLIHlSW5XzKC88kcYmjrCv+Um UxmGGU0VdPhDQV3o027AIWLmewemM3eggwz3GmAvBeEi4pj36opP09+nRp0An7udbGsb hVqMNl1eGoqDuSH0Y4I6J9BJELkudrJejDbbSYTTjeUjLB/8azP6MIzPbbn7ez7/mP9x h+sVnzXDYIRNkmQc516kCf2buhxU+OFvrwQ5DZB+NT/eJvced32KjFSIzYDeP1KCRf/d 1Zrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oJrWUXi2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p24si15317505pfh.148.2022.01.24.16.18.43; Mon, 24 Jan 2022 16:18:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oJrWUXi2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1376878AbiAYAOE (ORCPT + 99 others); Mon, 24 Jan 2022 19:14:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1457499AbiAXX2Q (ORCPT ); Mon, 24 Jan 2022 18:28:16 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDF52C01D7FB; Mon, 24 Jan 2022 13:32:17 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id 8ACCEB8105C; Mon, 24 Jan 2022 21:32:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8BCD4C340E4; Mon, 24 Jan 2022 21:32:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059935; bh=kYzQ6x4/8WDwUsKjGgcujq30v/9ofPlAvon/fiopj00=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oJrWUXi2vxbgCPV2sF5oWKv2H1PXleQVcB/lmwkr36GM0ZWY+on95eCMTO6IopfwV LlB9xqXfQHFmeArSRoYPph8oK2J7qDPdUUEHIjBC7+9+BmKV9A5eGS1r5kgf/8ygnf e3EqN0xw/HgOrCQ4r8yCTWBtiKxn36SQiW3/I+Hs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marek Vasut , Lorenzo Pieralisi , Geert Uytterhoeven , Randy Dunlap , Arnd Bergmann , Bjorn Helgaas , Stephen Boyd , Wolfram Sang , Yoshihiro Shimoda , linux-renesas-soc@vger.kernel.org, Sasha Levin Subject: [PATCH 5.16 0784/1039] PCI: rcar: Check if device is runtime suspended instead of __clk_is_enabled() Date: Mon, 24 Jan 2022 19:42:53 +0100 Message-Id: <20220124184151.639481546@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marek Vasut [ Upstream commit d2a14b54989e9ccea8401895fdfbc213bd1f56af ] Replace __clk_is_enabled() with pm_runtime_suspended(), as __clk_is_enabled() was checking the wrong bus clock and caused the following build error too: arm-linux-gnueabi-ld: drivers/pci/controller/pcie-rcar-host.o: in function `rcar_pcie_aarch32_abort_handler': pcie-rcar-host.c:(.text+0xdd0): undefined reference to `__clk_is_enabled' Link: https://lore.kernel.org/r/20211115204641.12941-1-marek.vasut@gmail.com Fixes: a115b1bd3af0 ("PCI: rcar: Add L1 link state fix into data abort hook") Signed-off-by: Marek Vasut Signed-off-by: Lorenzo Pieralisi Reviewed-by: Geert Uytterhoeven Acked-by: Randy Dunlap Cc: Arnd Bergmann Cc: Bjorn Helgaas Cc: Geert Uytterhoeven Cc: Lorenzo Pieralisi Cc: Stephen Boyd Cc: Wolfram Sang Cc: Yoshihiro Shimoda Cc: linux-renesas-soc@vger.kernel.org Signed-off-by: Sasha Levin --- drivers/pci/controller/pcie-rcar-host.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/pci/controller/pcie-rcar-host.c b/drivers/pci/controller/pcie-rcar-host.c index e12c2d8be05a3..780e60159993c 100644 --- a/drivers/pci/controller/pcie-rcar-host.c +++ b/drivers/pci/controller/pcie-rcar-host.c @@ -50,10 +50,10 @@ struct rcar_msi { */ static void __iomem *pcie_base; /* - * Static copy of bus clock pointer, so we can check whether the clock - * is enabled or not. + * Static copy of PCIe device pointer, so we can check whether the + * device is runtime suspended or not. */ -static struct clk *pcie_bus_clk; +static struct device *pcie_dev; #endif /* Structure representing the PCIe interface */ @@ -792,7 +792,7 @@ static int rcar_pcie_get_resources(struct rcar_pcie_host *host) #ifdef CONFIG_ARM /* Cache static copy for L1 link state fixup hook on aarch32 */ pcie_base = pcie->base; - pcie_bus_clk = host->bus_clk; + pcie_dev = pcie->dev; #endif return 0; @@ -1062,7 +1062,7 @@ static int rcar_pcie_aarch32_abort_handler(unsigned long addr, spin_lock_irqsave(&pmsr_lock, flags); - if (!pcie_base || !__clk_is_enabled(pcie_bus_clk)) { + if (!pcie_base || pm_runtime_suspended(pcie_dev)) { ret = 1; goto unlock_exit; } -- 2.34.1