提交 36b45f28 编写于 作者: X Xiongfeng Wang 提交者: Xie XiuQi

pci: do not save 'PCI_BRIDGE_CTL_BUS_RESET'

hulk inclusion
category: bugfix
bugzilla: 20702
CVE: NA
---------------------------

When I inject a PCIE Fatal error into a mellanox netdevice, 'dmesg'
shows the device is recovered successfully, but 'lspci' didn't show the
device. I checked the configuration space of the slot where the
netdevice is inserted and found out the bit 'PCI_BRIDGE_CTL_BUS_RESET'
is set. Later, I found out it is because this bit is saved in
'saved_config_space' of 'struct pci_dev' when 'pci_pm_runtime_suspend()'
is called. And 'PCI_BRIDGE_CTL_BUS_RESET' is set every time we restore
the configuration sapce.

This patch avoid saving the bit 'PCI_BRIDGE_CTL_BUS_RESET' when we save
the configuration space of a bridge.
Signed-off-by: NXiongfeng Wang <wangxiongfeng2@huawei.com>
Reviewed-by: NHanjun Guo <guohanjun@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 58622cdd
...@@ -1274,6 +1274,9 @@ int pci_save_state(struct pci_dev *dev) ...@@ -1274,6 +1274,9 @@ int pci_save_state(struct pci_dev *dev)
/* XXX: 100% dword access ok here? */ /* XXX: 100% dword access ok here? */
for (i = 0; i < 16; i++) for (i = 0; i < 16; i++)
pci_read_config_dword(dev, i * 4, &dev->saved_config_space[i]); pci_read_config_dword(dev, i * 4, &dev->saved_config_space[i]);
if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE)
dev->saved_config_space[PCI_BRIDGE_CONTROL / 4] &=
~(PCI_BRIDGE_CTL_BUS_RESET << 16);
dev->state_saved = true; dev->state_saved = true;
i = pci_save_pcie_state(dev); i = pci_save_pcie_state(dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册