linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] usb: dwc3: set the dma max_seg_size
@ 2023-10-27 11:28 Ricardo Ribalda
  2023-10-31 23:22 ` Thinh Nguyen
  0 siblings, 1 reply; 6+ messages in thread
From: Ricardo Ribalda @ 2023-10-27 11:28 UTC (permalink / raw)
  To: Zubin Mithra, Thinh Nguyen, Greg Kroah-Hartman
  Cc: linux-usb, linux-kernel, stable, Ricardo Ribalda

Allow devices to have dma operations beyond 4K, and avoid warnings such
as:

DMA-API: dwc3 a600000.usb: mapping sg segment longer than device claims to support [len=86016] [max=65536]

Cc: stable@vger.kernel.org
Fixes: 72246da40f37 ("usb: Introduce DesignWare USB3 DRD Driver")
Reported-by: Zubin Mithra <zsm@chromium.org>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
Found while running 
yavta -f YUYV -s 1280x720 -c  /dev/video0

with:

CONFIG_DMA_API_DEBUG=y
---
Changes in v2:
- Add stable tag
- Link to v1: https://lore.kernel.org/r/20231026-dwc3-v1-1-643c74771599@chromium.org
---
 drivers/usb/dwc3/core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 343d2570189f..65f73dd8ef47 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -1918,6 +1918,8 @@ static int dwc3_probe(struct platform_device *pdev)
 
 	pm_runtime_put(dev);
 
+	dma_set_max_seg_size(dev, UINT_MAX);
+
 	return 0;
 
 err_exit_debugfs:

---
base-commit: 611da07b89fdd53f140d7b33013f255bf0ed8f34
change-id: 20231026-dwc3-fac74fcb3b2a

Best regards,
-- 
Ricardo Ribalda <ribalda@chromium.org>


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] usb: dwc3: set the dma max_seg_size
  2023-10-27 11:28 [PATCH v2] usb: dwc3: set the dma max_seg_size Ricardo Ribalda
@ 2023-10-31 23:22 ` Thinh Nguyen
  2023-11-10 10:04   ` Ricardo Ribalda
  0 siblings, 1 reply; 6+ messages in thread
From: Thinh Nguyen @ 2023-10-31 23:22 UTC (permalink / raw)
  To: Ricardo Ribalda
  Cc: Zubin Mithra, Thinh Nguyen, Greg Kroah-Hartman, linux-usb,
	linux-kernel, stable

On Fri, Oct 27, 2023, Ricardo Ribalda wrote:
> Allow devices to have dma operations beyond 4K, and avoid warnings such
> as:
> 
> DMA-API: dwc3 a600000.usb: mapping sg segment longer than device claims to support [len=86016] [max=65536]
> 
> Cc: stable@vger.kernel.org
> Fixes: 72246da40f37 ("usb: Introduce DesignWare USB3 DRD Driver")
> Reported-by: Zubin Mithra <zsm@chromium.org>
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> ---
> Found while running 
> yavta -f YUYV -s 1280x720 -c  /dev/video0
> 
> with:
> 
> CONFIG_DMA_API_DEBUG=y
> ---
> Changes in v2:
> - Add stable tag
> - Link to v1: https://urldefense.com/v3/__https://lore.kernel.org/r/20231026-dwc3-v1-1-643c74771599@chromium.org__;!!A4F2R9G_pg!b22b7Wx1QOpnFtMi7rJ0TS-rhOnMmy_sOCX3kdfln7ezNjslyMhBwHvWaXbK8D5BkKPjjn3HdID-7Ls5R3eR_4o$ 
> ---
>  drivers/usb/dwc3/core.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index 343d2570189f..65f73dd8ef47 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -1918,6 +1918,8 @@ static int dwc3_probe(struct platform_device *pdev)
>  
>  	pm_runtime_put(dev);
>  
> +	dma_set_max_seg_size(dev, UINT_MAX);
> +
>  	return 0;
>  
>  err_exit_debugfs:
> 
> ---
> base-commit: 611da07b89fdd53f140d7b33013f255bf0ed8f34
> change-id: 20231026-dwc3-fac74fcb3b2a
> 
> Best regards,
> -- 
> Ricardo Ribalda <ribalda@chromium.org>
> 

Probably better to have the Closes: tag with the link to the reported
issue. Regardless,

Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>

Thanks,
Thinh

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] usb: dwc3: set the dma max_seg_size
  2023-10-31 23:22 ` Thinh Nguyen
@ 2023-11-10 10:04   ` Ricardo Ribalda
  2023-11-10 22:56     ` Thinh Nguyen
  0 siblings, 1 reply; 6+ messages in thread
From: Ricardo Ribalda @ 2023-11-10 10:04 UTC (permalink / raw)
  To: Thinh Nguyen
  Cc: Zubin Mithra, Greg Kroah-Hartman, linux-usb, linux-kernel, stable

Hi Thinh

On Wed, 1 Nov 2023 at 00:22, Thinh Nguyen <Thinh.Nguyen@synopsys.com> wrote:
>
> On Fri, Oct 27, 2023, Ricardo Ribalda wrote:
> > Allow devices to have dma operations beyond 4K, and avoid warnings such
> > as:
> >
> > DMA-API: dwc3 a600000.usb: mapping sg segment longer than device claims to support [len=86016] [max=65536]
> >
> > Cc: stable@vger.kernel.org
> > Fixes: 72246da40f37 ("usb: Introduce DesignWare USB3 DRD Driver")
> > Reported-by: Zubin Mithra <zsm@chromium.org>
> > Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> > ---
> > Found while running
> > yavta -f YUYV -s 1280x720 -c  /dev/video0
> >
> > with:
> >
> > CONFIG_DMA_API_DEBUG=y
> > ---
> > Changes in v2:
> > - Add stable tag
> > - Link to v1: https://urldefense.com/v3/__https://lore.kernel.org/r/20231026-dwc3-v1-1-643c74771599@chromium.org__;!!A4F2R9G_pg!b22b7Wx1QOpnFtMi7rJ0TS-rhOnMmy_sOCX3kdfln7ezNjslyMhBwHvWaXbK8D5BkKPjjn3HdID-7Ls5R3eR_4o$
> > ---
> >  drivers/usb/dwc3/core.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> > index 343d2570189f..65f73dd8ef47 100644
> > --- a/drivers/usb/dwc3/core.c
> > +++ b/drivers/usb/dwc3/core.c
> > @@ -1918,6 +1918,8 @@ static int dwc3_probe(struct platform_device *pdev)
> >
> >       pm_runtime_put(dev);
> >
> > +     dma_set_max_seg_size(dev, UINT_MAX);
> > +
> >       return 0;
> >
> >  err_exit_debugfs:
> >
> > ---
> > base-commit: 611da07b89fdd53f140d7b33013f255bf0ed8f34
> > change-id: 20231026-dwc3-fac74fcb3b2a
> >
> > Best regards,
> > --
> > Ricardo Ribalda <ribalda@chromium.org>
> >
>
> Probably better to have the Closes: tag with the link to the reported
> issue. Regardless,

It was reported internally, so I have no link to share.

In this cases it seems that Reported-by with no link in good enough:
https://lore.kernel.org/all/ab557ae6-7550-189a-81dd-6e3346d84620@leemhuis.info/


>
> Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>

Thanks!
>
> Thanks,
> Thinh



-- 
Ricardo Ribalda

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] usb: dwc3: set the dma max_seg_size
  2023-11-10 10:04   ` Ricardo Ribalda
@ 2023-11-10 22:56     ` Thinh Nguyen
  2023-11-17 12:48       ` Ricardo Ribalda
  0 siblings, 1 reply; 6+ messages in thread
From: Thinh Nguyen @ 2023-11-10 22:56 UTC (permalink / raw)
  To: Ricardo Ribalda
  Cc: Thinh Nguyen, Zubin Mithra, Greg Kroah-Hartman, linux-usb,
	linux-kernel, stable

On Fri, Nov 10, 2023, Ricardo Ribalda wrote:
> > Probably better to have the Closes: tag with the link to the reported
> > issue. Regardless,
> 
> It was reported internally, so I have no link to share.
> 

I see.

Thanks,
Thinh

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] usb: dwc3: set the dma max_seg_size
  2023-11-10 22:56     ` Thinh Nguyen
@ 2023-11-17 12:48       ` Ricardo Ribalda
  2023-11-17 19:46         ` Greg Kroah-Hartman
  0 siblings, 1 reply; 6+ messages in thread
From: Ricardo Ribalda @ 2023-11-17 12:48 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Thinh Nguyen, Zubin Mithra, linux-usb, linux-kernel, stable

Greg: Friendly ping, just want to make sure that the patch did not
fell into the cracks

thanks!

On Fri, 10 Nov 2023 at 23:56, Thinh Nguyen <Thinh.Nguyen@synopsys.com> wrote:
>
> On Fri, Nov 10, 2023, Ricardo Ribalda wrote:
> > > Probably better to have the Closes: tag with the link to the reported
> > > issue. Regardless,
> >
> > It was reported internally, so I have no link to share.
> >
>
> I see.
>
> Thanks,
> Thinh



-- 
Ricardo Ribalda

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] usb: dwc3: set the dma max_seg_size
  2023-11-17 12:48       ` Ricardo Ribalda
@ 2023-11-17 19:46         ` Greg Kroah-Hartman
  0 siblings, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2023-11-17 19:46 UTC (permalink / raw)
  To: Ricardo Ribalda
  Cc: Thinh Nguyen, Zubin Mithra, linux-usb, linux-kernel, stable

On Fri, Nov 17, 2023 at 01:48:47PM +0100, Ricardo Ribalda wrote:
> Greg: Friendly ping, just want to make sure that the patch did not
> fell into the cracks

The merge window just ended, and we have been away at the plumbers
conference all week long.  Give us a chance to travel back home and
start to catch up in the next few weeks.

In the meantime, please take some time and review the pending dwc3
patches on the list to make my review process easier and allow me to get
through them all to yours quicker.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-11-17 19:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-27 11:28 [PATCH v2] usb: dwc3: set the dma max_seg_size Ricardo Ribalda
2023-10-31 23:22 ` Thinh Nguyen
2023-11-10 10:04   ` Ricardo Ribalda
2023-11-10 22:56     ` Thinh Nguyen
2023-11-17 12:48       ` Ricardo Ribalda
2023-11-17 19:46         ` Greg Kroah-Hartman

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).