[PATCH 06/34] net: mana: Set the DMA device max segment size
authorAjay Sharma <sharmaajay@microsoft.com>
Thu, 3 Nov 2022 19:16:22 +0000 (12:16 -0700)
committerSalvatore Bonaccorso <carnil@debian.org>
Fri, 7 Feb 2025 09:43:47 +0000 (10:43 +0100)
MANA hardware doesn't have any restrictions on the DMA segment size, set it
to the max allowed value.

Signed-off-by: Ajay Sharma <sharmaajay@microsoft.com>
Reviewed-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Long Li <longli@microsoft.com>
Link: https://lore.kernel.org/r/1667502990-2559-5-git-send-email-longli@linuxonhyperv.com
Acked-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
(cherry picked from commit 6fe254160bd033a1e62dbad9b734183b31144678)
Signed-off-by: Bastian Blank <waldi@debian.org>
Gbp-Pq: Topic features/all/ethernet-microsoft
Gbp-Pq: Name 0006-net-mana-Set-the-DMA-device-max-segment-size.patch

drivers/net/ethernet/microsoft/mana/gdma_main.c

index a00bd88443d375a7eede72120c64cdc932c83533..bc00a7d0723213d60b1f471700f63d22872aa9d6 100644 (file)
@@ -1403,6 +1403,12 @@ static int mana_gd_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        if (err)
                goto release_region;
 
+       err = dma_set_max_seg_size(&pdev->dev, UINT_MAX);
+       if (err) {
+               dev_err(&pdev->dev, "Failed to set dma device segment size\n");
+               goto release_region;
+       }
+
        err = -ENOMEM;
        gc = vzalloc(sizeof(*gc));
        if (!gc)