Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp41143pxa; Fri, 21 Aug 2020 00:06:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5uuoYFH6q7Z1EaWlEl7FKEiLphfv9j9147SByCh9+puYiBkI4a/Q0rkfZINrfX9pkTqaE X-Received: by 2002:aa7:d5d5:: with SMTP id d21mr1496720eds.229.1597993600234; Fri, 21 Aug 2020 00:06:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597993600; cv=none; d=google.com; s=arc-20160816; b=MkeWQsD8LuGAw1bqO8fRxcWk1/dpidImwzK2Ao9ODMGXPN7hhQQNVPU7LB1BxaH05H kJnbWLE8O2Pheccq5fwT4Ty/jdccdolyA7n7nELIX7CwHOm1d3YXJBKoKJvqwkVP06qC b7srw2j8/WwkcAOMQ3Yi7kK3RWnBvzHtTzzYnDuCBP3/t4AoprB3ZoNBBkUw6lGZqrIW G5htBbIfh2/2UkWUA5k/E/jAXfJCgeWRr+YtTY/26L+HZpujY+fR2eQ1ypOmzp5EPHRG 0BwxPH7n34L9FW5POWdygya4XVIW3GdTjM8fuC1pfhkJd7FnE7iDjzm+RD87hYtk1JtD 0G1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=55vkFx0Hy5E5YpoSoV5mIzSRBQ8EXX7SVC2GEPr3yt4=; b=eRRTa67WTxSuM2RRTEJxv1hQ+1wqH1ra69hbX9sVvoXEe0sK5Zh9R6i1x3SmkJjyze xGXa9Xuto0qSnd/Gu1wrENhcRQwHrv/1L2LAX0po3OzAvK7IWvKM9Woq6d4XnYyvtFyh Pl7ZDI9/IIR6P+ad8iO4hvF8S33nNXKiJs9lVjLURC515RQo1U4Of6Tk8WUG16cIhtg7 NRkJXuKQhIucZRphuY7l4xE9C/2ty9j7vRVUqSqa6STLP8DcH35Rw9uF9cE5iFXeXO7v NI7fgsXbyPBySxXZdqtjByfP5lqM/ktZy+rasMm7eENWcHcyFbmTJZHXXGAga/KNK5E6 /03w== 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 r25si597149ejx.486.2020.08.21.00.06.16; Fri, 21 Aug 2020 00:06: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; 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 S1727946AbgHUHF0 (ORCPT + 99 others); Fri, 21 Aug 2020 03:05:26 -0400 Received: from mx.socionext.com ([202.248.49.38]:41769 "EHLO mx.socionext.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726548AbgHUHFX (ORCPT ); Fri, 21 Aug 2020 03:05:23 -0400 Received: from unknown (HELO iyokan-ex.css.socionext.com) ([172.31.9.54]) by mx.socionext.com with ESMTP; 21 Aug 2020 16:05:21 +0900 Received: from mail.mfilter.local (m-filter-2 [10.213.24.62]) by iyokan-ex.css.socionext.com (Postfix) with ESMTP id A700A60060; Fri, 21 Aug 2020 16:05:22 +0900 (JST) Received: from 172.31.9.53 (172.31.9.53) by m-FILTER with ESMTP; Fri, 21 Aug 2020 16:05:22 +0900 Received: from yuzu.css.socionext.com (yuzu [172.31.8.45]) by iyokan.css.socionext.com (Postfix) with ESMTP id 5EB784036B; Fri, 21 Aug 2020 16:05:22 +0900 (JST) Received: from [10.212.1.43] (unknown [10.212.1.43]) by yuzu.css.socionext.com (Postfix) with ESMTP id BA90C120B93; Fri, 21 Aug 2020 16:05:21 +0900 (JST) Subject: Re: [PATCH v6 6/6] PCI: uniphier: Add error message when failed to get phy To: Rob Herring Cc: Lorenzo Pieralisi , Bjorn Helgaas , Jingoo Han , Gustavo Pimentel , Masahiro Yamada , Marc Zyngier , PCI , devicetree@vger.kernel.org, "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , "linux-kernel@vger.kernel.org" , Masami Hiramatsu , Jassi Brar References: <1596795922-705-1-git-send-email-hayashi.kunihiko@socionext.com> <1596795922-705-7-git-send-email-hayashi.kunihiko@socionext.com> From: Kunihiko Hayashi Message-ID: Date: Fri, 21 Aug 2020 16:05:21 +0900 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/08/18 1:39, Rob Herring wrote: > On Fri, Aug 7, 2020 at 4:25 AM Kunihiko Hayashi > wrote: >> >> Even if phy driver doesn't probe, the error message can't be distinguished >> from other errors. This displays error message caused by the phy driver >> explicitly. >> >> Signed-off-by: Kunihiko Hayashi >> --- >> drivers/pci/controller/dwc/pcie-uniphier.c | 8 ++++++-- >> 1 file changed, 6 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/pci/controller/dwc/pcie-uniphier.c b/drivers/pci/controller/dwc/pcie-uniphier.c >> index 93ef608..7c8721e 100644 >> --- a/drivers/pci/controller/dwc/pcie-uniphier.c >> +++ b/drivers/pci/controller/dwc/pcie-uniphier.c >> @@ -489,8 +489,12 @@ static int uniphier_pcie_probe(struct platform_device *pdev) >> return PTR_ERR(priv->rst); >> >> priv->phy = devm_phy_optional_get(dev, "pcie-phy"); > > The point of the optional variant vs. devm_phy_get() is whether or not > you get an error message. So shouldn't you switch to devm_phy_get > instead? > >> - if (IS_ERR(priv->phy)) >> - return PTR_ERR(priv->phy); >> + if (IS_ERR(priv->phy)) { >> + ret = PTR_ERR(priv->phy); >> + if (ret != -EPROBE_DEFER) >> + dev_err(dev, "Failed to get phy (%d)\n", ret); >> + return ret; >> + } The 'phys' property is optional, so if there isn't 'phys' in the PCIe node, devm_phy_get() returns -ENODEV, and devm_phy_optional_get() returns NULL. When devm_phy_optional_get() replaces devm_phy_get(), condition for displaying an error message changes to: (ret != -EPROBE_DEFER && ret != -ENODEV) This won't be simple, but should it be replaced? Thank you, --- Best Regards Kunihiko Hayashi