From: "Arnd Bergmann" <arnd@arndb.de>
To: "Stefan Wahren" <wahrenst@gmx.net>,
"Robin Murphy" <robin.murphy@arm.com>,
"Phil Elwell" <phil@raspberrypi.com>
Cc: "laurent.pinchart" <laurent.pinchart@ideasonboard.com>,
"Catalin Marinas" <catalin.marinas@arm.com>,
"Will Deacon" <will@kernel.org>, "Christoph Hellwig" <hch@lst.de>,
"Florian Fainelli" <florian.fainelli@broadcom.com>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Linux ARM" <linux-arm-kernel@lists.infradead.org>,
linux-staging@lists.linux.dev
Subject: Re: WARNING: drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:364 vchiq_prepare_bulk_data
Date: Tue, 11 Jun 2024 14:14:20 +0200 [thread overview]
Message-ID: <87699d92-64f4-4b28-840e-8b320502acb2@app.fastmail.com> (raw)
In-Reply-To: <5113a1df-858b-4ba1-bd8b-c53c0313c7ce@gmx.net>
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
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);
next prev parent reply other threads:[~2024-06-11 12:14 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-09 22:24 WARNING: drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:364 vchiq_prepare_bulk_data Stefan Wahren
2024-06-10 6:00 ` Arnd Bergmann
2024-06-10 8:26 ` Phil Elwell
2024-06-10 9:00 ` Arnd Bergmann
2024-06-10 9:15 ` Laurent Pinchart
2024-06-10 9:19 ` Arnd Bergmann
2024-06-10 9:24 ` Phil Elwell
2024-06-10 10:09 ` Arnd Bergmann
2024-06-10 10:25 ` Robin Murphy
2024-06-11 10:47 ` Stefan Wahren
2024-06-11 11:08 ` Arnd Bergmann
2024-06-11 11:37 ` Stefan Wahren
2024-06-11 12:14 ` Arnd Bergmann [this message]
2024-06-11 13:09 ` Stefan Wahren
2024-06-11 13:35 ` Robin Murphy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87699d92-64f4-4b28-840e-8b320502acb2@app.fastmail.com \
--to=arnd@arndb.de \
--cc=catalin.marinas@arm.com \
--cc=florian.fainelli@broadcom.com \
--cc=gregkh@linuxfoundation.org \
--cc=hch@lst.de \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-staging@lists.linux.dev \
--cc=phil@raspberrypi.com \
--cc=robin.murphy@arm.com \
--cc=wahrenst@gmx.net \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox