linux-stable/drivers/cxl
Ira Weiny d72a4caf68 cxl/pci: Skip irq features if MSI/MSI-X are not supported
CXL 3.1 Section 3.1.1 states:

	"A Function on a CXL device must not generate INTx messages if
	that Function participates in CXL.cache protocol or CXL.mem
	protocols."

The generic CXL memory driver only supports devices which use the
CXL.mem protocol.  The current driver attempts to allocate MSI/MSI-X
vectors in anticipation of their need for mailbox interrupts or event
processing.  However, the above requirement does not require a device to
support interrupts, only that they use MSI/MSI-X.  For example, a device
may disable mailbox interrupts and either be configured for firmware
first or skip event processing and function.

Dave Larsen reported that the following Intel / Agilex card does not
support interrupts on function 0.

	CXL: Intel Corporation Device 0ddb (rev 01) (prog-if 10 [CXL Memory Device (CXL 2.x)])

Rather than fail device probe if interrupts are not supported; flag that
irqs are not enabled and avoid features which require interrupts.
Emit messages appropriate for the situation to aid in debugging should
device behavior be unexpected due to a failure to allocate vectors.

Note that it is possible for a device to have host based event
processing through polling.  However, the driver does not support
polling and it is not anticipated to be generally required.  Leave that
functionality to a future patch if such a device comes along.

Reported-by: Dave Larsen <davelarsen58@gmail.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Fan Ni <fan.ni@samsung.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-and-tested-by: Davidlohr Bueso <dave@stgolabs.net>
Link: https://lore.kernel.org/r/20240117-dont-fail-irq-v2-1-f33f26b0e365@intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2024-01-22 10:42:00 -08:00
..
core cxl/core: use sysfs_emit() for attr's _show() 2024-01-12 14:47:04 -08:00
acpi.c cxl: Convert find_cxl_root() to return a 'struct cxl_root *' 2024-01-05 14:36:29 -08:00
cxl.h Merge branch 'for-6.7/cxl' into for-6.8/cxl 2024-01-05 19:24:33 -08:00
cxlmem.h Merge branch 'for-6.8/cxl-cper' into for-6.8/cxl 2024-01-09 19:21:44 -08:00
cxlpci.h cxl: Calculate and store PCI link latency for the downstream ports 2023-12-22 14:53:49 -08:00
Kconfig cxl: Add callback to parse the DSMAS subtables from CDAT 2023-12-22 14:33:10 -08:00
Makefile cxl/pmem: Introduce nvdimm_security_ops with ->get_flags() operation 2022-11-30 16:30:47 -08:00
mem.c cxl: Export sysfs attributes for memory device QoS class 2023-12-22 15:46:02 -08:00
pci.c cxl/pci: Skip irq features if MSI/MSI-X are not supported 2024-01-22 10:42:00 -08:00
pmem.c cxl/mbox: Move mailbox related driver state to its own data structure 2023-06-25 14:31:08 -07:00
pmu.h cxl/pci: Find and register CXL PMU devices 2023-05-30 11:20:35 -07:00
port.c cxl: Refactor to use __free() for cxl_root allocation in cxl_endpoint_port_probe() 2024-01-05 14:36:29 -08:00
security.c Merge branch 'for-6.5/cxl-type-2' into for-6.5/cxl 2023-06-25 17:16:51 -07:00