Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Revert "cxl: Add cxl_slot_is_supported API"

Remove abandonned capi support for the Mellanox CX4.

This reverts commit 4e56f858bdde5cbfb70f61baddfaa56a8ed851bf.

Signed-off-by: Frederic Barrat <fbarrat@linux.ibm.com>
Acked-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Frederic Barrat and committed by
Michael Ellerman
322dc4af 8bf6b91a

-52
-37
drivers/misc/cxl/pci.c
··· 1808 1808 return (depth > CXL_MAX_PCIEX_PARENT); 1809 1809 } 1810 1810 1811 - bool cxl_slot_is_supported(struct pci_dev *dev, int flags) 1812 - { 1813 - if (!cpu_has_feature(CPU_FTR_HVMODE)) 1814 - return false; 1815 - 1816 - if ((flags & CXL_SLOT_FLAG_DMA) && (!pvr_version_is(PVR_POWER8NVL))) { 1817 - /* 1818 - * CAPP DMA mode is technically supported on regular P8, but 1819 - * will EEH if the card attempts to access memory < 4GB, which 1820 - * we cannot realistically avoid. We might be able to work 1821 - * around the issue, but until then return unsupported: 1822 - */ 1823 - return false; 1824 - } 1825 - 1826 - if (cxl_slot_is_switched(dev)) 1827 - return false; 1828 - 1829 - /* 1830 - * XXX: This gets a little tricky on regular P8 (not POWER8NVL) since 1831 - * the CAPP can be connected to PHB 0, 1 or 2 on a first come first 1832 - * served basis, which is racy to check from here. If we need to 1833 - * support this in future we might need to consider having this 1834 - * function effectively reserve it ahead of time. 1835 - * 1836 - * Currently, the only user of this API is the Mellanox CX4, which is 1837 - * only supported on P8NVL due to the above mentioned limitation of 1838 - * CAPP DMA mode and therefore does not need to worry about this. If the 1839 - * issue with CAPP DMA mode is later worked around on P8 we might need 1840 - * to revisit this. 1841 - */ 1842 - 1843 - return true; 1844 - } 1845 - EXPORT_SYMBOL_GPL(cxl_slot_is_supported); 1846 - 1847 - 1848 1811 static int cxl_probe(struct pci_dev *dev, const struct pci_device_id *id) 1849 1812 { 1850 1813 struct cxl *adapter;
-15
include/misc/cxl.h
··· 24 24 * generic PCI API. This API is agnostic to the actual AFU. 25 25 */ 26 26 27 - #define CXL_SLOT_FLAG_DMA 0x1 28 - 29 - /* 30 - * Checks if the given card is in a cxl capable slot. Pass CXL_SLOT_FLAG_DMA if 31 - * the card requires CAPP DMA mode to also check if the system supports it. 32 - * This is intended to be used by bi-modal devices to determine if they can use 33 - * cxl mode or if they should continue running in PCI mode. 34 - * 35 - * Note that this only checks if the slot is cxl capable - it does not 36 - * currently check if the CAPP is currently available for chips where it can be 37 - * assigned to different PHBs on a first come first serve basis (i.e. P8) 38 - */ 39 - bool cxl_slot_is_supported(struct pci_dev *dev, int flags); 40 - 41 - 42 27 /* Get the AFU associated with a pci_dev */ 43 28 struct cxl_afu *cxl_pci_to_afu(struct pci_dev *dev); 44 29