UIO_MEM_DMA_COHERENT for cnic/bnx2/bnx2x
Subsystems (6)
cover UIO_MEM_DMA_COHERENT for cnic/bnx2/bnx2x
During bnx2i iSCSI testing we ran into page refcounting issues in the uio mmaps exported from cnic to the iscsiuio process, and bisected back to the removal of the __GFP_COMP flag from dma_alloc_coherent calls.
The cnic uio interface also has issues running with an iommu enabled, which these changes correct.
In order to fix these drivers to be able to mmap dma coherent memory via a uio device, introduce a new uio mmap type backed by dma_mmap_coherent.
While I understand some complaints about how these drivers have been structured, I also don't like letting support bitrot when there's a reasonable alternative to re-architecting an existing driver. I believe this to be the most sane way to restore these drivers to functioning properly.
There are two other uio drivers which are mmaping dma_alloc_coherent memory as UIO_MEM_PHYS, uio_dmem_genirq and uio_pruss. While a conversion to use dma_mmap_coherent might be more correct for these as well, I have no way of testing them and assume that this just hasn't been an issue for the platforms in question.
v4:
- re-introduce the dma_device member to uio_map, it needs to be passed to dma_mmap_coherent somehow
- drop patch 3 to focus only on the uio interface, explicit page alignment isn't needed
- re-add the v1 mail recipients,
this isn't something to be handled through linux-scsi
v3 (Nilesh Javali <[email protected]>):
- fix warnings reported by kernel test robot and added base commit
v2 (Nilesh Javali <[email protected]>):
- expose only the dma_addr within uio and cnic.
- Cleanup newly added unions comprising virtual_addr and struct device
previous threads:
v1: https://lore.kernel.org/all/[email protected]/
attempt at an alternative change: https://lore.kernel.org/all/[email protected]/
v2: https://lore.kernel.org/all/[email protected]/
v3: https://lore.kernel.org/all/[email protected]/
Chris Leech (2):
uio: introduce UIO_MEM_DMA_COHERENT type
cnic,bnx2,bnx2x: use UIO_MEM_DMA_COHERENT
drivers/net/ethernet/broadcom/bnx2.c | 1 + .../net/ethernet/broadcom/bnx2x/bnx2x_main.c | 2 + drivers/net/ethernet/broadcom/cnic.c | 15 +++++-- drivers/net/ethernet/broadcom/cnic.h | 1 + drivers/net/ethernet/broadcom/cnic_if.h | 1 + drivers/uio/uio.c | 40 +++++++++++++++++++ include/linux/uio_driver.h | 3 ++ 7 files changed, 60 insertions(+), 3 deletions(-)
base-commit: 861c0981648f5b64c86fd028ee622096eb7af05a
Signature · 1 line
2.43.0
PATCH 1/2 uio: introduce UIO_MEM_DMA_COHERENT type
Add a UIO memtype specifically for sharing dma_alloc_coherent memory with userspace, backed by dma_mmap_coherent.
This is mainly for the bnx2/bnx2x/bnx2i "cnic" interface, although there are a few other uio drivers which map dma_alloc_coherent memory and could be converted to use dma_mmap_coherent as well.
--- drivers/uio/uio.c | 40 ++++++++++++++++++++++++++++++++++++++ include/linux/uio_driver.h | 3 +++ 2 files changed, 43 insertions(+)
drivers/uio/uio.c +40 -0
@@ -24,6 +24,7 @@#include <linux/kobject.h> #include <linux/cdev.h> #include <linux/uio_driver.h> +#include <linux/dma-mapping.h> #define UIO_MAX_DEVICES (1U << MINORBITS)
@@ -759,6 +760,42 @@ static int uio_mmap_physical(struct vm_area_struct *vma) vma->vm_page_prot); } +static int uio_mmap_dma_coherent (struct vm_area_struct *vma) +{ +struct uio_device *idev = vma->vm_private_data; +struct uio_mem *mem; +void *addr; +int ret =0 ; +int mi; + + mi =uio_find_mem_index (vma); +if (mi <0 ) +return -EINVAL ; + + mem = idev->info->mem + mi; + +if (mem->dma_addr & ~PAGE_MASK ) +return -ENODEV ; +if (vma->vm_end - vma->vm_start > mem->size) +return -EINVAL ; + +/* +* UIO uses offset to index into the maps for a device. +* We need to clear vm_pgoff for dma_mmap_coherent. +*/ + vma->vm_pgoff =0 ; + + addr = (void *)mem->addr; + ret =dma_mmap_coherent (mem->dma_device, + vma, + addr, + mem->dma_addr, + vma->vm_end - vma->vm_start); + vma->vm_pgoff = mi; + +return ret; +} +static int uio_mmap (struct file *filep,struct vm_area_struct *vma) {struct uio_listener *listener = filep->private_data;
@@ -806,6 +843,9 @@ static int uio_mmap(struct file *filep, struct vm_area_struct *vma)case UIO_MEM_VIRTUAL : ret =uio_mmap_logical (vma);break ; +case UIO_MEM_DMA_COHERENT : + ret =uio_mmap_dma_coherent (vma); +break ;default : ret = -EINVAL ; }
include/linux/uio_driver.h +3 -0
@@ -37,10 +37,12 @@ struct uio_map;struct uio_mem {const char *name;phys_addr_t addr; +dma_addr_t dma_addr;unsigned long offs;resource_size_t size;int memtype;void __iomem *internal_addr; +struct device *dma_device;struct uio_map *map; };
@@ -158,6 +160,7 @@ extern int __must_check#define UIO_MEM_LOGICAL 2#define UIO_MEM_VIRTUAL 3#define UIO_MEM_IOVA 4 +#define UIO_MEM_DMA_COHERENT 5/* defines for uio_port->porttype */ #define UIO_PORT_NONE 0
Signature · 1 line
2.43.0
PATCH 2/2 cnic,bnx2,bnx2x: use UIO_MEM_DMA_COHERENT
In reply to Chris LeechUse the UIO_MEM_DMA_COHERENT type to properly handle mmap for dma_alloc_coherent buffers.
The cnic l2_ring and l2_buf mmaps have caused page refcount issues as the dma_alloc_coherent no longer provide __GFP_COMP allocation as per commit "dma-mapping: reject __GFP_COMP in dma_alloc_attrs".
Fix this by having the uio device use dma_mmap_coherent.
The bnx2 and bnx2x status block allocations are also dma_alloc_coherent, and should use dma_mmap_coherent. They don't allocate multiple pages, but this interface does not work correctly with an iommu enabled unless dma_mmap_coherent is used.
--- drivers/net/ethernet/broadcom/bnx2.c | 1 + drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 2 ++ drivers/net/ethernet/broadcom/cnic.c | 15 ++++++++++++--- drivers/net/ethernet/broadcom/cnic.h | 1 + drivers/net/ethernet/broadcom/cnic_if.h | 1 + 5 files changed, 17 insertions(+), 3 deletions(-)
drivers/net/ethernet/broadcom/bnx2.c +1 -0
@@ -367,6 +367,7 @@ static void bnx2_setup_cnic_irq_info(struct bnx2 *bp) cp->irq_arr[0 ].status_blk = (void *) ((unsigned long ) bnapi->status_blk.msi + (BNX2_SBLK_MSIX_ALIGN_SIZE * sb_id)); + cp->irq_arr[0 ].status_blk_map = bp->status_blk_mapping; cp->irq_arr[0 ].status_blk_num = sb_id; cp->num_irq =1 ; }
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +2 -0
@@ -14912,9 +14912,11 @@ void bnx2x_setup_cnic_irq_info(struct bnx2x *bp)else cp->irq_arr[0 ].status_blk = (void *)bp->cnic_sb.e1x_sb; + cp->irq_arr[0 ].status_blk_map = bp->cnic_sb_mapping; cp->irq_arr[0 ].status_blk_num =bnx2x_cnic_fw_sb_id (bp); cp->irq_arr[0 ].status_blk_num2 =bnx2x_cnic_igu_sb_id (bp); cp->irq_arr[1 ].status_blk = bp->def_status_blk; + cp->irq_arr[1 ].status_blk_map = bp->def_status_blk_mapping; cp->irq_arr[1 ].status_blk_num =DEF_SB_ID ; cp->irq_arr[1 ].status_blk_num2 =DEF_SB_IGU_ID ;
drivers/net/ethernet/broadcom/cnic.c +12 -3
@@ -1107,6 +1107,7 @@ static int cnic_init_uio(struct cnic_dev *dev) TX_MAX_TSS_RINGS + 1); uinfo->mem[1 ].addr = (unsigned long ) cp->status_blk.gen &CNIC_PAGE_MASK ; + uinfo->mem[1 ].dma_addr = cp->status_blk_map;if (cp->ethdev->drv_state &CNIC_DRV_STATE_USING_MSIX ) uinfo->mem[1 ].size =BNX2_SBLK_MSIX_ALIGN_SIZE *9 ;else
@@ -1118,20 +1119,26 @@ static int cnic_init_uio(struct cnic_dev *dev) uinfo->mem[1 ].addr = (unsigned long ) cp->bnx2x_def_status_blk &CNIC_PAGE_MASK ; + uinfo->mem[1 ].dma_addr = cp->status_blk_map; uinfo->mem[1 ].size =sizeof (*cp->bnx2x_def_status_blk); uinfo->name ="bnx2x_cnic" ; } - uinfo->mem[1 ].memtype =UIO_MEM_LOGICAL ; + uinfo->mem[1 ].dma_device = &dev->pcidev->dev; + uinfo->mem[1 ].memtype =UIO_MEM_DMA_COHERENT ; uinfo->mem[2 ].addr = (unsigned long ) udev->l2_ring; + uinfo->mem[2 ].dma_addr = udev->l2_ring_map; uinfo->mem[2 ].size = udev->l2_ring_size; - uinfo->mem[2 ].memtype =UIO_MEM_LOGICAL ; + uinfo->mem[2 ].dma_device = &dev->pcidev->dev; + uinfo->mem[2 ].memtype =UIO_MEM_DMA_COHERENT ; uinfo->mem[3 ].addr = (unsigned long ) udev->l2_buf; + uinfo->mem[3 ].dma_addr = udev->l2_buf_map; uinfo->mem[3 ].size = udev->l2_buf_size; - uinfo->mem[3 ].memtype =UIO_MEM_LOGICAL ; + uinfo->mem[3 ].dma_device = &dev->pcidev->dev; + uinfo->mem[3 ].memtype =UIO_MEM_DMA_COHERENT ; uinfo->version =CNIC_MODULE_VERSION ; uinfo->irq =UIO_IRQ_CUSTOM ;
@@ -1313,6 +1320,7 @@ static int cnic_alloc_bnx2x_resc(struct cnic_dev *dev)return 0 ; cp->bnx2x_def_status_blk = cp->ethdev->irq_arr[1 ].status_blk; + cp->status_blk_map = cp->ethdev->irq_arr[1 ].status_blk_map; cp->l2_rx_ring_size =15 ;
@@ -5323,6 +5331,7 @@ static int cnic_start_hw(struct cnic_dev *dev)pci_dev_get (dev->pcidev); cp->func =PCI_FUNC (dev->pcidev->devfn); cp->status_blk.gen = ethdev->irq_arr[0 ].status_blk; + cp->status_blk_map = ethdev->irq_arr[0 ].status_blk_map; cp->status_blk_num = ethdev->irq_arr[0 ].status_blk_num; err = cp->alloc_resc (dev);
drivers/net/ethernet/broadcom/cnic.h +1 -0
@@ -260,6 +260,7 @@ struct cnic_local {#define SM_RX_ID 0#define SM_TX_ID 1 } status_blk; +dma_addr_t status_blk_map;struct host_sp_status_block *bnx2x_def_status_blk;
drivers/net/ethernet/broadcom/cnic_if.h +1 -0
@@ -190,6 +190,7 @@ struct cnic_ops {struct cnic_irq {unsigned int vector;void *status_blk; +dma_addr_t status_blk_map;u32 status_blk_num;u32 status_blk_num2;u32 irq_flags;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerQuoted 57 lines · Chris Leech
During bnx2i iSCSI testing we ran into page refcounting issues in the uio mmaps exported from cnic to the iscsiuio process, and bisected back to the removal of the
__GFP_COMPflag fromdma_alloc_coherentcalls.The cnic uio interface also has issues running with an iommu enabled, which these changes correct.
In order to fix these drivers to be able to mmap dma coherent memory via a uio device, introduce a new uio mmap type backed by
dma_mmap_coherent.While I understand some complaints about how these drivers have been structured, I also don't like letting support bitrot when there's a reasonable alternative to re-architecting an existing driver. I believe this to be the most sane way to restore these drivers to functioning properly.
There are two other uio drivers which are mmaping
dma_alloc_coherentmemory asUIO_MEM_PHYS,uio_dmem_genirqanduio_pruss. While a conversion to usedma_mmap_coherentmight be more correct for these as well, I have no way of testing them and assume that this just hasn't been an issue for the platforms in question.v4:
- re-introduce thedma_devicemember touio_map, it needs to be passed todma_mmap_coherentsomehow
- drop patch 3 to focus only on the uio interface, explicit page alignment isn't needed
- re-add the v1 mail recipients,
this isn't something to be handled through linux-scsi
v3 (Nilesh Javali <[email protected]>):
- fix warnings reported by kernel test robot and added base commit
v2 (Nilesh Javali <[email protected]>):
- expose only thedma_addrwithin uio and cnic.
- Cleanup newly added unions comprisingvirtual_addrand struct deviceprevious threads:
v1: https://lore.kernel.org/all/[email protected]/
attempt at an alternative change: https://lore.kernel.org/all/[email protected]/
v2: https://lore.kernel.org/all/[email protected]/
v3: https://lore.kernel.org/all/[email protected]/Chris Leech (2):
uio: introduceUIO_MEM_DMA_COHERENTtype
cnic,bnx2,bnx2x: useUIO_MEM_DMA_COHERENTdrivers/net/ethernet/broadcom/bnx2.c | 1 + .../net/ethernet/broadcom/bnx2x/bnx2x_main.c | 2 + drivers/net/ethernet/broadcom/cnic.c | 15 +++++-- drivers/net/ethernet/broadcom/cnic.h | 1 + drivers/net/ethernet/broadcom/cnic_if.h | 1 + drivers/uio/uio.c | 40 +++++++++++++++++++ include/linux/uio_driver.h | 3 ++ 7 files changed, 60 insertions(+), 3 deletions(-)
Quoted 4 lines
base-commit:
861c0981648f5b64c86fd028ee622096eb7af05aSignature · 1 line
2.43.0
Hi,
This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree.
You are receiving this message because of the following common error(s) as indicated below:
- This looks like a new version of a previously submitted patch, but the version is not listed in the subject line. Please read the section entitled "The canonical patch format" in the kernel file, Documentation/process/submitting-patches.rst for what needs to be done here to properly describe this.
If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers.
thanks,
greg k-h's patch email bot
Greg Kroah-Hartman
maintainerRe: [PATCH 1/2] uio: introduce UIO_MEM_DMA_COHERENT type
In reply to Chris LeechQuoted 6 lines · Chris Leech
Add a UIO memtype specifically for sharing
dma_alloc_coherentmemory with userspace, backed bydma_mmap_coherent.This is mainly for the bnx2/bnx2x/bnx2i "cnic" interface, although there are a few other uio drivers which map
dma_alloc_coherentmemory and could be converted to usedma_mmap_coherentas well.
What other drivers could use this? Patches doing the conversion would be welcome, otherwise, again, I am very loath to take this one-off-change for just a single driver that shouldn't be doing this in the first place :)
thanks,
greg k-h
Greg Kroah-Hartman
maintainerRe: [PATCH 2/2] cnic,bnx2,bnx2x: use UIO_MEM_DMA_COHERENT
In reply to Chris LeechQuoted 7 lines · Chris Leech
Use the
UIO_MEM_DMA_COHERENTtype to properly handle mmap fordma_alloc_coherentbuffers.The cnic
l2_ringandl2_bufmmaps have caused page refcount issues as thedma_alloc_coherentno longer provide__GFP_COMPallocation as per commit "dma-mapping: reject__GFP_COMPindma_alloc_attrs".
Quoted 8 lines
Fix this by having the uio device use
dma_mmap_coherent.The bnx2 and bnx2x status block allocations are also
dma_alloc_coherent, and should usedma_mmap_coherent. They don't allocate multiple pages, but this interface does not work correctly with an iommu enabled unlessdma_mmap_coherentis used.Fixes bb73955c0b1d ("cnic: don't pass bogus GFP_ flags to dma_alloc_coherent")
This is really the commit that broke things? By adding this, are you expecting anyone to backport this change to older kernels?
thanks,
greg k-h
Re: [PATCH 1/2] uio: introduce UIO_MEM_DMA_COHERENT type
In reply to Greg Kroah-HartmanQuoted 5 lines · Greg Kroah-Hartman
Quoted 3 lines · Chris Leech
Add a UIO memtype specifically for sharing
dma_alloc_coherentmemory with userspace, backed bydma_mmap_coherent.
Quoted 8 lines
Quoted 3 lines
This is mainly for the bnx2/bnx2x/bnx2i "cnic" interface, although there are a few other uio drivers which map
dma_alloc_coherentmemory and could be converted to usedma_mmap_coherentas well.What other drivers could use this? Patches doing the conversion would be welcome, otherwise, again, I am very loath to take this one-off-change for just a single driver that shouldn't be doing this in the first place :)
uio_pruss and uio_dmem_genirq both appear to mmap dma_alloc_coherent memory as UIO_MEM_PHYS. It might not be an issue on that platforms where those are used, but I'd be happy to include untested patches to convert them for better adherence to the DMA APIs.
(sorry for the double send on this Greg, missed the reply-all)
- Chris
Re: [PATCH 2/2] cnic,bnx2,bnx2x: use UIO_MEM_DMA_COHERENT
In reply to Greg Kroah-HartmanQuoted 16 lines · Greg Kroah-Hartman
Quoted 14 lines · Chris Leech
Use the
UIO_MEM_DMA_COHERENTtype to properly handle mmap fordma_alloc_coherentbuffers.The cnic
l2_ringandl2_bufmmaps have caused page refcount issues as thedma_alloc_coherentno longer provide__GFP_COMPallocation as per commit "dma-mapping: reject__GFP_COMPindma_alloc_attrs".Fix this by having the uio device use
dma_mmap_coherent.The bnx2 and bnx2x status block allocations are also
dma_alloc_coherent, and should usedma_mmap_coherent. They don't allocate multiple pages, but this interface does not work correctly with an iommu enabled unlessdma_mmap_coherentis used.
Quoted 4 lines
Quoted 1 line
Fixes bb73955c0b1d ("cnic: don't pass bogus GFP_ flags to dma_alloc_coherent")This is really the commit that broke things? By adding this, are you expecting anyone to backport this change to older kernels?
That's certainly where things stopped working altogether, iommu issues go back further.
- Chris
Re: [PATCH 1/2] uio: introduce UIO_MEM_DMA_COHERENT type
In reply to Chris LeechQuoted 16 lines · Chris Leech
Quoted 5 lines · Greg Kroah-Hartman
Quoted 3 lines · Chris Leech
Add a UIO memtype specifically for sharing
dma_alloc_coherentmemory with userspace, backed bydma_mmap_coherent.Quoted 8 lines
Quoted 3 lines
This is mainly for the bnx2/bnx2x/bnx2i "cnic" interface, although there are a few other uio drivers which map
dma_alloc_coherentmemory and could be converted to usedma_mmap_coherentas well.What other drivers could use this? Patches doing the conversion would be welcome, otherwise, again, I am very loath to take this one-off-change for just a single driver that shouldn't be doing this in the first place :)
Quoted 4 lines
uio_prussanduio_dmem_genirqboth appear to mmapdma_alloc_coherentmemory asUIO_MEM_PHYS. It might not be an issue on that platforms where those are used, but I'd be happy to include untested patches to convert them for better adherence to the DMA APIs.
Yes, they do need fixing.
Re: [PATCH 2/2] cnic,bnx2,bnx2x: use UIO_MEM_DMA_COHERENT
In reply to Greg Kroah-HartmanQuoted 15 lines · Greg Kroah-Hartman
Quoted 14 lines · Chris Leech
Use the
UIO_MEM_DMA_COHERENTtype to properly handle mmap fordma_alloc_coherentbuffers.The cnic
l2_ringandl2_bufmmaps have caused page refcount issues as thedma_alloc_coherentno longer provide__GFP_COMPallocation as per commit "dma-mapping: reject__GFP_COMPindma_alloc_attrs".Fix this by having the uio device use
dma_mmap_coherent.The bnx2 and bnx2x status block allocations are also
dma_alloc_coherent, and should usedma_mmap_coherent. They don't allocate multiple pages, but this interface does not work correctly with an iommu enabled unlessdma_mmap_coherentis used.
Quoted 4 lines
Quoted 1 line
Fixes bb73955c0b1d ("cnic: don't pass bogus GFP_ flags to dma_alloc_coherent")This is really the commit that broke things? By adding this, are you expecting anyone to backport this change to older kernels?
Well, the driver has literally been broken since day 1. The above commit is what made people finally care as it also broke on more common setups. So I'm not sure the fixes tag is correct.
Re: [PATCH 1/2] uio: introduce UIO_MEM_DMA_COHERENT type
In reply to Chris LeechAs the least horrible way out this looks ok:
Bt maybe you can add some commentary why this mem mode exists and why no one should be using it in new code?
Greg Kroah-Hartman
maintainerRe: [PATCH 1/2] uio: introduce UIO_MEM_DMA_COHERENT type
Quoted 7 lines · Christoph Hellwig
As the least horrible way out this looks ok:
Reviewed-by Christoph Hellwig <[email protected]>Bt maybe you can add some commentary why this mem mode exists and why no one should be using it in new code?
Good idea, and perhaps a kernel log warning when this is used as well just to prevent anyone new from ever considering it.
thanks,
greg k-h
Re: [PATCH 1/2] uio: introduce UIO_MEM_DMA_COHERENT type
In reply to Chris LeechHi,
Quoted 19 lines · Chris Leech
Add a UIO memtype specifically for sharing
dma_alloc_coherentmemory with userspace, backed bydma_mmap_coherent.This is mainly for the bnx2/bnx2x/bnx2i "cnic" interface, although there are a few other uio drivers which map
dma_alloc_coherentmemory and could be converted to usedma_mmap_coherentas well.Signed-off-by Nilesh Javali <[email protected]>Signed-off-by Chris Leech <[email protected]>--- drivers/uio/uio.c | 40 ++++++++++++++++++++++++++++++++++++++ include/linux/uio_driver.h | 3 +++ 2 files changed, 43 insertions(+)drivers/uio/uio.c +0
-0@@ -24,6 +24,7 @@
[..]
Quoted 16 lines
drivers/uio/uio.c +16
-0+static int uio_mmap_dma_coherent (struct vm_area_struct *vma) +{ +struct uio_device *idev = vma->vm_private_data; +struct uio_mem *mem; +void *addr; +int ret =0 ; +int mi; + + mi =uio_find_mem_index (vma); +if (mi <0 ) +return -EINVAL ; + + mem = idev->info->mem + mi; + +if (mem->dma_addr & ~PAGE_MASK ) +return -ENODEV ;
drivers/uio/uio.c static int uio_mmap_physical(struct vm_area_struct *vma) · line 788
Quoted 10 lines
drivers/uio/uio.c +10
-0+if (vma->vm_end - vma->vm_start > mem->size) +return -EINVAL ; + +/* +* UIO uses offset to index into the maps for a device. +* We need to clear vm_pgoff for dma_mmap_coherent. +*/ + vma->vm_pgoff =0 ; + + addr = (void *)mem->addr;
This cast introduces a build error when building with sizeof(void *) != sizeof(phys_addr_t).
For example on i386 with PHYS_ADDR_T_64BIT.
(Enabled through allmodconfig)
drivers/uio/uio.c: In function 'uio_mmap_dma_coherent':drivers/uio/uio.c:795:16: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
795 | addr = (void *)mem->addr;
| ^drivers/uio/uio_pruss.c: In function 'pruss_probe':drivers/uio/uio_pruss.c:194:34: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
194 | p->mem[2].addr = (phys_addr_t) gdev->ddr_vaddr;
| ^drivers/uio/uio_dmem_genirq.c: In function 'uio_dmem_genirq_open':drivers/uio/uio_dmem_genirq.c:63:39: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
63 | uiomem->addr = addr ? (phys_addr_t) addr : DMEM_MAP_ERROR;
| ^drivers/uio/uio_dmem_genirq.c: In function 'uio_dmem_genirq_release':drivers/uio/uio_dmem_genirq.c:92:43: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
92 | (void *) uiomem->addr,
As you can see some other files are also affected, which seem to be triggered by other but related patches.
This is on next-20240312.
drivers/uio/uio.c static int uio_mmap_physical(struct vm_area_struct *vma) · line 798
Quoted 10 lines
drivers/uio/uio.c +10
-0+ ret =dma_mmap_coherent (mem->dma_device, + vma, + addr, + mem->dma_addr, + vma->vm_end - vma->vm_start); + vma->vm_pgoff = mi; + +return ret; +} +
[..]
Thomas