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.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 AF09BC43461 for ; Mon, 7 Sep 2020 16:10:35 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5F3142054F for ; Mon, 7 Sep 2020 16:10:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="fzhhcqsr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5F3142054F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=socionext.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ASQMHsQL/G8bJ+XhW3EJWAeHi678DITIgilIoJAxmQo=; b=fzhhcqsrWVPfFShjLpboDIAkm 4KWVxV1R2gWAiSjQOGAPq7vSYSp1alfEV8+xeejooflY4hjDdf4ZblxFoUaWSRx93qB0oTNnqHmfh TsRO4eIyBbipIIp0fq43PTWQrTNmiBKyWn+Ser5VRN+dOJy4MRpttzvOejLm3GMZoqWiTLJgCWcIj RSy2DT4YH/5BDmsqD/Rwb3Un8D/sHZGhzZSmM9KkDPPXCnnCVAqhmAmdDHE9IXBwj3+hsec/IXi9T XLNTyqX29WJ9XZrQm+qDBRPZD0oHd/gxPi9kJsSJTrq34qMjKTc/HDdNz1RYEEPUh1RQ+v/kW16H9 CWiMjvDlg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFJhs-0003ON-MW; Mon, 07 Sep 2020 16:09:24 +0000 Received: from mx.socionext.com ([202.248.49.38]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFJhm-0003Lh-As for linux-arm-kernel@lists.infradead.org; Mon, 07 Sep 2020 16:09:19 +0000 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 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-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200907_120918_715423_35ADEC22 X-CRM114-Status: GOOD ( 30.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Lorenzo Pieralisi , Masami Hiramatsu , Jassi Brar , Jingoo Han , PCI , "linux-kernel@vger.kernel.org" , Masahiro Yamada , Marc Zyngier , Bjorn Helgaas , Gustavo Pimentel , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel