All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCI: Fix 32-bit config write in Intel RP MPC ACS quirk
@ 2026-07-23  6:43 Mohamad Raizudeen
  2026-07-23  6:46 ` sashiko-bot
  2026-07-23 16:06 ` Bjorn Helgaas
  0 siblings, 2 replies; 3+ messages in thread
From: Mohamad Raizudeen @ 2026-07-23  6:43 UTC (permalink / raw)
  To: bhelgaas; +Cc: skhan, jkoolstra, linux-pci, linux-kernel, Mohamad Raizudeen

The pci_quirk_enable_intel_rp_mpc_acs() reads a 32 bit DWORD from the
MPC register, sets bit 26 (INTEL_MPC_REG_IRBNCE), but it writes it back
using pci_write_config_word().

Because bit 26 resides in the upper 16 bits of the 32 bit register, a 16
bit write to offset 0xd8 completely drops the newly set bit. The quirk
logs that it is enabling IRBNCE, but the hardware never actually
receives the command.

Fix this by using pci_write_config_dword() to ensure the full 32 bit
value is written back to the hardware.

Signed-off-by: Mohamad Raizudeen <raizudeen.kerneldev@gmail.com>
---
 drivers/pci/quirks.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index b09f27f7846f..0d0cf6f86173 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -5361,7 +5361,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);
 	}
 }
 
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] PCI: Fix 32-bit config write in Intel RP MPC ACS quirk
  2026-07-23  6:43 [PATCH] PCI: Fix 32-bit config write in Intel RP MPC ACS quirk Mohamad Raizudeen
@ 2026-07-23  6:46 ` sashiko-bot
  2026-07-23 16:06 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-07-23  6:46 UTC (permalink / raw)
  To: Mohamad Raizudeen; +Cc: linux-pci

> The pci_quirk_enable_intel_rp_mpc_acs() reads a 32 bit DWORD from the
> MPC register, sets bit 26 (INTEL_MPC_REG_IRBNCE), but it writes it back
> using pci_write_config_word().
> 
> Because bit 26 resides in the upper 16 bits of the 32 bit register, a 16
> bit write to offset 0xd8 completely drops the newly set bit. The quirk
> logs that it is enabling IRBNCE, but the hardware never actually
> receives the command.
> 
> Fix this by using pci_write_config_dword() to ensure the full 32 bit
> value is written back to the hardware.
> 
> Signed-off-by: Mohamad Raizudeen <raizudeen.kerneldev@gmail.com>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260723064300.8081-1-raizudeen.kerneldev@gmail.com?part=1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] PCI: Fix 32-bit config write in Intel RP MPC ACS quirk
  2026-07-23  6:43 [PATCH] PCI: Fix 32-bit config write in Intel RP MPC ACS quirk Mohamad Raizudeen
  2026-07-23  6:46 ` sashiko-bot
@ 2026-07-23 16:06 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2026-07-23 16:06 UTC (permalink / raw)
  To: Mohamad Raizudeen
  Cc: bhelgaas, skhan, jkoolstra, linux-pci, linux-kernel,
	Alex Williamson

[+cc Alex, author of d99321b63b1f]

On Thu, Jul 23, 2026 at 12:13:00PM +0530, Mohamad Raizudeen wrote:
> The pci_quirk_enable_intel_rp_mpc_acs() reads a 32 bit DWORD from the
> MPC register, sets bit 26 (INTEL_MPC_REG_IRBNCE), but it writes it back
> using pci_write_config_word().
> 
> Because bit 26 resides in the upper 16 bits of the 32 bit register, a 16
> bit write to offset 0xd8 completely drops the newly set bit. The quirk
> logs that it is enabling IRBNCE, but the hardware never actually
> receives the command.
> 
> Fix this by using pci_write_config_dword() to ensure the full 32 bit
> value is written back to the hardware.

Needs a Fixes: tag, probably for d99321b63b1f ("PCI: Enable quirks for PCIe
ACS on Intel PCH root ports")

That's 12 years old, surprising this hasn't been noticed before :)
Google does find several mentions of "Enabling MPC IRBNCE", so maybe there
have been issues but not debugged.

> Signed-off-by: Mohamad Raizudeen <raizudeen.kerneldev@gmail.com>
> ---
>  drivers/pci/quirks.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index b09f27f7846f..0d0cf6f86173 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -5361,7 +5361,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);
>  	}
>  }
>  
> -- 
> 2.53.0
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-07-23 16:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-23  6:43 [PATCH] PCI: Fix 32-bit config write in Intel RP MPC ACS quirk Mohamad Raizudeen
2026-07-23  6:46 ` sashiko-bot
2026-07-23 16:06 ` Bjorn Helgaas

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.