Re: [PATCH v15 10/16] PCI/CXL: Add CXL Device Reset sequencing

From: Srirangan Madhavan

Date: Thu Oct 29 2026 - 21:23:46 EST


On 10/27/26 8:01 PM, Li Ming wrote:
+
+     rc = pci_read_config_word(pdev, dvsec + PCI_DVSEC_CXL_CTRL2, &ctrl2);
+     if (rc)
+             return pcibios_err_to_errno(rc);
+     if (PCI_POSSIBLE_ERROR(ctrl2))
+             return -ENODEV;

I think this PCI_POSSIBLE_ERROR() checking is not needed, in
pci_bus_read_config_word() marco, if bus->ops->read() returns a error,
then the function will use PCI_SET_ERROR_RESPONSE() then returning the
errno. That means that we can always get an error as return value of
pci_read_config_word() while ctrl2 is an error response.

I kept the PCI_POSSIBLE_ERROR() checks in v16 because I believe configuration read can return success with an all-ones value. For example, pci_generic_config_read() returns success after readw(), even if the value read is 0xffff.
Please let me know if that assumption is incorrect.
--
Regards,
Srirangan