Re: [PATCH v13 12/15] PCI/CXL: Reject reset with unsafe function scope
From: Cheatham, Benjamin
Date: Wed Sep 23 2026 - 17:41:33 EST
On 9/22/2026 3:39 AM, Srirangan Madhavan wrote:
> The per-device PCI reset interface must not reset sibling functions.
> Reject cxl_reset and cxl_bus for multifunction devices and PFs with
> enabled VFs.
>
> Reported-by: Alex Williamson <alwilliamson@xxxxxxxxxx>
I'm not sure Reported-by is the right tag, I would expect a Suggested-by instead. I think Reported-by
is really more for bug fixes, but I could be wrong.
Thanks,
Ben
> Link: https://lore.kernel.org/linux-cxl/20260626160846.426e71b6@xxxxxxxxxx/
> Link: https://lore.kernel.org/linux-cxl/6a50441e2bb5e_3cabcb1003e@djbw-dev.notmuch/
> Signed-off-by: Srirangan Madhavan <smadhavan@xxxxxxxxxx>
> ---
> drivers/cxl/core/resource.c | 3 +++
> drivers/pci/pci.c | 3 +++
> 2 files changed, 6 insertions(+)
>
> diff --git a/drivers/cxl/core/resource.c b/drivers/cxl/core/resource.c
> index 85a554b6236c..249b1280f3d3 100644
> --- a/drivers/cxl/core/resource.c
> +++ b/drivers/cxl/core/resource.c
> @@ -859,6 +859,9 @@ int cxl_reset_function(struct pci_dev *pdev, bool probe)
> !(ctrl & PCI_DVSEC_CXL_MEM_ENABLE))
> return -ENOTTY;
>
> + if (pdev->multifunction || pci_num_vf(pdev))
> + return -ENOTTY;
> +
> if (probe)
> return 0;
>
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index b2879a6be5f8..fe611340f5ab 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -5026,6 +5026,9 @@ static int cxl_reset_bus_function(struct pci_dev *dev, bool probe)
> if (!dvsec)
> return -ENOTTY;
>
> + if (dev->multifunction || pci_num_vf(dev))
> + return -ENOTTY;
> +
> if (probe)
> return 0;
>