[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YMbsSfQR65TLkbiX@infradead.org>
Date: Mon, 14 Jun 2021 06:42:33 +0100
From: Christoph Hellwig <hch@...radead.org>
To: Dongdong Liu <liudongdong3@...wei.com>
Cc: helgaas@...nel.org, hch@...radead.org, kw@...ux.com,
linux-pci@...r.kernel.org, rajur@...lsio.com,
hverkuil-cisco@...all.nl, linux-media@...r.kernel.org,
netdev@...r.kernel.org
Subject: Re: [RESEND PATCH V3 1/6] PCI: Use cached Device Capabilities
Register
On Sun, Jun 13, 2021 at 05:29:10PM +0800, Dongdong Liu wrote:
> It will make sense to store the pcie_devcap value in the pci_dev
> structure instead of reading Device Capabilities Register multiple
> times. The fisrt place to use pcie_devcap is in set_pcie_port_type(),
> get the pcie_devcap value here, then use cached pcie_devcap in the
> needed place.
>
> Acked-by: Hans Verkuil <hverkuil-cisco@...all.nl>
> Signed-off-by: Dongdong Liu <liudongdong3@...wei.com>
> ---
> drivers/media/pci/cobalt/cobalt-driver.c | 4 ++--
> drivers/pci/pci.c | 5 +----
> drivers/pci/pcie/aspm.c | 11 ++++-------
> drivers/pci/probe.c | 11 +++--------
> drivers/pci/quirks.c | 3 +--
> include/linux/pci.h | 1 +
> 6 files changed, 12 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/media/pci/cobalt/cobalt-driver.c b/drivers/media/pci/cobalt/cobalt-driver.c
> index 839503e..04e735f 100644
> --- a/drivers/media/pci/cobalt/cobalt-driver.c
> +++ b/drivers/media/pci/cobalt/cobalt-driver.c
> @@ -193,11 +193,11 @@ void cobalt_pcie_status_show(struct cobalt *cobalt)
> return;
>
> /* Device */
> - pcie_capability_read_dword(pci_dev, PCI_EXP_DEVCAP, &capa);
> pcie_capability_read_word(pci_dev, PCI_EXP_DEVCTL, &ctrl);
> pcie_capability_read_word(pci_dev, PCI_EXP_DEVSTA, &stat);
> cobalt_info("PCIe device capability 0x%08x: Max payload %d\n",
> - capa, get_payload_size(capa & PCI_EXP_DEVCAP_PAYLOAD));
> + capa,
> + get_payload_size(pci_dev->pcie_devcap & PCI_EXP_DEVCAP_PAYLOAD));
Overly long line.
> + if (!(child->pcie_devcap & PCI_EXP_DEVCAP_RBER) && !aspm_force) {
Another one.
Otherwise looks good:
Reviewed-by: Christoph Hellwig <hch@....de>
Powered by blists - more mailing lists