Skip to content

Commit f3c8a37

Browse files
committed
cxl/pci: Unconditionally unmask 256B Flit errors
The current check for 256B Flit mode is incomplete and unnecessary. It is incomplete because it fails to consider the link speed, or check for CXL link capabilities. It is unnecessary because unconditionally unmasking 256B Flit errors is a nop when 256B Flit operation is not available. Remove this check in preparation for creating a cxl_probe_link() helper to centralize this detection. Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/168679263124.3436160.6228910132469454346.stgit@dwillia2-xfh.jf.intel.com Signed-off-by: Dan Williams <dan.j.williams@intel.com>
1 parent 8c897b3 commit f3c8a37

1 file changed

Lines changed: 2 additions & 16 deletions

File tree

drivers/cxl/pci.c

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -368,19 +368,6 @@ static bool is_cxl_restricted(struct pci_dev *pdev)
368368
return pci_pcie_type(pdev) == PCI_EXP_TYPE_RC_END;
369369
}
370370

371-
/*
372-
* CXL v3.0 6.2.3 Table 6-4
373-
* The table indicates that if PCIe Flit Mode is set, then CXL is in 256B flits
374-
* mode, otherwise it's 68B flits mode.
375-
*/
376-
static bool cxl_pci_flit_256(struct pci_dev *pdev)
377-
{
378-
u16 lnksta2;
379-
380-
pcie_capability_read_word(pdev, PCI_EXP_LNKSTA2, &lnksta2);
381-
return lnksta2 & PCI_EXP_LNKSTA2_FLIT;
382-
}
383-
384371
static int cxl_pci_ras_unmask(struct pci_dev *pdev)
385372
{
386373
struct pci_host_bridge *host_bridge = pci_find_host_bridge(pdev->bus);
@@ -407,9 +394,8 @@ static int cxl_pci_ras_unmask(struct pci_dev *pdev)
407394
addr = cxlds->regs.ras + CXL_RAS_UNCORRECTABLE_MASK_OFFSET;
408395
orig_val = readl(addr);
409396

410-
mask = CXL_RAS_UNCORRECTABLE_MASK_MASK;
411-
if (!cxl_pci_flit_256(pdev))
412-
mask &= ~CXL_RAS_UNCORRECTABLE_MASK_F256B_MASK;
397+
mask = CXL_RAS_UNCORRECTABLE_MASK_MASK |
398+
CXL_RAS_UNCORRECTABLE_MASK_F256B_MASK;
413399
val = orig_val & ~mask;
414400
writel(val, addr);
415401
dev_dbg(&pdev->dev,

0 commit comments

Comments
 (0)