mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
cxl: use correct operator when writing pcie config space values
When writing a value to config space, cxl_pcie_write_config() calls
cxl_pcie_config_info() to obtain a mask and shift value, shifts the new
value accordingly, then uses the mask to combine the shifted value with the
existing value at the address as part of a read-modify-write pattern.
Currently, we use a logical OR operator rather than a bitwise OR operator,
which means any use of this function results in an incorrect value being
written. Replace the logical OR operator with a bitwise OR operator so the
value is written correctly.
Reported-by: Michael Ellerman <[email protected]>
Cc: [email protected]
Fixes: 6f7f0b3df6 ("cxl: Add AFU virtual PHB and kernel API")
Signed-off-by: Andrew Donnellan <[email protected]>
Acked-by: Ian Munsie <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
This commit is contained in:
parent
1b5df59e50
commit
48f0f6b717
1 changed files with 1 additions and 1 deletions
|
|
@ -203,7 +203,7 @@ static int cxl_pcie_write_config(struct pci_bus *bus, unsigned int devfn,
|
|||
mask <<= shift;
|
||||
val <<= shift;
|
||||
|
||||
v = (in_le32(ioaddr) & ~mask) || (val & mask);
|
||||
v = (in_le32(ioaddr) & ~mask) | (val & mask);
|
||||
|
||||
out_le32(ioaddr, v);
|
||||
return PCIBIOS_SUCCESSFUL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue