Skip to content

Commit 8b2f927

Browse files
nirmoynvidia-bfigg
authored andcommitted
Revert "NVIDIA: VR: SAUCE: PCI: Allow ATS to be always on for CXL.cache capable devices"
BugLink: https://bugs.launchpad.net/bugs/2150727 This reverts commit 967f9fe. Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com> Acked-by: Jamie Nguyen <jamien@nvidia.com> Acked-by: Carol L Soto <csoto@nvidia.com> Acked-by: Matthew R. Ochs <mochs@nvidia.com> Signed-off-by: Brad Figg <bfigg@nvidia.com>
1 parent fc426f5 commit 8b2f927

3 files changed

Lines changed: 0 additions & 52 deletions

File tree

drivers/pci/ats.c

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -205,50 +205,6 @@ int pci_ats_page_aligned(struct pci_dev *pdev)
205205
return 0;
206206
}
207207

208-
/*
209-
* CXL r4.0, sec 3.2.5.13 Memory Type on CXL.cache notes: to source requests on
210-
* CXL.cache, devices need to get the Host Physical Address (HPA) from the Host
211-
* by means of an ATS request on CXL.io.
212-
*
213-
* In other world, CXL.cache devices cannot access physical memory without ATS.
214-
*/
215-
static bool pci_cxl_ats_always_on(struct pci_dev *pdev)
216-
{
217-
int offset;
218-
u16 cap;
219-
220-
offset = pci_find_dvsec_capability(pdev, PCI_VENDOR_ID_CXL,
221-
CXL_DVSEC_PCIE_DEVICE);
222-
if (!offset)
223-
return false;
224-
225-
pci_read_config_word(pdev, offset + CXL_DVSEC_CAP_OFFSET, &cap);
226-
if (cap & CXL_DVSEC_CACHE_CAPABLE)
227-
return true;
228-
229-
return false;
230-
}
231-
232-
/**
233-
* pci_ats_always_on - Whether the PCI device requires ATS to be always enabled
234-
* @pdev: the PCI device
235-
*
236-
* Returns true, if the PCI device requires non-PASID ATS function on an IOMMU
237-
* bypassed configuration.
238-
*/
239-
bool pci_ats_always_on(struct pci_dev *pdev)
240-
{
241-
if (pci_ats_disabled() || !pci_ats_supported(pdev))
242-
return false;
243-
244-
/* A VF inherits its PF's requirement for ATS function */
245-
if (pdev->is_virtfn)
246-
pdev = pci_physfn(pdev);
247-
248-
return pci_cxl_ats_always_on(pdev);
249-
}
250-
EXPORT_SYMBOL_GPL(pci_ats_always_on);
251-
252208
#ifdef CONFIG_PCI_PRI
253209
void pci_pri_init(struct pci_dev *pdev)
254210
{

include/linux/pci-ats.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ int pci_prepare_ats(struct pci_dev *dev, int ps);
1212
void pci_disable_ats(struct pci_dev *dev);
1313
int pci_ats_queue_depth(struct pci_dev *dev);
1414
int pci_ats_page_aligned(struct pci_dev *dev);
15-
bool pci_ats_always_on(struct pci_dev *dev);
1615
#else /* CONFIG_PCI_ATS */
1716
static inline bool pci_ats_supported(struct pci_dev *d)
1817
{ return false; }
@@ -25,8 +24,6 @@ static inline int pci_ats_queue_depth(struct pci_dev *d)
2524
{ return -ENODEV; }
2625
static inline int pci_ats_page_aligned(struct pci_dev *dev)
2726
{ return 0; }
28-
static inline bool pci_ats_always_on(struct pci_dev *dev)
29-
{ return false; }
3027
#endif /* CONFIG_PCI_ATS */
3128

3229
#ifdef CONFIG_PCI_PRI

include/uapi/linux/pci_regs.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,9 +1412,4 @@
14121412
#define PCI_DVSEC_CXL_REG_LOCATOR_BLOCK_ID __GENMASK(15, 8)
14131413
#define PCI_DVSEC_CXL_REG_LOCATOR_BLOCK_OFF_LOW __GENMASK(31, 16)
14141414

1415-
/* CXL 2.0 8.1.3: PCIe DVSEC for CXL Device */
1416-
#define CXL_DVSEC_PCIE_DEVICE 0
1417-
#define CXL_DVSEC_CAP_OFFSET 0xA
1418-
#define CXL_DVSEC_CACHE_CAPABLE BIT(0)
1419-
14201415
#endif /* LINUX_PCI_REGS_H */

0 commit comments

Comments
 (0)