提交 60c8da76 编写于 作者: H Hongchen Zhang

pci: fix kabi error caused by pm_suspend_target_state

LoongArch inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I6BWFP

--------------------------------

fix kabi error caused by pm_suspend_target_state,used only
by loongson devices.
Signed-off-by: NHongchen Zhang <zhanghongchen@loongson.cn>
上级 269d4b06
...@@ -31,7 +31,9 @@ ...@@ -31,7 +31,9 @@
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <asm/dma.h> #include <asm/dma.h>
#include <linux/aer.h> #include <linux/aer.h>
#ifdef CONFIG_MACH_LOONGSON64
#include <linux/suspend.h> #include <linux/suspend.h>
#endif
#include "pci.h" #include "pci.h"
DEFINE_MUTEX(pci_slot_mutex); DEFINE_MUTEX(pci_slot_mutex);
...@@ -148,11 +150,15 @@ static bool pci_bridge_d3_disable; ...@@ -148,11 +150,15 @@ static bool pci_bridge_d3_disable;
/* Force bridge_d3 for all PCIe ports */ /* Force bridge_d3 for all PCIe ports */
static bool pci_bridge_d3_force; static bool pci_bridge_d3_force;
#ifdef CONFIG_MACH_LOONGSON64
#ifndef CONFIG_PM_SLEEP #ifndef CONFIG_PM_SLEEP
suspend_state_t pm_suspend_target_state; suspend_state_t pm_suspend_target_state;
#define pm_suspend_target_state (PM_SUSPEND_ON) #define pm_suspend_target_state (PM_SUSPEND_ON)
#endif #endif
#endif
static int __init pcie_port_pm_setup(char *str) static int __init pcie_port_pm_setup(char *str)
{ {
if (!strcmp(str, "off")) if (!strcmp(str, "off"))
...@@ -5756,8 +5762,9 @@ int pcie_set_readrq(struct pci_dev *dev, int rq) ...@@ -5756,8 +5762,9 @@ int pcie_set_readrq(struct pci_dev *dev, int rq)
{ {
u16 v; u16 v;
int ret; int ret;
#ifdef CONFIG_MACH_LOONGSON64
struct pci_host_bridge *bridge = pci_find_host_bridge(dev->bus); struct pci_host_bridge *bridge = pci_find_host_bridge(dev->bus);
#endif
if (rq < 128 || rq > 4096 || !is_power_of_2(rq)) if (rq < 128 || rq > 4096 || !is_power_of_2(rq))
return -EINVAL; return -EINVAL;
...@@ -5774,12 +5781,13 @@ int pcie_set_readrq(struct pci_dev *dev, int rq) ...@@ -5774,12 +5781,13 @@ int pcie_set_readrq(struct pci_dev *dev, int rq)
} }
v = (ffs(rq) - 8) << 12; v = (ffs(rq) - 8) << 12;
#ifdef CONFIG_MACH_LOONGSON64
if (pm_suspend_target_state == PM_SUSPEND_ON && if (pm_suspend_target_state == PM_SUSPEND_ON &&
bridge->no_inc_mrrs) { bridge->no_inc_mrrs) {
if (rq > pcie_get_readrq(dev)) if (rq > pcie_get_readrq(dev))
return -EINVAL; return -EINVAL;
} }
#endif
ret = pcie_capability_clear_and_set_word(dev, PCI_EXP_DEVCTL, ret = pcie_capability_clear_and_set_word(dev, PCI_EXP_DEVCTL,
PCI_EXP_DEVCTL_READRQ, v); PCI_EXP_DEVCTL_READRQ, v);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册