Re: [PATCH V5] PCI: loongson: Skip scanning unavailable child devices

From: Liu Peibao
Date: Wed Nov 16 2022 - 21:05:09 EST


On 11/17/22 2:14 AM, Bjorn Helgaas wrote:
> On Wed, Nov 16, 2022 at 05:57:46PM +0800, Liu Peibao wrote:
>> On 11/15/22 1:11 AM, Bjorn Helgaas wrote:
>>> On Mon, Nov 14, 2022 at 03:43:46PM +0800, Liu Peibao wrote:
>
>>> I assume there's a single device in the hardware, and both the
>>> "platform device" and the PCI device" refer to that single device?
>>>
>>> And there's some reason you prefer to use the platform device
>>> interface to enumerate that device?
>>
>> No, they are not the same device. For example, GMAC1(on chip PCI device) and
>> GPIO(platform device, not PCI device) 14 use the same pin. The function for
>> this pin can be configured by one bit in general register, eg, 0 for GPIO 14,
>> 1 for GMAC1. Sometimes, GPIO 14 is preferred, so configure the pin with
>> function GPIO 14 and disable GMAC1.
>
> Ah, I see, so there's some circuit that can be driven by either the
> platform (GPIO) device or the PCI (GMAC1) device.
>

That is really the point. Sorry for my poor description and English :).

>> Overall, how about the following refactored commit log:
>>
>> "This patch adds a mechanism to disable on chip PCI devices by DT. Typically,
>> when there are pins shareable between the platform device and the on chip PCI
>> device, if the PCI device is not preferred, add `status = "disabled"` property
>> to this PCI device DT node.
>>
>> For example, on LS2K1000, GMAC1(on chip PCI device) and GPIO(platform device,
>> not PCI device) 14 share the same pin. If GMAC1 is not preferred, add
>> `status = "disabled"` property in GMAC1 DT node."
>
> Add a mechanism ...
>
> (Instead of "This patch adds ..."; no need to say "this patch" because
> it's obvious that the commit log applies to *this patch*)
>
> Add spaces before "(", e.g., "GMAC1 (on-chip PCI device)".
>
> Looks good!
>
> Bjorn
>

I will modify these and send the next version patch.

Thanks a lot!

BR,
Peibao