Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3324245pxj; Mon, 24 May 2021 04:12:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwF7Zcvfbx95+MphhibkYAF9z/8yiLvv+9gkL3kLMpOOHX61agJ4pbYubf6vXG175sQ+Z30 X-Received: by 2002:a17:906:5291:: with SMTP id c17mr22288359ejm.527.1621854771073; Mon, 24 May 2021 04:12:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621854771; cv=none; d=google.com; s=arc-20160816; b=LqSNgWsp0FWXt803JmR1darXZFmQdhs7sBVHvh9AyBom1TTrzGpfcYYACHDpujaCL/ KMcz60nqUVjK5gAuCjkr9q4SPu9XPE3MChAH379zbEH7Kz1Nhm45wZjhBxByNMsfhWpw 3v+txHMXs2Yw64TYUl91hw16RM7BqOBwrUU/X2U67nVKIhRnKWDrzpo50UMaApa8fhrm QX3QRdWaphkOeTrXSTbD4tMqk2Mw3+7BvU1GWg/4nMyeeldYqxPlCnY4cl4VVz6UDm+H Ghw2WTFw88R2FucVi6m4vaCbVR9VLSt3caZi4m8M7ewegEM50UR13X2t+swoEzVR3p9Y unPg== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=t6GZS4pp7BMDU12Bp3a8xgfTMF16pSvQnikKfkBTZ74=; b=0aGtzWhYVl/QSyn0sLeiXVLg8IjdIkLinakaGRrOk1fIc9WvbnhJZ/viRD4nM2ONZS SOzY3hm1UlK2r1BHR8MOXwGnIYrblU7sIG0lcKrKJBWUb4E70zef4ebFdjkE+kpocULm JM/cWmNJEfOg+5sUMdkY1e9ejx6j96HhTshelOmKQNra2ykbI16ag5rpGFdzmLuCHMfv zekLKjJz3QjWmkG7Hd/C4y7x+umE9+Epbz+/5xPWK+FO4YeP5yDiP8QCNp5Riji8h7Dg QbJCCaPA8h0e8kF0Gve4E+ZgPtvWyy5yRh7KbPAoHr2LvOsg2bOqog/BbqP7T2Cb3ksR Q4mA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h17si12829183edw.68.2021.05.24.04.12.28; Mon, 24 May 2021 04:12:51 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232516AbhEXLM1 (ORCPT + 99 others); Mon, 24 May 2021 07:12:27 -0400 Received: from mail-lf1-f44.google.com ([209.85.167.44]:42603 "EHLO mail-lf1-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232805AbhEXLMX (ORCPT ); Mon, 24 May 2021 07:12:23 -0400 Received: by mail-lf1-f44.google.com with SMTP id a2so40083261lfc.9; Mon, 24 May 2021 04:10:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=t6GZS4pp7BMDU12Bp3a8xgfTMF16pSvQnikKfkBTZ74=; b=fAaeJdkqG9+AEnBaw9vLY+UaknRe6GjL2e76lbB1xYXlUmB37oRuR/aRVjjayCsjrt eAm5CGEm6q5TSW/Tx8v4d9kgyPF++AYM6A1lT/yxZ3VTXzM3jQnQyQyJYnastDMIALzy +X2twSH3VzJLvKxPZw5Eqg5BUv3cUse2WVjTpYjeY9/Vt/GcND6/imNOZrhZwJlVC7Ij RKpSVsL8YWSHSWix+yls/M+sM7/Ow+tJybSV4kyJ7And9FvreQdcFGzMSfnrZ3rToj3x pkBbBMqsHcku6e8AW3r7bpJz3Yb91/vMgwF75BNDN1+aq/QDgSM+fOCqFmxt1J21MXwb xlpw== X-Gm-Message-State: AOAM533aajoIcdEBgz5vJFmX6ZKGBeqzykjx85c4xpChSp2ETgFJfL8g ERmUdG3ixbhWJkGFjJk/SvdKJ6l5QoZ03bun X-Received: by 2002:ac2:46f1:: with SMTP id q17mr6723060lfo.359.1621854653630; Mon, 24 May 2021 04:10:53 -0700 (PDT) Received: from rocinante.localdomain ([95.155.85.46]) by smtp.gmail.com with ESMTPSA id r15sm1396410lfr.245.2021.05.24.04.10.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 04:10:53 -0700 (PDT) Date: Mon, 24 May 2021 13:10:51 +0200 From: Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= To: Nobuhiro Iwamatsu 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 Message-ID: <20210524111051.GB244904@rocinante.localdomain> References: <20210524063004.132043-1-nobuhiro1.iwamatsu@toshiba.co.jp> <20210524063004.132043-3-nobuhiro1.iwamatsu@toshiba.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210524063004.132043-3-nobuhiro1.iwamatsu@toshiba.co.jp> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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"); [...] > + 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). Krzysztof