Re: [PATCH 05/16] PCI: PCIe portdrv: Add interface for getting CXL isolation IRQ

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 30, 2025 at 04:47:07PM -0500, Ben Cheatham wrote:
> Add a function to the CXL isolation service driver that allows the CXL
> core to get the necessary information for setting up an interrupt
> handler.
[...]
>  static int cxl_isolation_probe(struct pcie_device *dev)
>  {
> -	if (!pcie_is_cxl(dev->port) || pcie_cxliso_get_intr_vec(dev->port, NULL))
> +	struct cxl_isolation_info *info;
> +	if (!pcie_is_cxl(dev->port) ||
> +	    pcie_cxliso_get_intr_vec(dev->port, NULL))
>  		return -ENXIO;

The re-wrapping of the if-condition shouldn't be here, it should be
wrapped the way you want it in the patch *introducing* the if-condition.

> +	info = devm_kzalloc(&dev->device, sizeof(*info), GFP_KERNEL);
> +	if (!info)
> +		return -ENOMEM;
> +
> +	*info = (struct cxl_isolation_info) {
> +		.dev = &dev->device,
> +		.irq = dev->irq,
> +	};
> +
> +	set_service_data(dev, info);

No, the irq is already saved in struct pcie_device, there's no need
to duplicate that.

> +struct cxl_isolation_info *
> +pcie_cxl_dport_get_isolation_info(struct pci_dev *dport_dev)
> +{
> +	struct device *dev;
>  
> +	dev = pcie_port_find_device(dport_dev, PCIE_PORT_SERVICE_CXLISO);
> +	if (!dev)
> +		return NULL;
> +
> +	return get_service_data(to_pcie_device(dev));
>  }

Just retrieve the irq from to_pcie_device(dev) and either return it
directly or through a call-by-reference parameter.

Thanks,

Lukas




[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux