From: Sean Young <sean@mess.org>
To: Oliver Neukum <oneukum@suse.com>
Cc: linux-media@vger.kernel.org, mchehab@kernel.org
Subject: Re: [PATCH] imon_raw: respect DMA coherency
Date: Fri, 13 May 2022 17:23:15 +0100 [thread overview]
Message-ID: <Yn6F87BxKsOaDYR5@gofer.mess.org> (raw)
In-Reply-To: <20220512130321.30599-1-oneukum@suse.com>
On Thu, May 12, 2022 at 03:03:21PM +0200, Oliver Neukum wrote:
> No buffer can be embedded inside a descriptor, not even a simple be64.
> Use a separate kmalloc()
This patch needs a tiny change from be64_to_cpu() to be64_to_cpup(), I've
tested that change with the hardware.
Applied to my tree:
https://git.linuxtv.org/syoung/media_tree.git/log/?h=for-v5.20a
Thanks,
Sean
>
> Signed-off-by: Oliver Neukum <oneukum@suse.com>
> ---
> drivers/media/rc/imon_raw.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/rc/imon_raw.c b/drivers/media/rc/imon_raw.c
> index d41580f6e4c7..b7a0c0b34378 100644
> --- a/drivers/media/rc/imon_raw.c
> +++ b/drivers/media/rc/imon_raw.c
> @@ -14,7 +14,7 @@ struct imon {
> struct device *dev;
> struct urb *ir_urb;
> struct rc_dev *rcdev;
> - __be64 ir_buf;
> + __be64 *ir_buf;
> char phys[64];
> };
>
> @@ -137,10 +137,16 @@ static int imon_probe(struct usb_interface *intf,
> if (!imon->ir_urb)
> return -ENOMEM;
>
> + imon->ir_buf = kmalloc(sizeof(__be64), GFP_KERNEL);
> + if (!imon->ir_buf) {
> + ret = -ENOMEM;
> + goto free_urb;
> + }
> +
> imon->dev = &intf->dev;
> usb_fill_int_urb(imon->ir_urb, udev,
> usb_rcvintpipe(udev, ir_ep->bEndpointAddress),
> - &imon->ir_buf, sizeof(imon->ir_buf),
> + imon->ir_buf, sizeof(__be64),
> imon_ir_rx, imon, ir_ep->bInterval);
>
> rcdev = devm_rc_allocate_device(&intf->dev, RC_DRIVER_IR_RAW);
> @@ -177,6 +183,7 @@ static int imon_probe(struct usb_interface *intf,
>
> free_urb:
> usb_free_urb(imon->ir_urb);
> + kfree(imon->ir_buf);
> return ret;
> }
>
> @@ -186,6 +193,7 @@ static void imon_disconnect(struct usb_interface *intf)
>
> usb_kill_urb(imon->ir_urb);
> usb_free_urb(imon->ir_urb);
> + kfree(imon->ir_buf);
> }
>
> static const struct usb_device_id imon_table[] = {
> --
> 2.35.3
next prev parent reply other threads:[~2022-05-13 16:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-12 13:03 [PATCH] imon_raw: respect DMA coherency Oliver Neukum
2022-05-12 17:59 ` kernel test robot
2022-05-12 19:02 ` kernel test robot
2022-05-13 4:40 ` kernel test robot
2022-05-13 16:23 ` Sean Young [this message]
2022-05-16 11:00 ` Oliver Neukum
2022-05-16 16:40 ` Sean Young
2022-05-17 7:34 ` Oliver Neukum
2022-05-17 7:42 ` Sean Young
2022-05-17 8:28 ` Oliver Neukum
2022-05-17 10:45 ` Sean Young
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=Yn6F87BxKsOaDYR5@gofer.mess.org \
--to=sean@mess.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=oneukum@suse.com \
/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