From: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
To: Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org>
Cc: noring-zgYzP9v7iJcdnm+yROfE0A@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
JuergenUrban-Mmb7MZpHnFY@public.gmane.org,
hch-jcswGhMUV9g@public.gmane.org
Subject: Re: [PATCH] dma-mapping: Relax warnings for per-device areas
Date: Thu, 5 Jul 2018 21:36:13 +0200 [thread overview]
Message-ID: <20180705193613.GA28905@lst.de> (raw)
In-Reply-To: <1f8262d206c6886072d04cc93454f6e3f812bd20.1530623284.git.robin.murphy-5wv7dgnIgG8@public.gmane.org>
> - BUG_ON(!ops);
> - WARN_ON_ONCE(dev && !dev->coherent_dma_mask);
> -
> if (dma_alloc_from_dev_coherent(dev, size, dma_handle, &cpu_addr))
> return cpu_addr;
>
> + BUG_ON(!ops);
> + WARN_ON_ONCE(dev && !dev->coherent_dma_mask);
I think doing dma on a device without ops is completely broken no matter
what you think of it, so I very much disagree with that part of the change.
Also while I don't think not having a dma mask is a good idea even for
a driver purely using dma coherent pools. If the pools really are on
the device itself I can see why it might not matter, but for the case
commonly used on some ARM SOCs where we just reserve memory for certain
devices from a system pool it very much does matter.
There really is no good excuse to not set a coherent mask in the drivers.
WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Robin Murphy <robin.murphy@arm.com>
Cc: hch@lst.de, m.szyprowski@samsung.com,
iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org,
noring@nocrew.org, JuergenUrban@gmx.de
Subject: Re: [PATCH] dma-mapping: Relax warnings for per-device areas
Date: Thu, 5 Jul 2018 21:36:13 +0200 [thread overview]
Message-ID: <20180705193613.GA28905@lst.de> (raw)
In-Reply-To: <1f8262d206c6886072d04cc93454f6e3f812bd20.1530623284.git.robin.murphy@arm.com>
> - BUG_ON(!ops);
> - WARN_ON_ONCE(dev && !dev->coherent_dma_mask);
> -
> if (dma_alloc_from_dev_coherent(dev, size, dma_handle, &cpu_addr))
> return cpu_addr;
>
> + BUG_ON(!ops);
> + WARN_ON_ONCE(dev && !dev->coherent_dma_mask);
I think doing dma on a device without ops is completely broken no matter
what you think of it, so I very much disagree with that part of the change.
Also while I don't think not having a dma mask is a good idea even for
a driver purely using dma coherent pools. If the pools really are on
the device itself I can see why it might not matter, but for the case
commonly used on some ARM SOCs where we just reserve memory for certain
devices from a system pool it very much does matter.
There really is no good excuse to not set a coherent mask in the drivers.
next prev parent reply other threads:[~2018-07-05 19:36 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-03 13:08 [PATCH] dma-mapping: Relax warnings for per-device areas Robin Murphy
2018-07-03 13:08 ` Robin Murphy
[not found] ` <1f8262d206c6886072d04cc93454f6e3f812bd20.1530623284.git.robin.murphy-5wv7dgnIgG8@public.gmane.org>
2018-07-03 16:47 ` Fredrik Noring
2018-07-03 16:47 ` Fredrik Noring
2018-07-05 19:36 ` Christoph Hellwig [this message]
2018-07-05 19:36 ` Christoph Hellwig
[not found] ` <20180705193613.GA28905-jcswGhMUV9g@public.gmane.org>
2018-07-06 11:57 ` Robin Murphy
2018-07-06 11:57 ` Robin Murphy
[not found] ` <5811ebe5-b2bd-efc1-bf54-a8f05432c4f8-5wv7dgnIgG8@public.gmane.org>
2018-07-06 14:19 ` Fredrik Noring
2018-07-06 14:19 ` Fredrik Noring
[not found] ` <20180706141926.GA2313-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2018-07-06 16:46 ` Robin Murphy
2018-07-06 16:46 ` Robin Murphy
[not found] ` <bd63815c-260e-078f-4184-561c8e54e636-5wv7dgnIgG8@public.gmane.org>
2018-07-06 20:54 ` Fredrik Noring
2018-07-06 20:54 ` Fredrik Noring
2018-07-06 23:35 ` Aw: " "Jürgen Urban"
2018-07-06 23:35 ` "Jürgen Urban"
2018-07-07 6:32 ` Fredrik Noring
2018-07-07 6:32 ` Fredrik Noring
2018-07-08 20:47 ` Aw: " "Jürgen Urban"
2018-07-15 12:28 ` Fredrik Noring
2018-07-15 12:28 ` Fredrik Noring
2018-07-17 14:57 ` Christoph Hellwig
2018-07-17 16:33 ` Fredrik Noring
2018-07-18 21:55 ` Geoff Levand
2018-07-19 13:16 ` Christoph Hellwig
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=20180705193613.GA28905@lst.de \
--to=hch-jcswghmuv9g@public.gmane.org \
--cc=JuergenUrban-Mmb7MZpHnFY@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=noring-zgYzP9v7iJcdnm+yROfE0A@public.gmane.org \
--cc=robin.murphy-5wv7dgnIgG8@public.gmane.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 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.