Skip to content

Commit 1c1a3b4

Browse files
paliLorenzo Pieralisi
authored andcommitted
PCI: pci-bridge-emul: Make expansion ROM Base Address register read-only
If expansion ROM is unsupported (which is the case of pci-bridge-emul.c driver) then ROM Base Address register must be implemented as read-only register that return 0 when read, same as for unused Base Address registers. Link: https://lore.kernel.org/r/[email protected] Fixes: 23a5fba ("PCI: Introduce PCI bridge emulated config space common logic") Signed-off-by: Pali Rohár <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Cc: [email protected]
1 parent fa55b7d commit 1c1a3b4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/pci/pci-bridge-emul.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,13 @@ struct pci_bridge_reg_behavior pci_regs_behavior[PCI_STD_HEADER_SIZEOF / 4] = {
139139
.ro = GENMASK(7, 0),
140140
},
141141

142+
/*
143+
* If expansion ROM is unsupported then ROM Base Address register must
144+
* be implemented as read-only register that return 0 when read, same
145+
* as for unused Base Address registers.
146+
*/
142147
[PCI_ROM_ADDRESS1 / 4] = {
143-
.rw = GENMASK(31, 11) | BIT(0),
148+
.ro = ~0,
144149
},
145150

146151
/*

0 commit comments

Comments
 (0)