Received: by 2002:a05:6520:4d:b0:139:a872:a4c9 with SMTP id i13csp2565889lkm; Mon, 20 Sep 2021 18:52:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUfh8uCvii7QMdeezZYPHUgA2bp8odzi/0NmOIEvnZTcuTheCy+WBUkfpQdyw5YrP7Lx4n X-Received: by 2002:a6b:d915:: with SMTP id r21mr21098913ioc.76.1632189037448; Mon, 20 Sep 2021 18:50:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632189037; cv=none; d=google.com; s=arc-20160816; b=qyZHpPtj3Ig76ytNTXGqXb5vm+3NQz73dAWxKg4FsoSUnon03trDklLdUuP6UaDbAS JFf7WzUNv0YCHRyPd91uFZvFDpFLkvhD/WZ9rVh1tneNIqq5aVp/LqAHHzdgrEfDUYJV bR7aQGIZiPxkYdAsFD578KsB83oRmZYIBq25A+9cxYAk+iXFSClP66cwF+vJjaxK6q2O b4y5ibEYoJ+ppp+zaZdKcCGusGEQ7v+VIPhfsfJ+RDHPZxr2cahcdXr25JqhWK/DamUb zRblou8l9Fxo12yB1dR71+BGg81krCT8XW5xTgl/YTq8vj/eZ8B/WiCgmPa/rRPOFxQd 4I4w== 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=FMF/boEgHiDREovCDP5OgdgYuDlykUI80ypMDfR/Y8g=; b=Ni7kqD2CtIWINE/7T5KZme1kbnim4ybFbbhP4UsCn+Ed/g24slay/ia94NZ+Z17iao S9bOZIbWwBCbks/CtNLq7wncJ5WqgDTaIwFCQA6rJiYAFwz2TPy/gDF3mz78wc2aOwgw 17HByRo0A2ysyZ7v0omLXrgTbI7e1t3Y5PlwOIeSn/bCi+twVhej9yBrOdZkVKDk4UMl mu8uStlaKoiHj9Y3FxU3TGmAErs0IRbrhFwbOLUsk9XFZCs0aWb+nI6rOyhkw1W5NXwr QjupEmQBU9GCo8Eni4DTP9dn2Ebww9Xk2PtLcP4fFSpAbRj9A3Z6k/Zmbt4t0oT4OX79 HKJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gg4tTsO0; 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 t2si2224547jam.80.2021.09.20.18.50.26; Mon, 20 Sep 2021 18:50:37 -0700 (PDT) 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=gg4tTsO0; 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 S1358008AbhITSH0 (ORCPT + 99 others); Mon, 20 Sep 2021 14:07:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:58900 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350360AbhITSBw (ORCPT ); Mon, 20 Sep 2021 14:01:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 11D91613B3; Mon, 20 Sep 2021 17:16:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158169; bh=pB60Zso4c46j1gSOTCobNwTBswnNMKtjyGulBiit2T8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gg4tTsO0RPaAk9RUhz9ICkcvheV2ULMP23VT5IiRdVJldJNjwdgjNIV5EgVzXPlFF RPfGhboicpjN89KQW0sjimJcJB8pznB63oP1SEADMu9xszVSarhMC71caQcY37Vw65 dXVEP2UzhI/9+BkqSWTy2rSvE9TpYPUyD9VDP93o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hyun Kwon , Bharat Kumar Gogada , Michal Simek , Lorenzo Pieralisi Subject: [PATCH 5.4 032/260] PCI: xilinx-nwl: Enable the clock through CCF Date: Mon, 20 Sep 2021 18:40:50 +0200 Message-Id: <20210920163932.210872945@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163931.123590023@linuxfoundation.org> References: <20210920163931.123590023@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: Hyun Kwon commit de0a01f5296651d3a539f2d23d0db8f359483696 upstream. Enable PCIe reference clock. There is no remove function that's why this should be enough for simple operation. Normally this clock is enabled by default by firmware but there are usecases where this clock should be enabled by driver itself. It is also good that PCIe clock is recorded in a clock framework. Link: https://lore.kernel.org/r/ee6997a08fab582b1c6de05f8be184f3fe8d5357.1624618100.git.michal.simek@xilinx.com Fixes: ab597d35ef11 ("PCI: xilinx-nwl: Add support for Xilinx NWL PCIe Host Controller") Signed-off-by: Hyun Kwon Signed-off-by: Bharat Kumar Gogada Signed-off-by: Michal Simek Signed-off-by: Lorenzo Pieralisi Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/pci/controller/pcie-xilinx-nwl.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) --- a/drivers/pci/controller/pcie-xilinx-nwl.c +++ b/drivers/pci/controller/pcie-xilinx-nwl.c @@ -6,6 +6,7 @@ * (C) Copyright 2014 - 2015, Xilinx, Inc. */ +#include #include #include #include @@ -169,6 +170,7 @@ struct nwl_pcie { u8 root_busno; struct nwl_msi msi; struct irq_domain *legacy_irq_domain; + struct clk *clk; raw_spinlock_t leg_mask_lock; }; @@ -839,6 +841,16 @@ static int nwl_pcie_probe(struct platfor return err; } + pcie->clk = devm_clk_get(dev, NULL); + if (IS_ERR(pcie->clk)) + return PTR_ERR(pcie->clk); + + err = clk_prepare_enable(pcie->clk); + if (err) { + dev_err(dev, "can't enable PCIe ref clock\n"); + return err; + } + err = nwl_pcie_bridge_init(pcie); if (err) { dev_err(dev, "HW Initialization failed\n");