From: poza@codeaurora.org (poza at codeaurora.org)
To: linux-arm-kernel@lists.infradead.org
Subject: [3/4] PCI/portdrv: Implement interface to query the registered service
Date: Tue, 14 Nov 2017 04:56:30 +0530 [thread overview]
Message-ID: <b98f5b7e1b64f9d5ce1ff7e52fa0887d@codeaurora.org> (raw)
In-Reply-To: <73379e2c-b0c3-885c-bb5d-b981863b6042@codeaurora.org>
On 2017-11-14 02:22, Sinan Kaya wrote:
> Some nits only.
>
>> /**
>> + * pcie_port_service_query - query if particula port service is
>> enabled.
>> + * dev: pcie device
>> + * @port service: PCI express port service
>> + */
>> +int pcie_port_query_service(struct pci_dev *dev, u32 port_service)
>> +{
>> + struct pcie_device *pdev;
>> + struct pci_dev *parent, *this = dev;
>> +
>> + do {
>
> While I understand the motivation why this function is searching for
> DPC capable
> parent until the root port, the name of the function does not represent
> this.
>
Will change it to more relevant one.
> It might make sense to split this into two where the first function
> just queries
> the capabilities of the immediate device (the list_for_each_section).
>
>> + list_for_each_entry(pdev, &this->service_list, slist) {
>> + if (pdev->service == port_service)
>> + return 1;
>> + }
>
> Another function to query all parents until you reach the root port.
>
>> + parent = pci_upstream_bridge(this);
>> + this = parent;
>> + } while (parent && pci_is_pcie(parent));
>> +
>> + return 0;
>> +}
>> +EXPORT_SYMBOL(pcie_port_query_service);
>> +
yes that makes sense; will split the function as you are suggesting.
Regards,
Oza.
next prev parent reply other threads:[~2017-11-13 23:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-09 20:46 [PATCH 0/4] PCI: query active service list Pawandeep Oza
2017-11-09 20:46 ` [PATCH 1/4] PCI: Add port service list node for pci_dev Pawandeep Oza
2017-11-09 20:46 ` [PATCH 2/4] PCI/portdrv: Add/Remove port services to the list Pawandeep Oza
2017-11-09 20:46 ` [PATCH 3/4] PCI/portdrv: Implement interface to query the registered service Pawandeep Oza
2017-11-13 20:52 ` [3/4] " Sinan Kaya
2017-11-13 23:26 ` poza at codeaurora.org [this message]
2017-11-09 20:46 ` [PATCH 4/4] PCI/AER: Dont do recovery when DPC is enabled Pawandeep Oza
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=b98f5b7e1b64f9d5ce1ff7e52fa0887d@codeaurora.org \
--to=poza@codeaurora.org \
--cc=linux-arm-kernel@lists.infradead.org \
/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).