From: John Garry <john.g.garry@oracle.com>
To: Robin Murphy <robin.murphy@arm.com>,
Ulf Hansson <ulf.hansson@oss.qualcomm.com>
Cc: ulfh@kernel.org, florian.fainelli@broadcom.com,
rjui@broadcom.com, sbranden@broadcom.com,
bcm-kernel-feedback-list@broadcom.com, linux-mmc@vger.kernel.org,
hch@lst.de, martin.petersen@oracle.com,
linux-rpi-kernel@lists.infradead.org
Subject: Re: [PATCH] mmc: bcm2835: DMA mapping improvements
Date: Mon, 13 Jul 2026 13:37:07 +0100 [thread overview]
Message-ID: <2d1de9f0-c351-45cc-8b49-37780ab94106@oracle.com> (raw)
In-Reply-To: <ba056712-027b-4996-9b15-8f70d630ff2c@arm.com>
On 13/07/2026 13:19, Robin Murphy wrote:
> On 13/07/2026 12:25 pm, Ulf Hansson wrote:
> [...]
>>> @@ -1281,10 +1279,8 @@ static int bcm2835_add_host(struct
>>> bcm2835_host *host)
>>>
>>> if (!host->dma_chan_rxtx) {
>>> dev_warn(dev, "unable to initialise DMA channel.
>>> Falling back to PIO\n");
>>> - host->use_dma = false;
>>> + host->dma_dev = NULL;
>>> } else {
>>> - host->use_dma = true;
>>> -
>>> host->dma_cfg_tx.src_addr_width =
>>> DMA_SLAVE_BUSWIDTH_4_BYTES;
>>> host->dma_cfg_tx.dst_addr_width =
>>> DMA_SLAVE_BUSWIDTH_4_BYTES;
>>> host->dma_cfg_tx.direction = DMA_MEM_TO_DEV;
>>> @@ -1300,12 +1296,18 @@ static int bcm2835_add_host(struct
>>> bcm2835_host *host)
>>> if (dmaengine_slave_config(host->dma_chan_rxtx,
>>> &host->dma_cfg_tx) != 0 ||
>>> dmaengine_slave_config(host->dma_chan_rxtx,
>>> - &host->dma_cfg_rx) != 0)
>>> - host->use_dma = false;
>>> + &host->dma_cfg_rx) != 0) {
>
> Hang on, doesn't this whole if condition need to be inverted? It's true
> upon dma config _failure_, thanks to the original use_dma logic being a
> bit backwards here.
Ah, yes, my mistake. It should be:
if (!dmaengine_slave_config(..., &host->dma_cfg_tx) &&
!dmaengine_slave_config(..., &host->dma_cfg_rx))
dma_dev =
And I don't think that the first dmaengine_slave_config() needs to be
undone in case of failure for the second call.
Ulf, how to handle a fix? should I send an update on top of this patch?
thanks
next prev parent reply other threads:[~2026-07-13 12:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-06 7:39 [PATCH] mmc: bcm2835: DMA mapping improvements John Garry
2026-07-13 11:25 ` Ulf Hansson
2026-07-13 12:19 ` Robin Murphy
2026-07-13 12:37 ` John Garry [this message]
2026-07-13 13:07 ` Ulf Hansson
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=2d1de9f0-c351-45cc-8b49-37780ab94106@oracle.com \
--to=john.g.garry@oracle.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=florian.fainelli@broadcom.com \
--cc=hch@lst.de \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=martin.petersen@oracle.com \
--cc=rjui@broadcom.com \
--cc=robin.murphy@arm.com \
--cc=sbranden@broadcom.com \
--cc=ulf.hansson@oss.qualcomm.com \
--cc=ulfh@kernel.org \
/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