Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Andreas Hilse <andreas.hilse@googlemail.com>
To: Bryan Whitehead <bryan.whitehead@microchip.com>,
UNGLinuxDriver@microchip.com
Cc: netdev@vger.kernel.org
Subject: lan743x driver fails to map DMA during initialization on Raspberry CM4IO
Date: Mon, 2 Aug 2021 14:45:12 +0200 [thread overview]
Message-ID: <CANabuZeqrpk-gsZnCz-CYZKo5pRfWW0MGSY2DAWqz1060bReGw@mail.gmail.com> (raw)
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
next reply other threads:[~2021-08-02 12:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-02 12:45 Andreas Hilse [this message]
2021-08-15 8:42 ` Christoph Hellwig
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=CANabuZeqrpk-gsZnCz-CYZKo5pRfWW0MGSY2DAWqz1060bReGw@mail.gmail.com \
--to=andreas.hilse@googlemail.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=bryan.whitehead@microchip.com \
--cc=netdev@vger.kernel.org \
--subject='Re: lan743x driver fails to map DMA during initialization on Raspberry CM4IO' \
/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
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).