diff options
author | Pali Rohár <pali@kernel.org> | 2021-11-24 16:59:39 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-01-27 10:54:26 +0100 |
commit | 2a0d437d8a76474452cb91d2fc729020c2371ad3 (patch) | |
tree | 34a346be275f86b550804af35572fc9e27c6805c /drivers/pci | |
parent | def2825b09ece8c8b6e2514c8f785073bf3a864e (diff) | |
download | linux-stable-2a0d437d8a76474452cb91d2fc729020c2371ad3.tar.gz linux-stable-2a0d437d8a76474452cb91d2fc729020c2371ad3.tar.bz2 linux-stable-2a0d437d8a76474452cb91d2fc729020c2371ad3.zip |
PCI: pci-bridge-emul: Make expansion ROM Base Address register read-only
commit 1c1a3b4d3e86b997a313ffb297c1129540882859 upstream.
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: 23a5fba4d941 ("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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/pci-bridge-emul.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/pci/pci-bridge-emul.c b/drivers/pci/pci-bridge-emul.c index db97cddfc85e..5de8b8dde209 100644 --- a/drivers/pci/pci-bridge-emul.c +++ b/drivers/pci/pci-bridge-emul.c @@ -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, }, /* |