linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Gavin Shan <gwshan@linux.vnet.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: Gavin Shan <gwshan@linux.vnet.ibm.com>,
	Andrew Donnellan <andrew.donnellan@au1.ibm.com>,
	linuxppc-dev@lists.ozlabs.org, imunsie@au1.ibm.com
Subject: Re: [PATCH] drivers/misc/cxl: Avoid unnecessary error message
Date: Wed, 8 Feb 2017 13:46:38 +1100	[thread overview]
Message-ID: <20170208024638.GA14581@gwshan> (raw)
In-Reply-To: <87poit9zg0.fsf@concordia.ellerman.id.au>

On Wed, Feb 08, 2017 at 01:41:19PM +1100, Michael Ellerman wrote:
>Gavin Shan <gwshan@linux.vnet.ibm.com> writes:
>
>> On Wed, Feb 08, 2017 at 10:39:55AM +1100, Andrew Donnellan wrote:
>>>On 08/02/17 10:21, Gavin Shan wrote:
>>>>On Tue, Feb 07, 2017 at 10:12:48PM +1100, Michael Ellerman wrote:
>>>>>Andrew Donnellan <andrew.donnellan@au1.ibm.com> writes:
>>>>
>>>>.../...
>>>>
>>>>>>The effect of this patch is to copy the memory resources from the *real*
>>>>>>PHB to the vPHB, as given through the device tree. It shouldn't have any
>>>>>>practical effect other than squashing this message.
>>>>>
>>>>>It sounds a bit backward to me. If we don't need the resources then
>>>>>why have them?
>>>>>
>>>>>If we have code that thinks that's an error, than maybe that's what
>>>>>needs fixing, or special casing for the vPHB?
>>>>>
>>>>
>>>>Yeah, vPHB is a special case. There are basically two stages in PCI enumeration:
>>>>probing and then resource assignment. vPHB is different from *real* PHB as the
>>>>resource assignment is skipped on it. So vPHB doesn't need any resources to be
>>>>populated. However, there is a check in probing stage and it's where the warning
>>>>message comes from.
>>>>
>>>>   drivers/misc/cxl/vphb.c::cxl_pci_vphb_add()
>>>>   arch/powerpc/kernel/pci-common.c::pcibios_scan_phb()
>>>>                                     pcibios_setup_phb_resources()
>>>>
>>>>   static void pcibios_setup_phb_resources(struct pci_controller *hose,
>>>>                                        struct list_head *resources)
>>>>   {
>>>>       :
>>>>       for (i = 0; i < 3; ++i) {
>>>>            res = &hose->mem_resources[i];
>>>>            if (!res->flags) {
>>>>                if (i == 0)
>>>>                    printk(KERN_ERR "PCI: Memory resource 0 not set for "
>>>>                        "host bridge %s (domain %d)\n",
>>>>                        hose->dn->full_name, hose->global_number);
>>>>                continue;
>>>>            }
>>>>       :
>>>>   }
>>>>
>>>>Alternatively, we can replace prink(KERN_ERR) with pr_debug(). It's going to
>>>>affect all PHBs including the real ones. Andrew and Michael, what do you think? :-)
>>>
>>>In what other circumstances do we get this error printed on real PHBs?
>>>
>>
>> When hose->mem_resources[0] isn't built from PHB's device-tree node. It means
>> the device-tree node's "ranges" isn't populated correctly by loader and it
>> should be very rare ... I never saw it before.
>
>Sounds to me like we could probably just drop the warning. Or make it pr_devel().
>

Agree, I will drop it and post the patch shortly. Thanks for confirm.

Thanks,
Gavin

  reply	other threads:[~2017-02-08  2:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-31  3:43 [PATCH] drivers/misc/cxl: Avoid unnecessary error message Gavin Shan
2017-02-07  8:14 ` Andrew Donnellan
2017-02-07 11:12   ` Michael Ellerman
2017-02-07 23:21     ` Gavin Shan
2017-02-07 23:39       ` Andrew Donnellan
2017-02-07 23:57         ` Gavin Shan
2017-02-08  2:41           ` Michael Ellerman
2017-02-08  2:46             ` Gavin Shan [this message]
2017-02-07 23:08   ` Gavin Shan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170208024638.GA14581@gwshan \
    --to=gwshan@linux.vnet.ibm.com \
    --cc=andrew.donnellan@au1.ibm.com \
    --cc=imunsie@au1.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).