Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1670027pxb; Thu, 16 Sep 2021 12:31:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxr6rttqQ5jpw7oImYP2j3L7m+jXX6sATESwYqZBofLec2QvrrKYvlVQUxaANJmfAHe1RSo X-Received: by 2002:a05:6402:10d7:: with SMTP id p23mr8167339edu.74.1631820703911; Thu, 16 Sep 2021 12:31:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631820703; cv=none; d=google.com; s=arc-20160816; b=zHqjd+9Ki9d2QE2wXexnCGruKlOZf3s+rbyj82cRujUTb6at7jW4OwcHRrc8mhQ2Ig RgwxnDB2cL0b7e2KAm6UfCO1hvfKDfDLMPuP94r2DyGujpeysyOPs50OPlVLmBL6lTkY O88WKTGsnwK0DUZmwFhejEexaaXdSRFNiA+sBumGoRZ/A40ZhdjVlmSJD1wefNowVkLH y+zQMcxrfVPWky7e2Jyk3M9C5MekIxlJPAGOldWqBRVenlq0KQadPn/A65aaPeO9IHwY QC7erw0N7HriNFi0dQgiMc8S22UHxSze41rUALumcHi5Il362XdyBA3efD0dZHZ+Q07F 5Zpw== 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=7getSkaNGYXyOX4mXSprLNfX07uVsbwP+ZDjwKZLz4Y=; b=Y7HLZE2segDc0FOv2tpZP5KZ4K/u8i7KMtmT0wZ9gyYu3bBiInZcPro4VRi4OvSC+R GJ7LOkkhFtPZsAnRqWNiO4IbAj8RVoH/ATsdkcvDSVMl5jTglTF16li3OSVdZ2bCix1a fqSJqU/GL2MamhTnCBc/ZSzVGS2+zgPgn1UsDao3CpLIb09MKYYWYj6dEFCWC5gnb8DS szQLYem3Vf0RfFGVbp5DD+pQcwKpOZIdzAeiDRrldAw1+oHmvewWkwhl2bJ79WlvM2uy Ubh/AAPxJgtBsqpWJ57akIHVQBAyLdS89Epu2GymkfYLzzhE7z+xxnF8ZdnzrqXvgKy3 WO5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wLH6S0eu; 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 23si4176102edw.187.2021.09.16.12.31.20; Thu, 16 Sep 2021 12:31:43 -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=wLH6S0eu; 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 S234033AbhIPQJa (ORCPT + 99 others); Thu, 16 Sep 2021 12:09:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:45176 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232624AbhIPQGt (ORCPT ); Thu, 16 Sep 2021 12:06:49 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4F18060232; Thu, 16 Sep 2021 16:05:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631808328; bh=MJyV0v6qxG15VBPanOR3c7uyBhY99p67PnTBwV3Yvu8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wLH6S0eu1yymr8T9z+YLIW/5WbTwN4xzmJtKPBCVYIX0hpLXblYTsvJc7bdt0IDZa Qavfu3cO1jwL8A+t+jKAF3ggHOcIPZK2h/i3qbBM5aLsa1S4iU9AYM6Yljug0CTHjd nR/aJYOMK1SHadbpAwwQQX7L2iS0wZxuhnmoQsL8= 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.10 049/306] PCI: xilinx-nwl: Enable the clock through CCF Date: Thu, 16 Sep 2021 17:56:34 +0200 Message-Id: <20210916155755.617990072@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155753.903069397@linuxfoundation.org> References: <20210916155753.903069397@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 @@ -168,6 +169,7 @@ struct nwl_pcie { u8 last_busno; struct nwl_msi msi; struct irq_domain *legacy_irq_domain; + struct clk *clk; raw_spinlock_t leg_mask_lock; }; @@ -825,6 +827,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");