Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp42916pxj; Thu, 27 May 2021 20:46:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymXq2IVMUzgjgBV9ZR+N2eg18PAZmU0b3AeJSpXGu2kt7PXn1sx7LZ38IWxlgLeXKFyFPW X-Received: by 2002:a5d:980b:: with SMTP id a11mr5500568iol.47.1622173571827; Thu, 27 May 2021 20:46:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622173571; cv=none; d=google.com; s=arc-20160816; b=NftDD5y5z8nzn/1fkDDXB3R1St5TOZr9lidD4AQo3zj4FgvpuO2/oKi0in+AJ5JNqn OrMXA/2mIEEgJibvjSlhrOxVE+O0py8Lk7S8Wf58DHm17hXL6JhJK6SfRm+Q9uGn99Hd KYZUCLLV6Y9LPIfCIRIsTvKcY0fSTV/lPcOgB6UnE1ZS8x16EGTeErMNtZ28iB4p2LeG QZygBHBRv2UB6NE+wkxkFOYRQzH/ru0FVpi1J+obUhtDJ2oEA+infAj+6JhqlAOsukgJ aHDZbgOioYqec5SFkFUYh2yc7ixTIcVeRcQqkzdFCLX3CF/uGPXq/8rqpfMcjanVwQvO +5Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=hmVj2VGVH3n2PwZC1davQeT3nFZfnE91mYmCP53mhJ8=; b=s5V8g+6znJbqjOvX8JwMqNLzx0mIRmV5PsYQgTvzPibL7BBe92Do2y8yx0GFcF3L6f h9qdIxJHzFvQS8XQ18nGQUzNlIN6b+BCZlj0nOS82pMbf9VbfWHufA/beyv28tSEXjBC 8WCAGSG1MnWHMEpbMjCK0ONDL4pe+vU+jfa4GkJA9e325HfpogmYZMxDAYJBfqntePmA 6r793zDuYCl6NN2r+VMNOPIMBxhhztWeBg4w5qRrjSQX9C3y2TDplUM5FewNQH8UwJ6+ OEqS7eibrsnZokG0bOQ0SgccHTMWqayG3T1zM3hbf4seQZz+a0sv8ZcIRUzz4wY+yr7S LSpw== ARC-Authentication-Results: i=1; mx.google.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=toshiba.co.jp Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u10si5292103ill.152.2021.05.27.20.45.58; Thu, 27 May 2021 20:46:11 -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; 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=toshiba.co.jp Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233967AbhE1AVJ (ORCPT + 99 others); Thu, 27 May 2021 20:21:09 -0400 Received: from mo-csw1114.securemx.jp ([210.130.202.156]:38318 "EHLO mo-csw.securemx.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229911AbhE1AVI (ORCPT ); Thu, 27 May 2021 20:21:08 -0400 Received: by mo-csw.securemx.jp (mx-mo-csw1114) id 14S0J9AJ025780; Fri, 28 May 2021 09:19:09 +0900 X-Iguazu-Qid: 2wGqimLSozX9hKxvxD X-Iguazu-QSIG: v=2; s=0; t=1622161149; q=2wGqimLSozX9hKxvxD; m=Pb46Z15qciiqLgO5v7wtl2OcpgmVSghjbHQivoSirVw= Received: from imx12-a.toshiba.co.jp (imx12-a.toshiba.co.jp [61.202.160.135]) by relay.securemx.jp (mx-mr1112) id 14S0J8hT010418 (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128 verify=NOT); Fri, 28 May 2021 09:19:08 +0900 Received: from enc02.toshiba.co.jp (enc02.toshiba.co.jp [61.202.160.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by imx12-a.toshiba.co.jp (Postfix) with ESMTPS id 143891000A4; Fri, 28 May 2021 09:19:08 +0900 (JST) Received: from hop101.toshiba.co.jp ([133.199.85.107]) by enc02.toshiba.co.jp with ESMTP id 14S0J7TP028838; Fri, 28 May 2021 09:19:07 +0900 Date: Fri, 28 May 2021 09:19:05 +0900 From: Nobuhiro Iwamatsu To: Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= Cc: Bjorn Helgaas , Rob Herring , Lorenzo Pieralisi , linux-pci@vger.kernel.org, punit1.agrawal@toshiba.co.jp, yuji2.ishikawa@toshiba.co.jp, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 2/3] PCI: Visconti: Add Toshiba Visconti PCIe host controller driver X-TSB-HOP: ON Message-ID: <20210528001905.26fvguz7fk7cxxsj@toshiba.co.jp> References: <20210524063004.132043-1-nobuhiro1.iwamatsu@toshiba.co.jp> <20210524063004.132043-3-nobuhiro1.iwamatsu@toshiba.co.jp> <20210524111051.GB244904@rocinante.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210524111051.GB244904@rocinante.localdomain> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Thanks for your review. On Mon, May 24, 2021 at 01:10:51PM +0200, Krzysztof WilczyƄski wrote: > Hi Nobuhiro, > > Thank you for working on this! > > [...] > > +static int visconti_get_resources(struct platform_device *pdev, > > + struct visconti_pcie *pcie) > > +{ > [...] > > + pcie->refclk = devm_clk_get(dev, "pcie_refclk"); > > + if (IS_ERR(pcie->refclk)) { > > + dev_err(dev, "Failed to get refclk clock: %ld\n", > > + PTR_ERR(pcie->refclk)); > > + return PTR_ERR(pcie->refclk); > > + } > > + > > + pcie->sysclk = devm_clk_get(dev, "sysclk"); > > + if (IS_ERR(pcie->sysclk)) { > > + dev_err(dev, "Failed to get sysclk clock: %ld\n", > > + PTR_ERR(pcie->sysclk)); > > + return PTR_ERR(pcie->sysclk); > > + } > > + > > + pcie->auxclk = devm_clk_get(dev, "auxclk"); > > + if (IS_ERR(pcie->auxclk)) { > > + dev_err(dev, "Failed to get auxclk clock: %ld\n", > > + PTR_ERR(pcie->auxclk)); > > + return PTR_ERR(pcie->auxclk); > > + } > > Do you think you could use the dev_err_probe() to handle the > devm_clk_get() failed? Where applicable this is becoming a common > patter drivers apply, for example: > > pcie->refclk = devm_clk_get(dev, "pcie_refclk"); > if (IS_ERR(pcie->refclk)) > return dev_err_probe(dev, PTR_ERR(pcie->refclk), > "failed to get refclk clock\n"); > > [...] Thanks for your suggestion. I will fix using dev_err_probe(). > > + pci->link_gen = of_pci_get_max_link_speed(pdev->dev.of_node); > > + if (pci->link_gen < 0 || pci->link_gen > 3) { > > + pci->link_gen = 3; > > + dev_dbg(dev, "Applied default link speed\n"); > > + } > > + > > + dev_dbg(dev, "Link speed Gen %d", pci->link_gen); > > Question about the above debug messages. > > Given that both are at the same level and the link speed will be printed > regardless of whether it was set to a default value or not, does it make > sense to still print the message about applying the default link speed? > Unless this is something that will be indeed useful during debugging and > troubleshooting (and in which case just ignore this question). I guess so, the message about the default value is not important. I will remove this, thank you. Best regards, Nobuhiro