From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>, Christoph Hellwig <hch@lst.de>
Cc: airlied@linux.ie, "H. Nikolaus Schaller" <hns@goldelico.com>,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
Tony Lindgren <tony@atomide.com>
Subject: Re: [PATCH for-5.3] drm/omap: ensure we have a valid dma_mask
Date: Mon, 12 Aug 2019 08:56:16 +0300 [thread overview]
Message-ID: <b5961703-6e6f-5183-206b-d792017beb96@ti.com> (raw)
In-Reply-To: <c219e7e6-0f66-d6fd-e0cf-59c803386825@ti.com>
On 09/08/2019 13.00, Tomi Valkeinen wrote:
> Here's my version.
>
> From c258309e36fc86076db155aead03a3900b96c3d4 Mon Sep 17 00:00:00 2001
> From: Tomi Valkeinen <tomi.valkeinen@ti.com>
> Date: Fri, 9 Aug 2019 09:54:49 +0300
> Subject: [PATCH] drm/omap: ensure we have a valid dma_mask
>
> The omapdrm driver uses dma_set_coherent_mask(), but that's not enough
> anymore when LPAE is enabled.
>
> From Christoph Hellwig <hch@lst.de>:
>
> The traditional arm DMA code ignores, but the generic dma-direct/swiotlb
> has stricter checks and thus fails mappings without a DMA mask. As we
> use swiotlb for arm with LPAE now, omapdrm needs to catch up and
> actually set a DMA mask.
>
> Change the dma_set_coherent_mask() call to
> dma_coerce_mask_and_coherent() so that the dev->dma_mask is also set.
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> Fixes: ad3c7b18c5b3 ("arm: use swiotlb for bounce buffering on LPAE configs")
> Reported-by: "H. Nikolaus Schaller" <hns@goldelico.com>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
>
> diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
> index 288c59dae56a..1bad0a2cc5c6 100644
> --- a/drivers/gpu/drm/omapdrm/omap_drv.c
> +++ b/drivers/gpu/drm/omapdrm/omap_drv.c
> @@ -669,7 +669,7 @@ static int pdev_probe(struct platform_device *pdev)
> if (omapdss_is_initialized() == false)
> return -EPROBE_DEFER;
>
> - ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
> + ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
> if (ret) {
> dev_err(&pdev->dev, "Failed to set the DMA mask\n");
> return ret;
>
>
>
>
- Péter
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
prev parent reply other threads:[~2019-08-12 5:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-08 10:10 [PATCH for-5.3] drm/omap: ensure we have a valid dma_mask Christoph Hellwig
2019-08-09 6:40 ` Tomi Valkeinen
2019-08-09 8:07 ` Christoph Hellwig
2019-08-09 10:00 ` Tomi Valkeinen
2019-08-09 14:31 ` Christoph Hellwig
2019-08-12 5:56 ` Peter Ujfalusi [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=b5961703-6e6f-5183-206b-d792017beb96@ti.com \
--to=peter.ujfalusi@ti.com \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=hch@lst.de \
--cc=hns@goldelico.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tomi.valkeinen@ti.com \
--cc=tony@atomide.com \
/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