[PATCH 3/6 v3] PCI: support ARI capability

Alex Chiang
Tue, 30 Sep 2008 22:31:24 -0000

* Zhao, Yu <yu.zhao at intel.com>:
> Add Alternative Routing-ID Interpretation (ARI) support.
>
> Cc: Jesse Barnes <jbarnes at virtuousgeek.org>
> Cc: Randy Dunlap <randy.dunlap at oracle.com>
> Cc: Grant Grundler <grundler at parisc-linux.org>
> Cc: Alex Chiang <achiang at hp.com>
> Cc: Matthew Wilcox <matthew at wil.cx>
> Cc: Roland Dreier <rdreier at cisco.com>
> Cc: Greg KH <greg at kroah.com>
> Signed-off-by: Yu Zhao <yu.zhao at intel.com>
>
> ---
>  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");

This is user-visible, so my questions are:

	1) Does this really add value for the user? Or is this
	just more noise?

	2) Is this output string informative enough for the user?

Thanks.

/ac