Re: [PATCH] PCI: Cancel compilation restrictions on function pcie_clear_device_status

From: Songyang Li
Date: Fri Jun 14 2024 - 23:13:23 EST


On Wed, 12 Jun 2024 15:14:32 -0500, Bjorn Helgaas wrote:
> I think all current any callers of pcie_clear_device_status() are also
> under CONFIG_PCIEAER, so I don't think this fixes a current problem.
>
> As you point out, it might make sense to use
> pcie_clear_device_status() even without AER, but I think we should
> include this change at the time when we add such a use.
>
> If I'm missing a use with the current kernel, let me know.


As far as I know, some PCIe device drivers, for example,
[net/ethernet/broadcom/tg3.c],[net/ethernet/atheros/atl1c/atl1c_main.c],
which use the following code to clear the device status register,
pcie_capability_write_word(tp->pdev, PCI_EXP_DEVSTA,
PCI_EXP_DEVSTA_CED |
PCI_EXP_DEVSTA_NFED |
PCI_EXP_DEVSTA_FED |
PCI_EXP_DEVSTA_URD);
I think it may be more suitable to export the pcie_clear_device_status()
for use in the driver code.
Thanks,

Songyang Li