2008-10-02 16:03:58

by Jesse Barnes

[permalink] [raw]
Subject: Re: [PATCH 3/6 v3] PCI: support ARI capability

On Saturday, September 27, 2008 1:28 am Zhao, Yu wrote:
> Add Alternative Routing-ID Interpretation (ARI) support.
>
> Cc: Jesse Barnes <[email protected]>
> Cc: Randy Dunlap <[email protected]>
> Cc: Grant Grundler <[email protected]>
> Cc: Alex Chiang <[email protected]>
> Cc: Matthew Wilcox <[email protected]>
> Cc: Roland Dreier <[email protected]>
> Cc: Greg KH <[email protected]>
> Signed-off-by: Yu Zhao <[email protected]>
>
> ---
> drivers/pci/pci.c | 31 +++++++++++++++++++++++++++++++
> drivers/pci/pci.h | 12 ++++++++++++
> drivers/pci/probe.c | 3 +++
> include/linux/pci.h | 1 +
> include/linux/pci_regs.h | 14 ++++++++++++++
> 5 files changed, 61 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index 400d3b3..fe9efc4 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -1260,6 +1260,37 @@ void pci_pm_init(struct pci_dev *dev)
> }
> }
>
> +/**
> + * pci_ari_init - turn on ARI forwarding if it's supported
> + * @dev: the PCI device
> + */
> +void pci_ari_init(struct pci_dev *dev)
> +{
> + int pos;
> + u32 cap;
> + u16 ctrl;
> +
> + if (!dev->is_pcie || (dev->pcie_type != PCI_EXP_TYPE_ROOT_PORT &&
> + dev->pcie_type != PCI_EXP_TYPE_DOWNSTREAM))
> + return;
> +
> + pos = pci_find_capability(dev, PCI_CAP_ID_EXP);
> + if (!pos)
> + return;
> +
> + pci_read_config_dword(dev, pos + PCI_EXP_DEVCAP2, &cap);
> +
> + if (!(cap & PCI_EXP_DEVCAP2_ARI))
> + return;
> +
> + pci_read_config_word(dev, pos + PCI_EXP_DEVCTL2, &ctrl);
> + ctrl |= PCI_EXP_DEVCTL2_ARI;
> + pci_write_config_word(dev, pos + PCI_EXP_DEVCTL2, ctrl);
> +
> + dev->ari_enabled = 1;
> + dev_info(&dev->dev, "ARI forwarding enabled.\n");
> +}
> +

Maybe we should be consistent with the other APIs and call it pci_enable_ari
(like we do for wake & msi). Looks pretty good otherwise.

Jesse


2008-10-02 16:17:28

by Matthew Wilcox

[permalink] [raw]
Subject: Re: [PATCH 3/6 v3] PCI: support ARI capability

On Thu, Oct 02, 2008 at 09:03:15AM -0700, Jesse Barnes wrote:
> Maybe we should be consistent with the other APIs and call it pci_enable_ari
> (like we do for wake & msi). Looks pretty good otherwise.

Those APIs are for drivers ... this is internal. I don't have any
objection of my own, though I agree with Alex's remark that the printk
is unnecessary and just adds clutter to the boot process.

--
Matthew Wilcox Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."

2008-10-08 02:58:27

by Zhao, Yu

[permalink] [raw]
Subject: RE: [PATCH 3/6 v3] PCI: support ARI capability

On Friday, October 03, 2008 12:17 AM, Matthew Wilcox wrote:
>On Thu, Oct 02, 2008 at 09:03:15AM -0700, Jesse Barnes wrote:
>> Maybe we should be consistent with the other APIs and call it pci_enable_ari
>> (like we do for wake & msi). Looks pretty good otherwise.
>
>Those APIs are for drivers ... this is internal. I don't have any
>objection of my own, though I agree with Alex's remark that the printk
>is unnecessary and just adds clutter to the boot process.

Will rename the function to pci_enable_ari, and remove the printk.

Thanks.

>
>--
>Matthew Wilcox Intel Open Source Technology Centre
>"Bill, look, we understand that you're interested in selling us this
>operating system, but compare it to ours. We can't possibly take such
>a retrograde step."
>--
>To unsubscribe from this list: send the line "unsubscribe kvm" in
>the body of a message to [email protected]
>More majordomo info at http://vger.kernel.org/majordomo-info.html