Skip to content

Commit 2dba285

Browse files
rwk-gitbjorn-helgaas
authored andcommitted
PCI: rockchip-ep: Remove wrong mask on subsys_vendor_id
Remove wrong mask on subsys_vendor_id. Both the Vendor ID and Subsystem Vendor ID are u16 variables and are written to a u32 register of the controller. The Subsystem Vendor ID was always 0 because the u16 value was masked incorrectly with GENMASK(31,16) resulting in all lower 16 bits being set to 0 prior to the shift. Remove both masks as they are unnecessary and set the register correctly i.e., the lower 16-bits are the Vendor ID and the upper 16-bits are the Subsystem Vendor ID. This is documented in the RK3399 TRM section 17.6.7.1.17 [kwilczynski: removed unnecesary newline] Fixes: cf590b0 ("PCI: rockchip: Add EP driver for Rockchip PCIe controller") Link: https://lore.kernel.org/linux-pci/[email protected] Signed-off-by: Rick Wertenbroek <[email protected]> Signed-off-by: Krzysztof Wilczyński <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Damien Le Moal <[email protected]> Cc: [email protected]
1 parent de66b37 commit 2dba285

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/pci/controller/pcie-rockchip-ep.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,8 @@ static int rockchip_pcie_ep_write_header(struct pci_epc *epc, u8 fn, u8 vfn,
9898

9999
/* All functions share the same vendor ID with function 0 */
100100
if (fn == 0) {
101-
u32 vid_regs = (hdr->vendorid & GENMASK(15, 0)) |
102-
(hdr->subsys_vendor_id & GENMASK(31, 16)) << 16;
103-
104-
rockchip_pcie_write(rockchip, vid_regs,
101+
rockchip_pcie_write(rockchip,
102+
hdr->vendorid | hdr->subsys_vendor_id << 16,
105103
PCIE_CORE_CONFIG_VENDOR);
106104
}
107105

0 commit comments

Comments
 (0)