linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hui Fang <hui.fang@nxp.com>
To: Tomasz Figa <tfiga@chromium.org>
Cc: Anle Pan <anle.pan@nxp.com>,
	"m.szyprowski@samsung.com" <m.szyprowski@samsung.com>,
	"mchehab@kernel.org" <mchehab@kernel.org>,
	"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jindong Yue <jindong.yue@nxp.com>,
	Xuegang Liu <xuegang.liu@nxp.com>
Subject: RE: [EXT] Re: [PATCH] media: videobuf2-dma-sg: limit the sg segment size
Date: Wed, 6 Sep 2023 08:16:29 +0000	[thread overview]
Message-ID: <DB9PR04MB9284A0CDB1FC7CAADE0A394F87EFA@DB9PR04MB9284.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <CAAFQd5BGJX7=Z1ukFRq_ktaQ0d7FbvV-ob5gs8hfGaNHUXPTww@mail.gmail.com>

On Wed, Sep 5, 2023 at 12:44 AM Tomasz Figa <tfiga@chromium.org> wrote:
> 
> I see. I guess the mapping is done by the USB gadget controller driver? Could
> you point us to the exact driver that's used?
> 
> Just to clarify, swiotlb should only be needed in the very extreme fallback case,
> because of the performance impact of the memory copy back and forth. The
> right approach would depend on the DMA capabilities of your device, though.


[  138.493943][ T2104] Call trace:
[  138.497090][ T2104]  vb2_dma_sg_alloc+0x2ec/0x2fc
[  138.501808][ T2104]  __vb2_queue_alloc+0x224/0x724
[  138.506608][ T2104]  vb2_core_reqbufs+0x374/0x528
[  138.511320][ T2104]  vb2_reqbufs+0xe0/0xf4
[  138.515428][ T2104]  uvcg_alloc_buffers+0x18/0x34
[  138.520159][ T2104]  uvc_v4l2_reqbufs+0x38/0x54
[  138.524703][ T2104]  v4l_reqbufs+0x68/0x80
[  138.528820][ T2104]  __video_do_ioctl+0x370/0x4dc
[  138.533535][ T2104]  video_usercopy+0x43c/0xb38
[  138.538076][ T2104]  video_ioctl2+0x18/0x28
[  138.542272][ T2104]  v4l2_ioctl+0x6c/0x84
[  138.546291][ T2104]  __arm64_sys_ioctl+0xa8/0xe4
[  138.550928][ T2104]  invoke_syscall+0x58/0x114
[  138.555389][ T2104]  el0_svc_common+0x88/0xfc
[  138.559755][ T2104]  do_el0_svc+0x2c/0xb8
[  138.563776][ T2104]  el0_svc+0x2c/0xa4
[  138.567544][ T2104]  el0t_64_sync_handler+0x68/0xb4
[  138.572434][ T2104]  el0t_64_sync+0x1a4/0x1a8
[  138.576803][ T2104] Code: 17ffffcb 928002b3 d4210000 17ffffc8 (d4210000) 
[  138.583598][ T2104] ---[ end trace 0000000000000000 ]---

Also, below should explain why vb2_dma_sg_alloc is used.
We tested on 8mp with use dwc3 controller.

In drivers/usb/dwc3/gadget.c:
dwc->gadget->sg_supported       = true;

In drivers/usb/gadget/function/uvc_queue.c
if (cdev->gadget->sg_supported) {
	queue->queue.mem_ops = &vb2_dma_sg_memops;
	queue->use_sg = 1;
} else {
	queue->queue.mem_ops = &vb2_vmalloc_memops;
}


BRs,
Fang Hui



  reply	other threads:[~2023-09-06  8:16 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-28  7:54 [PATCH] media: videobuf2-dma-sg: limit the sg segment size Anle Pan
2023-08-29 10:03 ` Tomasz Figa
2023-08-29 11:14   ` Robin Murphy
2023-08-29 15:04     ` Christoph Hellwig
2023-08-30  3:47       ` Tomasz Figa
2023-08-30 14:33         ` Christoph Hellwig
2023-08-30 16:43           ` Jason Gunthorpe
2023-08-31 12:35             ` Christoph Hellwig
2023-08-31 15:32               ` Jason Gunthorpe
2023-09-01  6:10                 ` Christoph Hellwig
2023-09-01 14:26                   ` Jason Gunthorpe
     [not found]       ` <DB9PR04MB92841D8BC1122D5A4210F78987E6A@DB9PR04MB9284.eurprd04.prod.outlook.com>
2023-08-30 13:41         ` [EXT] " Robin Murphy
2023-08-30  3:59     ` Tomasz Figa
2023-09-06  8:52     ` Hans Verkuil
2023-09-06  9:26       ` Tomasz Figa
2023-09-06  9:43         ` Hans Verkuil
2023-08-30  8:50 ` Hui Fang
2023-08-30  9:28   ` Tomasz Figa
2023-09-04  7:10     ` [EXT] " Hui Fang
2023-09-05  3:43       ` Tomasz Figa
2023-09-06  8:16         ` Hui Fang [this message]
2023-09-06  9:28           ` Tomasz Figa
2023-09-11  6:13             ` Hui Fang
2023-09-12  2:22               ` Tomasz Figa
2023-09-12  7:01                 ` Hui Fang
2023-09-12  7:10                   ` Tomasz Figa
2023-09-12  7:43                     ` Hui Fang
2023-09-12  7:51                       ` Tomasz Figa
2023-09-13  9:13                         ` Hui Fang
2023-09-13  9:44                           ` Tomasz Figa
2023-09-13 13:16                             ` Hui Fang
2023-09-18  2:28                               ` Hui Fang

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=DB9PR04MB9284A0CDB1FC7CAADE0A394F87EFA@DB9PR04MB9284.eurprd04.prod.outlook.com \
    --to=hui.fang@nxp.com \
    --cc=anle.pan@nxp.com \
    --cc=jindong.yue@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mchehab@kernel.org \
    --cc=tfiga@chromium.org \
    --cc=xuegang.liu@nxp.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;
as well as URLs for NNTP newsgroup(s).