Re: [PATCH v4 2/2] PCI: Add the enhanced ACS controls check to pci_acs_flags_enabled()

From: Wei Wang

Date: Tue Feb 10 2026 - 10:08:33 EST


On 2/10/26 12:50 AM, Jonathan Cameron wrote:
+ /*
+ * The USP Memory Target Access is only applicable to downstream ports
+ * that have applicable Memory BAR space in the Switch Upstream Port to
+ * protect.
+ */
+ if (is_dsp && pci_dev_has_memory_bars(usp_pdev) &&
+ (ctrl & mask) != PCI_ACS_UMAC_RB &&
+ (ctrl & mask) != PCI_ACS_UMAC_RR)
+ return false;
+
+ /* PCI_ACS_URRC is applicable to Downstream Ports only. */
+ if (is_dsp && !(ctrl & PCI_ACS_URRC))
+ return false;

I'd be tempted to group the DSP specific handling and drop the local variable.

if (pci_pcie_type(pdev) == PCI_EXP_TYPE_DOWNSTREAM) {
if (pci_dev_has_memory_bars(usp_pdev) &&
(ctrl & mask) != PCI_ACS_UMAC_RB &&
(ctrl & mask) != PCI_ACS_UMAC_RR)
// or use FIELD_GET() to get using the mask suggested in previous patch then
// match what was in the filed here.

Sounds good, thanks.