Commit a53c4dc
PCI: apple: Initialize pcie->nvecs before using it
apple_pcie_setup_port computes ilog2(pcie->nvecs) to setup the number of
MSIs available for each port. It is however called before apple_msi_init
which actually initializes pcie->nvecs.
Luckily, pcie->nvecs is part of kzalloc-ed structure and thus
initialized as zero. ilog2(0) happens to be 0xffffffff which then just
configures more MSIs in hardware than we actually have. This doesn't
break anything because we never hand out those vectors.
Let's swap the order of the two calls so that we use the correctly
initialized value.
Fixes: 476c41e ("PCI: apple: Implement MSI support")
Signed-off-by: Sven Peter <[email protected]>
Reviewed-by: Marc Zyngier <[email protected]>
Reviewed-by: Eric Curtin <[email protected]>
Reviewed-by: Alyssa Rosenzweig <[email protected]>1 parent 15f4442 commit a53c4dc
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
828 | 828 | | |
829 | 829 | | |
830 | 830 | | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
831 | 835 | | |
832 | 836 | | |
833 | 837 | | |
| |||
837 | 841 | | |
838 | 842 | | |
839 | 843 | | |
840 | | - | |
| 844 | + | |
841 | 845 | | |
842 | 846 | | |
843 | 847 | | |
| |||
0 commit comments