From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Steffen Trumtrar <s.trumtrar@pengutronix.de>,
barebox@lists.infradead.org
Subject: Re: [PATCH 2/2] net: macb: convert to volatile accesses
Date: Wed, 29 Nov 2023 07:31:37 +0100 [thread overview]
Message-ID: <f6fba7e0-864f-4fb9-aa34-5cea250325a8@pengutronix.de> (raw)
In-Reply-To: <20231128-v2023-08-0-topic-macb-v1-2-9faff73bc990@pengutronix.de>
Hello Steffen,
On 28.11.23 17:29, Steffen Trumtrar wrote:
> + writel(ctrl, &macb->tx_ring[tx_head].ctrl);
> + writel((ulong)packet, &macb->tx_ring[tx_head].addr);
> dma_sync_single_for_device(macb->dev, (unsigned long)packet, length, DMA_TO_DEVICE);
For this buffer dma_map_single is missing. I just sent out a series to implement
CONFIG_DMA_API_DEBUG by the way that should catch this (as well as the original
issue in the Rx path).
> - macb->gem_q1_descs[0].addr = 0;
> - macb->gem_q1_descs[0].ctrl = MACB_BIT(TX_WRAP) |
> - MACB_BIT(TX_LAST) | MACB_BIT(TX_USED);
> + writel(0, &macb->gem_q1_descs[0].addr);
> + setbits_le32(&macb->gem_q1_descs[0].ctrl,
> + MACB_BIT(TX_WRAP) | MACB_BIT(TX_LAST) | MACB_BIT(TX_USED));
Should be writel to maintain previous semantics.
> - macb->tx_ring[TX_RING_SIZE - 1].addr |= MACB_BIT(TX_WRAP);
> + writel(MACB_BIT(TX_WRAP), &macb->tx_ring[TX_RING_SIZE - 1].addr);
Should be a setbits_le32 to maintain previous semantics.
> /* Disable the second priority rx queue */
> - macb->gem_q1_descs[1].addr = MACB_BIT(RX_USED) |
> - MACB_BIT(RX_WRAP);
> - macb->gem_q1_descs[1].ctrl = 0;
> + setbits_le32(&macb->gem_q1_descs[1].addr,
> + MACB_BIT(RX_USED) | MACB_BIT(RX_WRAP));
Should be a writel to maintain previous semantics.
> + writel(0, &macb->gem_q1_descs[1].ctrl);
>
> gem_writel(macb, RQ1, (ulong)&macb->gem_q1_descs[1]);
> }
>
Cheers,
Ahmad
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
prev parent reply other threads:[~2023-11-29 6:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-28 16:29 [PATCH 0/2] net: macb: fix dma usage Steffen Trumtrar
2023-11-28 16:29 ` [PATCH 1/2] net: macb: fix dma_alloc for rx_buffer Steffen Trumtrar
2023-11-28 16:56 ` Lucas Stach
2023-11-29 6:48 ` Steffen Trumtrar
2023-11-29 6:25 ` Ahmad Fatoum
2023-11-28 16:29 ` [PATCH 2/2] net: macb: convert to volatile accesses Steffen Trumtrar
2023-11-29 6:31 ` Ahmad Fatoum [this message]
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=f6fba7e0-864f-4fb9-aa34-5cea250325a8@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=s.trumtrar@pengutronix.de \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox