Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5649970pxj; Wed, 23 Jun 2021 06:10:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwy1Is1tXahvKTOPCjorTz4GdekfpqEZ319eBJbjk3z8kG0vOAQN/4+jSAA+bgZ+lDL1zW0 X-Received: by 2002:a05:6e02:1a4d:: with SMTP id u13mr2765946ilv.42.1624453840521; Wed, 23 Jun 2021 06:10:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1624453840; cv=pass; d=google.com; s=arc-20160816; b=YUlAsZK6sw/Pyyi6U9Td6Yl87fb+G6Q/43AtZJyytk6nR64AMsLvR4qusdVGMQKLsN 8C7m8bR+JWFixIDdyrEvdb3Ly/uu9jjjvrXHuds8Uslb0jaMVPTaYgz4+WAkZULkjBS8 p+cz83F6wIrUNFxfFTGGICkATvrc5AfVAxHV4uwZwHbLXC5Uh06bv6KJB/3kkfREPKXM i9LW8pfq86VZeVLmSMaHtK+TSEbggvvXvGdtZz4vGHTrdlZOB46xbfgkOvI09G/dwLFG tn6tVCkrDs6Ek4qvo9KfJxU9nCv+TG3hYi5cuGti8QwOUzLlqomHMYgUN1DgnTOKUYft NqsA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:envelope-to:dkim-signature; bh=rP0wHlia1yI1cUcdDmU/uCnMmEauFXjOKTA5MsIAO20=; b=LKJT0LNsXRj0EAcNLSwUo4+4dZqV3afzYGne8phH1apt7lbvxW924UlJL9HwsLb9eC rMVIy8B6Bn5OH2aQpAHJxY3npQsFqxJeN9v2lilIeQ21EziECGqnIho4E1Vig9zEJ83/ ddqAEUHBCwzWEAGo9+2BhHxq40voehdsdJjyZU/igUA+xAJUtMKDSWIF4G6uiI/Jdq0f 34nOJzetlLd7LkhW5j2GfuhAlxHSLFSuglSu7KUibYV1Jgtyvy4Wjb5E7gHl/bjblUiN qUxET270WuPfcvWEJP19JRSNmH2vFNGUhmMRIxA28LsZa0zrioZjQQS8UvNJyMeMPD/1 pixA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector2-xilinx-onmicrosoft-com header.b=AvjxNZio; arc=pass (i=1 spf=pass spfdomain=xilinx.com dmarc=pass fromdomain=xilinx.com); 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=fail (p=NONE sp=NONE dis=NONE) header.from=xilinx.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p18si2519309jam.60.2021.06.23.06.10.27; Wed, 23 Jun 2021 06:10:40 -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=@xilinx.onmicrosoft.com header.s=selector2-xilinx-onmicrosoft-com header.b=AvjxNZio; arc=pass (i=1 spf=pass spfdomain=xilinx.com dmarc=pass fromdomain=xilinx.com); 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=fail (p=NONE sp=NONE dis=NONE) header.from=xilinx.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230415AbhFWNK7 (ORCPT + 99 others); Wed, 23 Jun 2021 09:10:59 -0400 Received: from mail-mw2nam08on2072.outbound.protection.outlook.com ([40.107.101.72]:36544 "EHLO NAM04-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230430AbhFWNKz (ORCPT ); Wed, 23 Jun 2021 09:10:55 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PloSFpD2HQlgzei3i3UnWKIL4yUbIuLJhNazv0CdNF1DGqurVswHxD1o9GDBw2hBp2iJwWQ9wuAtLUKKOrrEp0eOdEK4TcyDPZz9lvMcdIqHi0AA03LYQVOR4lVyhDqBK10S5LY0iGsvfvFDiGa40hbwDPeokh+5rFU2AvevbWkzMkjX4gGLsjzZSgn4TxdBBjcBJN04TgDvMG+QhTJNIAS/Jh35XACdjjDQzc8BzQWMqLHQSJ3lBI2ZYYuPEXb1OZTkBxu78WCTWg+HAqAruWDIUXuQIcdKdPDIxMCvPplIHzlO+JWY31YBG06Rcp/EKlSJ5u4B7JEoic8jOdZ+ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rP0wHlia1yI1cUcdDmU/uCnMmEauFXjOKTA5MsIAO20=; b=aoeGN9buCwslhC5BgO6qC3mWW5BnscPfIcmwijAZZLFSUL5UZKTnnqkEgtHbMkMZ7QKluP9vf03QV6ouT6rh5fb353Vx0LA+GW/vPjRT3dhkZTw/sZAWs8Zb5MIRxF+lpoSRRecnw1NQ9rHiULdBzVsJBjA7dW6gPb5hcrR4wUfAHCA9W9Ibyqrn/GsFi1Pl6RCpcPvxunXJA72nRJ15K8WKN43TVpFM6aO3ZnyL0Tu6LFA8UICs8bF355BraTWFE0AVXoO8DoMdkSLI2drnLwFEYG8IYbFeD8tRbqOi0VPBxgNhak2y3tTnxo7cyFyC6YZLadlQSsrJvkpYnph1UA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rP0wHlia1yI1cUcdDmU/uCnMmEauFXjOKTA5MsIAO20=; b=AvjxNZio6ES8hPXgXR71GdYg/vkWUTPmvCJrkm0v1TFxW/fJOd3oS1Qpk4jCaawZcaIDCbpPccjvEiMJFIO6yG808ZU6r3djNWR3f0IwH3Ah33FOOjuTgbw0ADJhLzTA08EWBZg11wH7h4jope+fUTFo8iGhsDYlfevMkry6z3o= Received: from DS7PR03CA0243.namprd03.prod.outlook.com (2603:10b6:5:3b3::8) by SN6PR02MB5437.namprd02.prod.outlook.com (2603:10b6:805:ea::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.21; Wed, 23 Jun 2021 13:08:36 +0000 Received: from DM3NAM02FT034.eop-nam02.prod.protection.outlook.com (2603:10b6:5:3b3:cafe::54) by DS7PR03CA0243.outlook.office365.com (2603:10b6:5:3b3::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.19 via Frontend Transport; Wed, 23 Jun 2021 13:08:36 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by DM3NAM02FT034.mail.protection.outlook.com (10.13.4.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4264.18 via Frontend Transport; Wed, 23 Jun 2021 13:08:36 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 23 Jun 2021 06:08:09 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Wed, 23 Jun 2021 06:08:09 -0700 Envelope-to: git@xilinx.com, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, robh@kernel.org, lorenzo.pieralisi@arm.com, bhelgaas@google.com, monstr@monstr.eu, linux-kernel@vger.kernel.org, kw@linux.com Received: from [172.30.17.109] (port=43174) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lw2bw-00074a-JD; Wed, 23 Jun 2021 06:08:08 -0700 Subject: Re: [PATCH] PCI: xilinx-nwl: Enable the clock through CCF To: =?UTF-8?Q?Krzysztof_Wilczy=c5=84ski?= , Michal Simek CC: , , , "Hyun Kwon" , Bjorn Helgaas , "Lorenzo Pieralisi" , Rob Herring , , References: <20210623122040.GA46059@rocinante> From: Michal Simek Message-ID: Date: Wed, 23 Jun 2021 15:08:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210623122040.GA46059@rocinante> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b0ac16ce-063d-4e3e-3eee-08d9364802c4 X-MS-TrafficTypeDiagnostic: SN6PR02MB5437: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: V2YQ9GS0nzv6tuTh42jn22QgQAUnug00LUZTaQtYN+N6UVjPkzMykcmfSi5fIf1Ud5j8MB5xAfUl6cJDH5qIr0lVk6y5wn7JErYhJ7NdBpjIz6se962fSqeOcEc37Ag+kUATEGrt6vrbHC3yHiKezUIdKk2kkGpbyz+xk0tuJNanfT3Sxg2H5WATdTkQZo6kTYVu6pH2EIZBTystzpW32jFguzCy+CO0eMk2SAL0hND7XlTDwxK0IqwRAX0ky/lho+9pxprZ7BWncxl2Na8m39MGHZrTlarRkNeC4Jzd/AxMT72Fj4xprqIUJftTAaPOusOQuFmBw9ZtuOMNzQh/lb4theYS8nzxdyMPPy9g5NetS2elnJ0KLgqHRHUy0g9aTkOO72XLhbQeCZdvFbPkCeW4AR3ZbnemMq+3PLLkivPe/GLPu+t87ALewhIAyA7Q6G6CqRfAW57Tz6Jt7DAuk3wCOSj68iVkVOBcUPSl1oKqOKoXEu4BCvBcLCBuzn2LLRkvVZT5Kgsicm5/Nwl2RCOuhZ2IMoIjOAhT1kivyi3rR8S4OiawI4aBC01im4Jbhz2A1zxUbVAuXUT0teATqv7z0UPmNX4WOf4S7HDL8gQzJl3h8+AsOeBJAVNdURGxzZj0q27HJG+dycngHAqN8YHXfCT2WPfTxodzLoYU/cqkpMygfFU3LToN+AK8hAMbs56YDncvzaYhsMjuvMr4Lg== X-Forefront-Antispam-Report: CIP:149.199.62.198;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:xsj-pvapexch02.xlnx.xilinx.com;PTR:unknown-62-198.xilinx.com;CAT:NONE;SFS:(4636009)(136003)(39860400002)(376002)(346002)(396003)(36840700001)(46966006)(8936002)(2906002)(8676002)(478600001)(70206006)(336012)(316002)(36906005)(36860700001)(186003)(4326008)(70586007)(110136005)(54906003)(82310400003)(5660300002)(53546011)(26005)(47076005)(83380400001)(9786002)(31696002)(6666004)(82740400003)(426003)(36756003)(2616005)(7636003)(31686004)(44832011)(66574015)(356005)(50156003)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jun 2021 13:08:36.0687 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b0ac16ce-063d-4e3e-3eee-08d9364802c4 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.62.198];Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT034.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR02MB5437 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Krzysztof, On 6/23/21 2:20 PM, Krzysztof WilczyƄski wrote: > Hi Michal, > > Thank you for sending the patch over! Thanks for review. > >> Simply enable clocks. There is no remove function that's why >> this should be enough for simple operation. > > What clock is this? Would it be worth mentioning what it is for > a reference (and for posterity) the commit message? It is reference clock coming to the IP. I will update commit message. > > Also why it would need to be enabled and wasn't before? Would this be > a fix for some problem? Would this warrant a "Fixes:" tag? And would > it need to be back-ported to stable kernels? I will update commit message. Normally reference clock is enabled by firmware but on some configurations this doesn't need to be truth that's why it is necessary to enable it. It also records refcount for this reference clock is good. I will add Fixes tag to v2. > > [...] >> @@ -823,6 +825,11 @@ static int nwl_pcie_probe(struct platform_device *pdev) >> return err; >> } >> >> + pcie->clk = devm_clk_get(dev, NULL); >> + if (IS_ERR(pcie->clk)) >> + return PTR_ERR(pcie->clk); >> + clk_prepare_enable(pcie->clk); >> + > [...] > > Almost every other user of clk_prepare_enable() would check for > potential failure, print an appropriate message, and then do the > necessary clean-up before bailing out and returning an error. > > Would adding an error check for clk_prepare_enable() and printing an > error message using dev_err() be too much in this case? If not, then > I would rather follow the pattern that other users established and > handle errors as needed. What do you think? Agree. I have added it. It is called very early and devm_ functions are used that's why cleanup shouldn't be necessary. I have also found that clock wasn't documented in dt binding for this IP but we are setting it up for quite a long time. 9c8a47b484ed ("arm64: dts: xilinx: Add the clock nodes for zynqmp") Thanks, Michal