[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240913191009.00001eec@Huawei.com>
Date: Fri, 13 Sep 2024 19:10:09 +0100
From: Jonathan Cameron <Jonathan.Cameron@...wei.com>
To: <alejandro.lucero-palau@....com>
CC: <linux-cxl@...r.kernel.org>, <netdev@...r.kernel.org>,
<dan.j.williams@...el.com>, <martin.habets@...inx.com>,
<edward.cree@....com>, <davem@...emloft.net>, <kuba@...nel.org>,
<pabeni@...hat.com>, <edumazet@...gle.com>, Alejandro Lucero
<alucerop@....com>
Subject: Re: [PATCH v3 20/20] efx: support pio mapping based on cxl
On Sat, 7 Sep 2024 09:18:36 +0100
alejandro.lucero-palau@....com wrote:
> From: Alejandro Lucero <alucerop@....com>
>
> With a device supporting CXL and successfully initialised, use the cxl
> region to map the memory range and use this mapping for PIO buffers.
>
> Signed-off-by: Alejandro Lucero <alucerop@....com>
One trivial thing.
> diff --git a/drivers/net/ethernet/sfc/efx_cxl.c b/drivers/net/ethernet/sfc/efx_cxl.c
> index dd2dbfb8ba15..ef57f833b8a7 100644
> --- a/drivers/net/ethernet/sfc/efx_cxl.c
> +++ b/drivers/net/ethernet/sfc/efx_cxl.c
> @@ -21,9 +21,9 @@
> int efx_cxl_init(struct efx_nic *efx)
> {
> struct pci_dev *pci_dev = efx->pci_dev;
> + resource_size_t start, end, max = 0;
> struct efx_cxl *cxl;
> struct resource res;
> - resource_size_t max;
> u16 dvsec;
> int rc;
>
> @@ -132,10 +132,27 @@ int efx_cxl_init(struct efx_nic *efx)
> goto err_region;
> }
>
> + rc = cxl_get_region_params(cxl->efx_region, &start, &end);
> + if (rc) {
> + pci_err(pci_dev, "CXL getting regions params failed");
> + goto err_map;
> + }
> +
> + cxl->ctpio_cxl = ioremap(start, end - start);
> + if (!cxl->ctpio_cxl) {
> + pci_err(pci_dev, "CXL ioremap region failed");
> + rc = -EIO;
> + goto err_map;
> + }
> +
> + efx->efx_cxl_pio_initialised = true;
> +
> cxl_release_endpoint(cxl->cxlmd, cxl->endpoint);
>
> return 0;
>
> +err_map:
> + cxl_region_detach(cxl->cxled);
Odd looking indent.
> err_region:
> cxl_dpa_free(efx->cxl->cxled);
> err_release:
Powered by blists - more mailing lists