All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xhci-pci: set the dma max_seg_size
@ 2022-12-13 15:08 Ricardo Ribalda
  2022-12-14 10:20 ` Mathias Nyman
  0 siblings, 1 reply; 2+ messages in thread
From: Ricardo Ribalda @ 2022-12-13 15:08 UTC (permalink / raw)
  To: Mathias Nyman, Greg Kroah-Hartman
  Cc: Takashi Iwai, linux-usb, Ricardo Ribalda, linux-kernel

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

xhci_hcd 0000:00:14.0: mapping sg segment longer than device claims to support [len=98304] [max=65536]

Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
To: Mathias Nyman <mathias.nyman@intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/usb/host/xhci-pci.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index 7bccbe50bab1..116a2f328772 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -453,6 +453,8 @@ static int xhci_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 	if (xhci->quirks & XHCI_DEFAULT_PM_RUNTIME_ALLOW)
 		pm_runtime_allow(&dev->dev);
 
+	dma_set_max_seg_size(&dev->dev, UINT_MAX);
+
 	return 0;
 
 put_usb3_hcd:

---
base-commit: 0ec5a38bf8499f403f81cb81a0e3a60887d1993c
change-id: 20221213-xhci-max_seg_size-de366fbf12bc

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

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

* Re: [PATCH] xhci-pci: set the dma max_seg_size
  2022-12-13 15:08 [PATCH] xhci-pci: set the dma max_seg_size Ricardo Ribalda
@ 2022-12-14 10:20 ` Mathias Nyman
  0 siblings, 0 replies; 2+ messages in thread
From: Mathias Nyman @ 2022-12-14 10:20 UTC (permalink / raw)
  To: Ricardo Ribalda, Mathias Nyman, Greg Kroah-Hartman
  Cc: Takashi Iwai, linux-usb, linux-kernel

On 13.12.2022 17.08, Ricardo Ribalda wrote:
> Allow devices to have dma operations beyond 64K, and avoid warnings such
> as:
> 
> xhci_hcd 0000:00:14.0: mapping sg segment longer than device claims to support [len=98304] [max=65536]
> 
> Cc: Takashi Iwai <tiwai@suse.de>
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> ---
> To: Mathias Nyman <mathias.nyman@intel.com>
> To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: linux-usb@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> ---
>   drivers/usb/host/xhci-pci.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
> index 7bccbe50bab1..116a2f328772 100644
> --- a/drivers/usb/host/xhci-pci.c
> +++ b/drivers/usb/host/xhci-pci.c
> @@ -453,6 +453,8 @@ static int xhci_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
>   	if (xhci->quirks & XHCI_DEFAULT_PM_RUNTIME_ALLOW)
>   		pm_runtime_allow(&dev->dev);
>   
> +	dma_set_max_seg_size(&dev->dev, UINT_MAX);
> +

Thanks, this should be ok.

Preferred max segment size of sg list would be 64k as xHC hardware has 64k TRB payload size
limit, but xhci driver will take care of larger segments, splitting them into 64k chunks.

-Mathias


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

end of thread, other threads:[~2022-12-14 10:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-13 15:08 [PATCH] xhci-pci: set the dma max_seg_size Ricardo Ribalda
2022-12-14 10:20 ` Mathias Nyman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.