Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3310133pxk; Mon, 7 Sep 2020 09:10:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5awn9FlJa4eoQiL+ps35v+V/xQktPS7KmbQjQsbzEO/h5pi4mJEQUfQd/tTjMzoZOhc4T X-Received: by 2002:a50:aa94:: with SMTP id q20mr21871232edc.119.1599495044548; Mon, 07 Sep 2020 09:10:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599495044; cv=none; d=google.com; s=arc-20160816; b=r6ZnUEnQ4U80ovbdw/saSsSbvGIeV+KSFMowawz7Q518mh7nGga6bAZp9z9WWPEWNt AwHvbNGnvDC/5I0y5ccCZ05LkWF7dwS4h9cJRZLOVkyz6NluCoNX+HwgOjEYRrd5sBpt OJRX7LDlxKwgqv79M8uQzpN3oqfqUMxYt/W/chNxmI+JjLoRenUi9KnFGyHVVELgpZZN A7zt0W8tU7tmRJTOYjXvbo6gwmu4NwKbbfSbTp8qW0AZ11DqQRUV/CoStBRDDJXR9PXs kMaAsX/9gvO4qrfG0zV07gpQ6+wUJ8ZR2woD1kG1ow5Jku1aKzuEkuSsB1t6B3yp9Y0+ /a7A== 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=IamYZpIiX9ERxb6BIcZByts5zdFbsHw5ixK4tgSG8M4=; b=vPOLItMhOgkTyROxonN75dp6DPQr58drvyy2vD1+wUXf7qdliuwpfZ+8G6PRC0Llcn QCIc542yFPds+0jEe4+wDDxbiBQaWMwWtA5c4lPWdCySKvX7dinBmKMiUpyyCRJSrqql l9BcSCtITmtkGAJQ3GdsXnetYyV963nJto5EyqSiUABj0boII4VqvlEJ3NLZGk9wXAvJ +p//Gny1pefm68/HEZNdAuTYtPWnalp/053rAwW/DjiUv1cGF51m6MdJT3WdcQKFW42o LD9Ry3NJ2GXbYCFqZ20588xL8N+ypivPDtJWBmVVeqMdHqQ4zKrI58j8qKLILIWQZGg4 JN1A== 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 gc10si10126308ejb.614.2020.09.07.09.10.22; Mon, 07 Sep 2020 09:10:44 -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 S1729924AbgIGQJh (ORCPT + 99 others); Mon, 7 Sep 2020 12:09:37 -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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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