Skip to content

Commit

Permalink
PCI: pci-bridge-emul: Make expansion ROM Base Address register read-only
Browse files Browse the repository at this point in the history
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/20211124155944.1290-2-pali@kernel.org
Fixes: 23a5fba ("PCI: Introduce PCI bridge emulated config space common logic")
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: stable@vger.kernel.org
  • Loading branch information
Pali Rohár authored and Lorenzo Pieralisi committed Dec 6, 2021
1 parent fa55b7d commit 1c1a3b4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/pci/pci-bridge-emul.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,13 @@ struct pci_bridge_reg_behavior pci_regs_behavior[PCI_STD_HEADER_SIZEOF / 4] = {
.ro = GENMASK(7, 0),
},

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

/*
Expand Down

0 comments on commit 1c1a3b4

Please sign in to comment.