Re: [PATCH V2 1/9] PCI: Introduce PCIe TPH support framework

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 31 May 2024 16:38:33 -0500
Wei Huang <wei.huang2@xxxxxxx> wrote:

> This patch implements the framework for PCIe TPH support. It introduces
> tph.c source file, along with CONFIG_PCIE_TPH, to Linux PCIe subsystem.
> A new member, named tph_cap, is also introduced in pci_dev to cache TPH
> capability offset.
> 
> Co-developed-by: Eric Van Tassell <Eric.VanTassell@xxxxxxx>
> Signed-off-by: Eric Van Tassell <Eric.VanTassell@xxxxxxx>
> Signed-off-by: Wei Huang <wei.huang2@xxxxxxx>
> Reviewed-by: Ajit Khaparde <ajit.khaparde@xxxxxxxxxxxx>
> Reviewed-by: Somnath Kotur <somnath.kotur@xxxxxxxxxxxx> 
> Reviewed-by: Andy Gospodarek <andrew.gospodarek@xxxxxxxxxxxx>


One trivial comment inline.
With that fixed.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>

> diff --git a/drivers/pci/pcie/tph.c b/drivers/pci/pcie/tph.c
> new file mode 100644
> index 000000000000..5f0cc06b74bb
> --- /dev/null
> +++ b/drivers/pci/pcie/tph.c
> @@ -0,0 +1,28 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * TPH (TLP Processing Hints) support
> + *
> + * Copyright (C) 2024 Advanced Micro Devices, Inc.
> + *     Eric Van Tassell <Eric.VanTassell@xxxxxxx>
> + *     Wei Huang <wei.huang2@xxxxxxx>
> + */
> +
> +#define pr_fmt(fmt) "TPH: " fmt
> +#define dev_fmt pr_fmt
> +
> +#include <linux/acpi.h>
> +#include <uapi/linux/pci_regs.h>
> +#include <linux/kernel.h>
> +#include <linux/errno.h>
> +#include <linux/msi.h>
> +#include <linux/pci.h>
> +#include <linux/msi.h>
> +#include <linux/pci-acpi.h>

Introduce headers as you first use them.  That way we can more
easily see if there are unused ones in this list.


> +
> +#include "../pci.h"
> +
> +void pcie_tph_init(struct pci_dev *dev)
> +{
> +	dev->tph_cap = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_TPH);
> +}
> +
> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> index 15168881ec94..1f1ae55a5f83 100644
> --- a/drivers/pci/probe.c
> +++ b/drivers/pci/probe.c
> @@ -2484,6 +2484,7 @@ static void pci_init_capabilities(struct pci_dev *dev)
>  	pci_dpc_init(dev);		/* Downstream Port Containment */
>  	pci_rcec_init(dev);		/* Root Complex Event Collector */
>  	pci_doe_init(dev);		/* Data Object Exchange */
> +	pcie_tph_init(dev);             /* TLP Processing Hints */
>  
>  	pcie_report_downtraining(dev);
>  	pci_init_reset_methods(dev);
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index 5bece7fd11f8..d75a88ec5136 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -530,6 +530,10 @@ struct pci_dev {
>  
>  	/* These methods index pci_reset_fn_methods[] */
>  	u8 reset_methods[PCI_NUM_RESET_METHODS]; /* In priority order */
> +
> +#ifdef CONFIG_PCIE_TPH
> +	u16 tph_cap; /* TPH capability offset */
> +#endif
>  };
>  
>  static inline struct pci_dev *pci_physfn(struct pci_dev *dev)





[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux