PCI/CXL: Fail bus reset if upstream CXL Port has SBR masked
authorDave Jiang <dave.jiang@intel.com>
Thu, 2 May 2024 16:57:32 +0000 (09:57 -0700)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 8 May 2024 18:25:36 +0000 (13:25 -0500)
commitb1956e2d0713e210a56ae65ad3488ae36f833e76
tree7a1fe4631df85458c10d92d26d16555c84079fca
parent7e89efc6e9e402839643cb297bab14055c547f07
PCI/CXL: Fail bus reset if upstream CXL Port has SBR masked

Per CXL spec r3.1, sec 8.1.5.2, the Secondary Bus Reset (SBR) bit in the
Bridge Control register of a CXL port has no effect unless the "Unmask SBR"
bit is set.

Return -ENOTTY if we attempt a bus reset on a device below a CXL Port where
"Unmask SBR" is 0.  Otherwise, the bus reset would appear to have succeeded
even though setting the bridge SBR bit had no effect.

Link: https://lore.kernel.org/linux-cxl/20240220203956.GA1502351@bhelgaas/
Link: https://lore.kernel.org/r/20240502165851.1948523-4-dave.jiang@intel.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
[bhelgaas: simplify commit log and comments]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
drivers/pci/pci.c
include/uapi/linux/pci_regs.h