From: Robin Murphy <robin.murphy@arm.com>
To: Enric Balletbo i Serra <eballetb@redhat.com>,
Vinod Koul <vkoul@kernel.org>
Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, u-kumar1@ti.com,
vigneshr@ti.com, nm@ti.com
Subject: Re: [PATCH] dmaengine: dma_request_chan_by_mask() defer probing unconditionally
Date: Fri, 29 Nov 2024 16:44:36 +0000 [thread overview]
Message-ID: <4dd1caa7-4b95-4e06-a5ac-e2d33ce88d04@arm.com> (raw)
In-Reply-To: <20241127-defer-dma-request-chan-v1-1-203db7baf470@redhat.com>
On 2024-11-27 8:23 am, Enric Balletbo i Serra wrote:
> Having no DMA devices registered is not a guarantee that the device
> doesn't exist, it could be that is not registered yet, so return
> EPROBE_DEFER unconditionally so the caller can wait for the required
> DMA device registered.
>
> Signed-off-by: Enric Balletbo i Serra <eballetb@redhat.com>
> ---
> This patch fixes the following error on TI AM69-SK
>
> [ 2.854501] cadence-qspi 47040000.spi: error -ENODEV: No Rx DMA available
>
> The DMA device is probed after cadence-qspi driver, so deferring it
> solves the problem.
Conversely, though, it does carry some risk that if there really is no
DMA device/driver, other callers (e.g. spi-ti-qspi) may now get stuck
deferring forever where the -ENODEV would have let them proceed with a
fallback to non-DMA operation. driver_deferred_probe_check_state() is
typically a good tool for these situations, but I guess it's a bit
tricky in a context where we don't actually have the dependent device to
hand :/
Thanks,
Robin.
> ---
> drivers/dma/dmaengine.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
> index c1357d7f3dc6ca7899c4d68a039567e73b0f089d..57f07b477a5d9ad8f2656584b8c0d6dffb2ab469 100644
> --- a/drivers/dma/dmaengine.c
> +++ b/drivers/dma/dmaengine.c
> @@ -889,10 +889,10 @@ struct dma_chan *dma_request_chan_by_mask(const dma_cap_mask_t *mask)
> chan = __dma_request_channel(mask, NULL, NULL, NULL);
> if (!chan) {
> mutex_lock(&dma_list_mutex);
> - if (list_empty(&dma_device_list))
> - chan = ERR_PTR(-EPROBE_DEFER);
> - else
> - chan = ERR_PTR(-ENODEV);
> + /* If the required DMA device is not registered yet,
> + * return EPROBE_DEFER
> + */
> + chan = ERR_PTR(-EPROBE_DEFER);
> mutex_unlock(&dma_list_mutex);
> }
>
>
> ---
> base-commit: 43fb83c17ba2d63dfb798f0be7453ed55ca3f9c2
> change-id: 20241127-defer-dma-request-chan-4f26c62c8691
>
> Best regards,
next prev parent reply other threads:[~2024-11-29 16:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-27 8:23 [PATCH] dmaengine: dma_request_chan_by_mask() defer probing unconditionally Enric Balletbo i Serra
2024-11-29 16:44 ` Robin Murphy [this message]
2024-12-03 4:34 ` Vignesh Raghavendra
2024-12-03 12:35 ` Enric Balletbo i Serra
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=4dd1caa7-4b95-4e06-a5ac-e2d33ce88d04@arm.com \
--to=robin.murphy@arm.com \
--cc=dmaengine@vger.kernel.org \
--cc=eballetb@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nm@ti.com \
--cc=u-kumar1@ti.com \
--cc=vigneshr@ti.com \
--cc=vkoul@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