mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 10:29:37 +00:00
powerpc/pseries: Fix PCIE link speed endian issue
We need to byteswap ibm,pcie-link-speed-stats. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:
parent
9fa2984d1b
commit
5091f0c969
1 changed files with 4 additions and 4 deletions
|
@ -113,7 +113,7 @@ int pseries_root_bridge_prepare(struct pci_host_bridge *bridge)
|
||||||
{
|
{
|
||||||
struct device_node *dn, *pdn;
|
struct device_node *dn, *pdn;
|
||||||
struct pci_bus *bus;
|
struct pci_bus *bus;
|
||||||
const uint32_t *pcie_link_speed_stats;
|
const __be32 *pcie_link_speed_stats;
|
||||||
|
|
||||||
bus = bridge->bus;
|
bus = bridge->bus;
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ int pseries_root_bridge_prepare(struct pci_host_bridge *bridge)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
for (pdn = dn; pdn != NULL; pdn = of_get_next_parent(pdn)) {
|
for (pdn = dn; pdn != NULL; pdn = of_get_next_parent(pdn)) {
|
||||||
pcie_link_speed_stats = (const uint32_t *) of_get_property(pdn,
|
pcie_link_speed_stats = of_get_property(pdn,
|
||||||
"ibm,pcie-link-speed-stats", NULL);
|
"ibm,pcie-link-speed-stats", NULL);
|
||||||
if (pcie_link_speed_stats)
|
if (pcie_link_speed_stats)
|
||||||
break;
|
break;
|
||||||
|
@ -135,7 +135,7 @@ int pseries_root_bridge_prepare(struct pci_host_bridge *bridge)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (pcie_link_speed_stats[0]) {
|
switch (be32_to_cpup(pcie_link_speed_stats)) {
|
||||||
case 0x01:
|
case 0x01:
|
||||||
bus->max_bus_speed = PCIE_SPEED_2_5GT;
|
bus->max_bus_speed = PCIE_SPEED_2_5GT;
|
||||||
break;
|
break;
|
||||||
|
@ -147,7 +147,7 @@ int pseries_root_bridge_prepare(struct pci_host_bridge *bridge)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (pcie_link_speed_stats[1]) {
|
switch (be32_to_cpup(pcie_link_speed_stats)) {
|
||||||
case 0x01:
|
case 0x01:
|
||||||
bus->cur_bus_speed = PCIE_SPEED_2_5GT;
|
bus->cur_bus_speed = PCIE_SPEED_2_5GT;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue