From: Christoph Hellwig <hch@lst.de>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Christoph Hellwig <hch@lst.de>,
airlied@linux.ie, daniel@ffwll.ch,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
"H. Nikolaus Schaller" <hns@goldelico.com>,
Tony Lindgren <tony@atomide.com>,
Peter Ujfalusi <peter.ujfalusi@ti.com>
Subject: Re: [PATCH for-5.3] drm/omap: ensure we have a valid dma_mask
Date: Fri, 9 Aug 2019 10:07:50 +0200 [thread overview]
Message-ID: <20190809080750.GA21874@lst.de> (raw)
In-Reply-To: <7fff8fd3-16ae-1f42-fcd6-9aa360fe36b5@ti.com>
On Fri, Aug 09, 2019 at 09:40:32AM +0300, Tomi Valkeinen wrote:
> We do call dma_set_coherent_mask() in omapdrm's probe() (in omap_drv.c),
> but apparently that's not enough anymore. Changing that call to
> dma_coerce_mask_and_coherent() removes the WARN. I can create a patch for
> that, or Christoph can respin this one.
Oh, yes - that actually is the right thing to do here. If you already
have it please just send it out.
>
> I am not too familiar with the dma mask handling, so maybe someone can
> educate:
>
> dma_coerce_mask_and_coherent() overwrites dev->dma_mask. Isn't that a bad
> thing? What if the platform has set dev->dma_mask, and the driver
> overwrites it with its value? Or who is supposed to set dev->dma_mask?
->dma_mask is a complete mess. It is a pointer when it really should
just be a u64, and that means every driver layer has to allocate space
for it. We don't really do that for platform_devices, as that breaks
horribly assumptions in the usb code. That is why
dma_coerce_mask_and_coherent exists as a nasty workaround that sets
the dma_mask to the coherent_dma_mask for devices that don't have
space for ->dma_mask allocated, which works as long as the device
doesn't have differnet addressing requirements for both.
I'm actually working to fix that mess up at the moment, but it is going
to take a few cycles until everything falls into place.
next prev parent reply other threads:[~2019-08-09 8:07 UTC|newest]
Thread overview: 9+ 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 6:40 ` Tomi Valkeinen
2019-08-09 8:07 ` Christoph Hellwig [this message]
2019-08-09 10:00 ` Tomi Valkeinen
2019-08-09 10:00 ` Tomi Valkeinen
2019-08-09 14:31 ` Christoph Hellwig
2019-08-12 5:56 ` Peter Ujfalusi
2019-08-12 5:56 ` Peter Ujfalusi
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=20190809080750.GA21874@lst.de \
--to=hch@lst.de \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=hns@goldelico.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peter.ujfalusi@ti.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.