Re: WARNING: drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:364 vchiq_prepare_bulk_data

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

 



Hi Arnd,

Am 11.06.24 um 14:14 schrieb Arnd Bergmann:
On Tue, Jun 11, 2024, at 13:37, Stefan Wahren wrote:
Am 11.06.24 um 13:08 schrieb Arnd Bergmann:
On Tue, Jun 11, 2024, at 12:47, Stefan Wahren wrote:
          if (len == 0)
              pr_warn_once("%s: sg_dma_len() == 0\n", __func__);
          else if (i && (i != (dma_buffers - 1)) && (len & ~PAGE_MASK))
              pr_warn_once("%s: following block not page aligned\n",
__func__);
          else if (i && (addr & ~PAGE_MASK)) {
              pr_warn_once("%s: block %u, DMA address %pad doesn't align
with PAGE_MASK 0x%lx\n", __func__, i, &addr, PAGE_MASK);
              pr_warn_once("sg_dma_is_swiotlb: %d, dma_flags: %x\n",
sg_dma_is_swiotlb(sg), sg->dma_flags);
              pr_warn_once("type = %s\n", (type == PAGELIST_WRITE) ?
"PAGELIST_WRITE" : "PAGELIST_READ");
              if (buf)
                  pr_warn_once("buf = %p, count = %zu\n", buf, count);
              else
                  pr_warn_once("ubuf = %p, count = %zu\n", ubuf, count);
          }

Output:

[   66.184030] create_pagelist: block 1, DMA address 0x00000000f5fc7800
doesn't align with PAGE_MASK 0xfffffffffffff000
[   66.184056] sg_dma_is_swiotlb: 0, dma_flags: 0
[   66.184063] type = PAGELIST_READ
[   66.184066] ubuf = 00000000266a70a7, count = 0
sorry my debug attempt for count was pointless. The value is always
decremented to zero at this point. So your suggested change won't have
any effect.
 From my reading of the code, it's not really meant to handle
count=0, so maybe the answer for that is to just return an
error (or possibly success) when there is data attached to
the request from user space, something like

--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c
@@ -328,6 +328,11 @@ static int vchiq_irq_queue_bulk_tx_rx(struct vchiq_instance *instance,
                 userdata = args->userdata;
         }

+       if (!args->size) {
+               ret = 0;
+               goto out;
+       }
+
         status = vchiq_bulk_transfer(instance, args->handle, NULL, args->data, args->size,
                                      userdata, args->mode, dir);


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel






[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux