From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.1 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0ADDC43461 for ; Mon, 7 Sep 2020 16:09:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 93D332087D for ; Mon, 7 Sep 2020 16:09:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730284AbgIGQJU (ORCPT ); Mon, 7 Sep 2020 12:09:20 -0400 Received: from mx.socionext.com ([202.248.49.38]:4572 "EHLO mx.socionext.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730004AbgIGQJS (ORCPT ); Mon, 7 Sep 2020 12:09:18 -0400 Received: from unknown (HELO kinkan-ex.css.socionext.com) ([172.31.9.52]) by mx.socionext.com with ESMTP; 08 Sep 2020 01:09:14 +0900 Received: from mail.mfilter.local (m-filter-1 [10.213.24.61]) by kinkan-ex.css.socionext.com (Postfix) with ESMTP id 4D7AD1800E0; Tue, 8 Sep 2020 01:09:14 +0900 (JST) Received: from 172.31.9.53 (172.31.9.53) by m-FILTER with ESMTP; Tue, 8 Sep 2020 01:09:14 +0900 Received: from yuzu.css.socionext.com (yuzu [172.31.8.45]) by iyokan.css.socionext.com (Postfix) with ESMTP id 2AC7340374; Tue, 8 Sep 2020 01:09:14 +0900 (JST) Received: from [10.212.1.10] (unknown [10.212.1.10]) by yuzu.css.socionext.com (Postfix) with ESMTP id C8270120131; Tue, 8 Sep 2020 01:09:12 +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: Tue, 8 Sep 2020 01:09:12 +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: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Hi Rob, On 2020/09/04 7:25, Rob Herring wrote: > On Fri, Aug 21, 2020 at 1:05 AM Kunihiko Hayashi > wrote: >> >> 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? > > Nevermind. I was thinking we had some error prints for the optional > vs. non-optional variants. I understand. As long as this phy is "optional", this doesn't need to print error message. Once I cancel this patch, and leave the phy as "optional". Thank you, --- Best Regards Kunihiko Hayashi