All of lore.kernel.org
 help / color / mirror / Atom feed
* lan743x driver fails to map DMA during initialization on Raspberry CM4IO
@ 2021-08-02 12:45 Andreas Hilse
  2021-08-15  8:42 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Hilse @ 2021-08-02 12:45 UTC (permalink / raw)
  To: Bryan Whitehead, UNGLinuxDriver; +Cc: netdev

To whom it may concern,

I encountered this error when trying to get an EVB-LAN7430 evaluation
board to work with the PCIe interface on a Raspberry CM4IO board.
There was already someone on the raspberrypi/linux github who
encountered the same problem and also provided a possible fix here:
https://github.com/raspberrypi/linux/issues/4117

Please refer to the github link for a detailed error description.

The fix was tested successfully by some people who commented on the
github issue and by myself.
It seems the issue occurred on both 32 and 64 Bit builds on this system.
If I understand it correctly, this might not a universal fix.


diff --git a/drivers/net/ethernet/microchip/lan743x_main.c
b/drivers/net/ethernet/microchip/lan743x_main.c
index 8947c3a62810..96673017d6d9 100644
--- a/drivers/net/ethernet/microchip/lan743x_main.c
+++ b/drivers/net/ethernet/microchip/lan743x_main.c
@@ -2318,6 +2318,13 @@ static int lan743x_rx_ring_init(struct lan743x_rx *rx)
                ret = -EINVAL;
                goto cleanup;
        }
+
+       if (dma_set_mask_and_coherent(&rx->adapter->pdev->dev,
DMA_BIT_MASK(64))) {
+               dev_warn(&rx->adapter->pdev->dev, "lan743x_: No
suitable DMA available\n");
+               ret = -ENOMEM;
+               goto cleanup;
+       }
+
        ring_allocation_size = ALIGN(rx->ring_size *
                                     sizeof(struct lan743x_rx_descriptor),
                                     PAGE_SIZE);

--
Best regards
Andreas Hilse

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

* Re: lan743x driver fails to map DMA during initialization on Raspberry CM4IO
  2021-08-02 12:45 lan743x driver fails to map DMA during initialization on Raspberry CM4IO Andreas Hilse
@ 2021-08-15  8:42 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2021-08-15  8:42 UTC (permalink / raw)
  To: Andreas Hilse; +Cc: Bryan Whitehead, UNGLinuxDriver, netdev

On Mon, Aug 02, 2021 at 02:45:12PM +0200, Andreas Hilse wrote:
> +
> +       if (dma_set_mask_and_coherent(&rx->adapter->pdev->dev,
> DMA_BIT_MASK(64))) {

Setting the 64-bit mask never fails, no need for the error handling
here.

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

end of thread, other threads:[~2021-08-15  8:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-02 12:45 lan743x driver fails to map DMA during initialization on Raspberry CM4IO Andreas Hilse
2021-08-15  8:42 ` Christoph Hellwig

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.