]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: pci-bridge-emul: Fix emulation of W1C bits
authorMarek Behún <kabel@kernel.org>
Thu, 28 Oct 2021 18:56:53 +0000 (20:56 +0200)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Fri, 29 Oct 2021 09:25:31 +0000 (10:25 +0100)
commitd325d023aa320e622a34c1fce050dac6e7162d88
tree3b9c4d9144556f0574f11cc0c1e9dcfe62c46b06
parent18b14b12eacd3b7f3e4a52c3579ab9de3c5068e9
PCI: pci-bridge-emul: Fix emulation of W1C bits

The pci_bridge_emul_conf_write() function correctly clears W1C bits in
cfgspace cache, but it does not inform the underlying implementation
about the clear request: the .write_op() method is given the value with
these bits cleared.

This is wrong if the .write_op() needs to know which bits were requested
to be cleared.

Fix the value to be passed into the .write_op() method to have requested
W1C bits set, so that it can clear them.

Both pci-bridge-emul users (mvebu and aardvark) are compatible with this
change.

Link: https://lore.kernel.org/r/20211028185659.20329-2-kabel@kernel.org
Fixes: 916a4aee864f ("PCI: Introduce PCI bridge emulated config space common logic")
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Marek Behún <kabel@kernel.org>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: stable@vger.kernel.org
Cc: Russell King <rmk+kernel@armlinux.org.uk>
drivers/pci/pci-bridge-emul.c