All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Hans Zhang" <18255117159@163.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH v4 01/16] PCI: dwc: Add pcie_cap field and caching helper
Date: Tue, 27 Oct 2026 12:34:06 +0000	[thread overview]
Message-ID: <sashiko-outbox-186563@kernel.org> (raw)
In-Reply-To: <20261027122827.2725643-2-18255117159@163.com>

> The DWC PCIe core and its platform drivers repeatedly call
> dw_pcie_find_capability(pci, PCI_CAP_ID_EXP) to obtain the offset of the
> PCI Express Capability structure. Besides being verbose, that performs a
> DBI read every time, including in paths that run repeatedly such as link
> up polling, suspend/resume and interrupt handlers.
> 
> Add a pcie_cap field to struct dw_pcie and a helper
> dw_pcie_get_pcie_cap() that performs the lookup on first use and caches
> the result for the subsequent calls.
> 
> The lookup is deliberately done lazily, at the first place that needs the
> offset, instead of at a fixed point during controller initialization.
> This guarantees that the DBI read happens exactly when the open coded
> dw_pcie_find_capability() call it replaces used to happen, so no DBI
> access can be made before the controller clocks, resets and power are
> [ ... ]
> cannot happen on real DWC hardware, where the PCI Express Capability is
> mandatory, so a negative result is not cached separately: it only causes
> the search to be repeated, which does not affect correctness.
> 
> Signed-off-by: Hans Zhang <18255117159@163.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261027122827.2725643-1-18255117159@163.com?part=1


  reply	other threads:[~2026-10-27 12:34 UTC|newest]

Thread overview: 104+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-27 12:28 [PATCH v4 00/16] PCI: dwc: Cache PCIe capability offset Hans Zhang
2026-10-27 12:28 ` Hans Zhang
2026-10-27 12:28 ` Hans Zhang
2026-10-27 12:28 ` Hans Zhang
2026-10-27 12:28 ` [PATCH v4 01/16] PCI: dwc: Add pcie_cap field and caching helper Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:34   ` sashiko-bot [this message]
2026-10-27 13:12   ` Shawn Lin
2026-10-27 13:12     ` Shawn Lin
2026-10-27 13:12     ` Shawn Lin
2026-10-27 13:12     ` Shawn Lin
2026-10-28  3:04     ` Hans Zhang
2026-10-28  3:04       ` Hans Zhang
2026-10-28  3:04       ` Hans Zhang
2026-10-28  3:04       ` Hans Zhang
2026-10-27 12:28 ` [PATCH v4 02/16] PCI: dwc: Use cached PCIe capability offset in core Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:33   ` sashiko-bot
2026-10-27 12:28 ` [PATCH v4 03/16] PCI: dwc: imx6: Use cached PCIe capability offset Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:33   ` sashiko-bot
2026-10-27 12:28 ` [PATCH v4 04/16] PCI: dwc: layerscape-ep: " Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:35   ` sashiko-bot
2026-10-27 12:28 ` [PATCH v4 05/16] PCI: dwc: meson: " Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:32   ` sashiko-bot
2026-10-27 12:28 ` [PATCH v4 06/16] PCI: dwc: rockchip: " Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:32   ` sashiko-bot
2026-10-27 12:36   ` Shawn Lin
2026-10-27 12:36     ` Shawn Lin
2026-10-27 12:36     ` Shawn Lin
2026-10-27 12:36     ` Shawn Lin
2026-10-27 12:28 ` [PATCH v4 07/16] PCI: dwc: eswin: " Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:32   ` sashiko-bot
2026-10-27 12:28 ` [PATCH v4 08/16] PCI: dwc: fu740: " Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:32   ` sashiko-bot
2026-10-27 12:28 ` [PATCH v4 09/16] PCI: dwc: intel-gw: " Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:32   ` sashiko-bot
2026-10-27 12:28 ` [PATCH v4 10/16] PCI: dwc: qcom-ep: " Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:33   ` sashiko-bot
2026-10-27 12:28 ` [PATCH v4 11/16] PCI: dwc: qcom: " Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:34   ` sashiko-bot
2026-10-27 12:28 ` [PATCH v4 12/16] PCI: dwc: sophgo: " Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:32   ` sashiko-bot
2026-10-27 12:28 ` [PATCH v4 13/16] PCI: dwc: spacemit-k1: " Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:32   ` sashiko-bot
2026-10-27 12:28 ` [PATCH v4 14/16] PCI: dwc: spear13xx: " Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:33   ` sashiko-bot
2026-10-27 12:28 ` [PATCH v4 15/16] PCI: dwc: tegra194: " Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:34   ` sashiko-bot
2026-10-27 12:28 ` [PATCH v4 16/16] PCI: dwc: ultrarisc: " Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:28   ` Hans Zhang
2026-10-27 12:33   ` sashiko-bot
2026-10-27 23:15 ` [PATCH v4 00/16] PCI: dwc: Cache " Bjorn Helgaas
2026-10-27 23:15   ` Bjorn Helgaas
2026-10-27 23:15   ` Bjorn Helgaas
2026-10-27 23:15   ` Bjorn Helgaas
2026-10-28  2:10   ` Hans Zhang
2026-10-28  2:10     ` Hans Zhang
2026-10-28  2:10     ` Hans Zhang
2026-10-28  2:10     ` Hans Zhang

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=sashiko-outbox-186563@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=18255117159@163.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.