Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 283392
b: refs/heads/master
c: 1900ca1
h: refs/heads/master
v: v3
  • Loading branch information
Hao, Xudong authored and Jesse Barnes committed Jan 6, 2012
1 parent c0cafde commit c67a0f7
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 424eb391596a38ddf422bee1617e4b9dea60126f
refs/heads/master: 1900ca132f53c3d51e6e6b94ea8912530223c63a
17 changes: 17 additions & 0 deletions trunk/drivers/pci/ats.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,23 @@ void pci_disable_ats(struct pci_dev *dev)
}
EXPORT_SYMBOL_GPL(pci_disable_ats);

void pci_restore_ats_state(struct pci_dev *dev)
{
u16 ctrl;

if (!pci_ats_enabled(dev))
return;
if (!pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ATS))
BUG();

ctrl = PCI_ATS_CTRL_ENABLE;
if (!dev->is_virtfn)
ctrl |= PCI_ATS_CTRL_STU(dev->ats->stu - PCI_ATS_MIN_STU);

pci_write_config_word(dev, dev->ats->pos + PCI_ATS_CTRL, ctrl);
}
EXPORT_SYMBOL_GPL(pci_restore_ats_state);

/**
* pci_ats_queue_depth - query the ATS Invalidate Queue Depth
* @dev: the PCI device
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -965,6 +965,7 @@ void pci_restore_state(struct pci_dev *dev)

/* PCI Express register must be restored first */
pci_restore_pcie_state(dev);
pci_restore_ats_state(dev);

/*
* The Base Address register should be programmed before the command
Expand Down
8 changes: 8 additions & 0 deletions trunk/drivers/pci/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,14 @@ struct pci_sriov {
u8 __iomem *mstate; /* VF Migration State Array */
};

#ifdef CONFIG_PCI_ATS
extern void pci_restore_ats_state(struct pci_dev *dev);
#else
static inline void pci_restore_ats_state(struct pci_dev *dev)
{
}
#endif /* CONFIG_PCI_ATS */

#ifdef CONFIG_PCI_IOV
extern int pci_iov_init(struct pci_dev *dev);
extern void pci_iov_release(struct pci_dev *dev);
Expand Down

0 comments on commit c67a0f7

Please sign in to comment.