Skip to contentSkip to conversation

Is there a reason pci_quirk_enable_intel_rp_mpc_acs() uses pci_write_config_word()

QUERY ALOK TIWARI 2 participants 2 messages Oct 14, 2025 PCI

lore
Share & tools
lore
#0 lore raw

Hi,

function pci_quirk_enable_intel_rp_mpc_acs() in drivers/pci/quirks.c, I noticed that the code reads a 32-bit value from INTEL_MPC_REG using pci_read_config_dword(), but writes it back using pci_write_config_word().

The relevant lines are:

    pci_read_config_dword(dev, INTEL_MPC_REG, &mpc);
    if (!(mpc & INTEL_MPC_REG_IRBNCE)) {
        pci_info(dev, "Enabling MPC IRBNCE\n");
        mpc |= INTEL_MPC_REG_IRBNCE;
        pci_write_config_word(dev, INTEL_MPC_REG, mpc);
    }

Given that:
/* Miscellaneous Port Configuration register */ #define INTEL_MPC_REG 0xd8
/* MPC: Invalid Receive Bus Number Check Enable */ #define INTEL_MPC_REG_IRBNCE (1 << 26)

the IRBNCE bit is in the upper 16 bits of this 32-bit register.
It seems that using pci_write_config_word() would not actually update that bit.

is there a specific hardware reason for using a 16-bit write?

Thanks,
Alok

---

drivers/pci/quirks.c +1 -1
index 214ed060ca1b..1bd6e70058b5 100644
@@ -5312,7 +5312,7 @@ static void pci_quirk_enable_intel_rp_mpc_acs(struct pci_dev *dev)
        if (!(mpc & INTEL_MPC_REG_IRBNCE)) {
                pci_info(dev, "Enabling MPC IRBNCE\n");
                mpc |= INTEL_MPC_REG_IRBNCE;
-               pci_write_config_word(dev, INTEL_MPC_REG, mpc);
+               pci_write_config_dword(dev, INTEL_MPC_REG, mpc);
        }
 }
#1 lore raw
Quoted 22 lines · On Tue, 14 Oct 2025 10:57:39 +0530 ALOK TIWARI <[email protected]> wrote:

Hi,

function pci_quirk_enable_intel_rp_mpc_acs() in drivers/pci/quirks.c, I noticed that the code reads a 32-bit value from INTEL_MPC_REG using pci_read_config_dword(), but writes it back using pci_write_config_word().

The relevant lines are:

     pci_read_config_dword(dev, INTEL_MPC_REG, &mpc);
     if (!(mpc & INTEL_MPC_REG_IRBNCE)) {
         pci_info(dev, "Enabling MPC IRBNCE\n");
         mpc |= INTEL_MPC_REG_IRBNCE;
         pci_write_config_word(dev, INTEL_MPC_REG, mpc);
     }

Given that:
/* Miscellaneous Port Configuration register */ #define INTEL_MPC_REG 0xd8
/* MPC: Invalid Receive Bus Number Check Enable */ #define INTEL_MPC_REG_IRBNCE (1 << 26)

Quoted 5 lines

the IRBNCE bit is in the upper 16 bits of this 32-bit register. It seems that using pci_write_config_word() would not actually update that bit.

is there a specific hardware reason for using a 16-bit write?

It looks like a typo to me. Please post a formal fix. Thanks,

Alex

Quoted 15 lines

---

drivers/pci/quirks.c +1 -1
index 214ed060ca1b..1bd6e70058b5 100644
@@ -5312,7 +5312,7 @@ static void 
 pci_quirk_enable_intel_rp_mpc_acs(struct pci_dev *dev)
         if (!(mpc & INTEL_MPC_REG_IRBNCE)) {
                 pci_info(dev, "Enabling MPC IRBNCE\n");
                 mpc |= INTEL_MPC_REG_IRBNCE;
-               pci_write_config_word(dev, INTEL_MPC_REG, mpc);
+               pci_write_config_dword(dev, INTEL_MPC_REG, mpc);
         }
  }