All of lore.kernel.org
 help / color / mirror / Atom feed
From: poza@codeaurora.org
To: Sinan Kaya <okaya@codeaurora.org>
Cc: linux-pci@vger.kernel.org, timur@codeaurora.org,
	Bjorn Helgaas <bhelgaas@google.com>,
	Dongdong Liu <liudongdong3@huawei.com>,
	Gabriele Paoloni <gabriele.paoloni@huawei.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-arm-msm@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [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.

WARNING: multiple messages have this Message-ID (diff)
From: poza@codeaurora.org
To: Sinan Kaya <okaya@codeaurora.org>
Cc: Gabriele Paoloni <gabriele.paoloni@huawei.com>,
	linux-pci@vger.kernel.org, timur@codeaurora.org,
	linux-arm-kernel@lists.infradead.org,
	Dongdong Liu <liudongdong3@huawei.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-arm-msm@vger.kernel.org
Subject: Re: [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.


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
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.

  reply	other threads:[~2017-11-13 23:26 UTC|newest]

Thread overview: 17+ 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 ` 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   ` Pawandeep Oza
2017-11-09 20:46   ` 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   ` Pawandeep Oza
2017-11-09 20:46 ` [PATCH 3/4] PCI/portdrv: Implement interface to query the registered service Pawandeep Oza
2017-11-09 20:46   ` Pawandeep Oza
2017-11-13 20:52   ` [3/4] " Sinan Kaya
2017-11-13 20:52     ` Sinan Kaya
2017-11-13 20:52     ` Sinan Kaya
2017-11-13 23:26     ` poza [this message]
2017-11-13 23:26       ` poza at codeaurora.org
2017-11-13 23:26       ` poza
2017-11-09 20:46 ` [PATCH 4/4] PCI/AER: Dont do recovery when DPC is enabled Pawandeep Oza
2017-11-09 20:46   ` 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=bhelgaas@google.com \
    --cc=gabriele.paoloni@huawei.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=liudongdong3@huawei.com \
    --cc=okaya@codeaurora.org \
    --cc=tglx@linutronix.de \
    --cc=timur@codeaurora.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.