All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Tomasz Figa <tfiga@chromium.org>
Cc: Christoph Hellwig <hch@lst.de>,
	"open list:IOMMU DRIVERS" <iommu@lists.linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Joerg Roedel <joro@8bytes.org>, Will Deacon <will.deacon@arm.com>,
	Vineet Gupta <vgupta@synopsys.com>,
	Hans-Christian Noren Egtvedt <egtvedt@samfundet.no>,
	Mitchel Humpherys <mitchelh@codeaurora.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Hans Verkuil <hverkuil@xs4all.nl>,
	Sakari Ailus <sakari.ailus@iki.fi>,
	Pawel Osciak <posciak@chromium.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: [RFC PATCH 1/5] base: dma-mapping: Export commonly used symbols
Date: Thu, 6 Jul 2017 15:56:26 +0200	[thread overview]
Message-ID: <CAK8P3a2HS4O9fr2iWK6SjuZ7eiUL37y4SegsLGrf=z6DHtUb2w@mail.gmail.com> (raw)
In-Reply-To: <CAAFQd5DS1NxKh4OJ52T2AJNTHg6K2fnuDm5-GHzmUk-kjowf2w@mail.gmail.com>

On Thu, Jul 6, 2017 at 3:31 PM, Tomasz Figa <tfiga@chromium.org> wrote:
> On Thu, Jul 6, 2017 at 9:23 PM, Arnd Bergmann <arnd@arndb.de> wrote:
>> On Thu, Jul 6, 2017 at 10:36 AM, Tomasz Figa <tfiga@chromium.org> wrote:
>>> On Thu, Jul 6, 2017 at 5:34 PM, Tomasz Figa <tfiga@chromium.org> wrote:
>>>
>>> Sorry, I intended to mean:
>>>
>>> IMHO re-implementing the code that's already there in videobuf2 again
>>> in the driver, only because, for no good reason mentioned as for now,
>>> having a loadable module providing DMA ops was disliked, would make no
>>> sense.
>>
>> Why would we need to duplicate that code? I would expect that the videobuf2
>> core can simply call the regular dma_mapping interfaces, and you handle the
>> IOPTE generation at the point when the buffer is handed off from the core
>> code to the device driver. Am I missing something?
>
> Well, for example, the iommu-dma helpers already implement all the
> IOVA management, SG iterations, IOMMU API calls, sanity checks and so
> on. There is a significant amount of common code.
>
> On the other hand, if it's strictly about base/dma-mapping, we might
> not need it indeed. The driver could call iommu-dma helpers directly,
> without the need to provide its own DMA ops.

Yes, that's what I meant: if using the IOMMU interface helps, I don't
see anything wrong with that, but using the iommu based
dma_map_ops seems like it may introduce more problems than
it solves.

        Arnd

WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
To: Tomasz Figa <tfiga-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Cc: Linux Media Mailing List
	<linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Greg Kroah-Hartman
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
	Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Krzysztof Kozlowski
	<krzk-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Hans Verkuil <hverkuil-qWit8jRvyhVmR6Xm/wNWPw@public.gmane.org>,
	"open list:IOMMU DRIVERS"
	<iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>,
	Sakari Ailus <sakari.ailus-X3B1VOXEql0@public.gmane.org>,
	Laurent Pinchart
	<laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>,
	Vineet Gupta <vgupta-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>,
	Hans-Christian Noren Egtvedt
	<egtvedt-BrfabpQBY5qlHtIdYg32fQ@public.gmane.org>,
	Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>,
	Pawel Osciak <posciak-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Subject: Re: [RFC PATCH 1/5] base: dma-mapping: Export commonly used symbols
Date: Thu, 6 Jul 2017 15:56:26 +0200	[thread overview]
Message-ID: <CAK8P3a2HS4O9fr2iWK6SjuZ7eiUL37y4SegsLGrf=z6DHtUb2w@mail.gmail.com> (raw)
In-Reply-To: <CAAFQd5DS1NxKh4OJ52T2AJNTHg6K2fnuDm5-GHzmUk-kjowf2w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Thu, Jul 6, 2017 at 3:31 PM, Tomasz Figa <tfiga-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> wrote:
> On Thu, Jul 6, 2017 at 9:23 PM, Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org> wrote:
>> On Thu, Jul 6, 2017 at 10:36 AM, Tomasz Figa <tfiga-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> wrote:
>>> On Thu, Jul 6, 2017 at 5:34 PM, Tomasz Figa <tfiga-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> wrote:
>>>
>>> Sorry, I intended to mean:
>>>
>>> IMHO re-implementing the code that's already there in videobuf2 again
>>> in the driver, only because, for no good reason mentioned as for now,
>>> having a loadable module providing DMA ops was disliked, would make no
>>> sense.
>>
>> Why would we need to duplicate that code? I would expect that the videobuf2
>> core can simply call the regular dma_mapping interfaces, and you handle the
>> IOPTE generation at the point when the buffer is handed off from the core
>> code to the device driver. Am I missing something?
>
> Well, for example, the iommu-dma helpers already implement all the
> IOVA management, SG iterations, IOMMU API calls, sanity checks and so
> on. There is a significant amount of common code.
>
> On the other hand, if it's strictly about base/dma-mapping, we might
> not need it indeed. The driver could call iommu-dma helpers directly,
> without the need to provide its own DMA ops.

Yes, that's what I meant: if using the IOMMU interface helps, I don't
see anything wrong with that, but using the iommu based
dma_map_ops seems like it may introduce more problems than
it solves.

        Arnd

  parent reply	other threads:[~2017-07-06 13:56 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-05  7:12 [RFC PATCH 0/5] Fixes for loadable modules implementing DMA/IOMMU APIs Tomasz Figa
2017-07-05  7:12 ` [RFC PATCH 1/5] base: dma-mapping: Export commonly used symbols Tomasz Figa
2017-07-05  7:12   ` Tomasz Figa
2017-07-05 15:17   ` Christoph Hellwig
2017-07-05 15:17     ` Christoph Hellwig
2017-07-05 15:22     ` Tomasz Figa
2017-07-05 15:22       ` Tomasz Figa
2017-07-05 17:20       ` Christoph Hellwig
2017-07-05 17:20         ` Christoph Hellwig
2017-07-06  1:44         ` Tomasz Figa
2017-07-06  1:44           ` Tomasz Figa
2017-07-06  8:26           ` Arnd Bergmann
2017-07-06  8:26             ` Arnd Bergmann
2017-07-06  8:34             ` Tomasz Figa
2017-07-06  8:34               ` Tomasz Figa
2017-07-06  8:36               ` Tomasz Figa
2017-07-06 12:23                 ` Arnd Bergmann
2017-07-06 12:23                   ` Arnd Bergmann
2017-07-06 13:31                   ` Tomasz Figa
2017-07-06 13:31                     ` Tomasz Figa
2017-07-06 13:49                     ` Tomasz Figa
2017-07-06 14:02                       ` Arnd Bergmann
2017-07-06 14:02                         ` Arnd Bergmann
2017-07-06 14:06                         ` Tomasz Figa
2017-07-06 14:27                           ` Arnd Bergmann
2017-07-06 14:27                             ` Arnd Bergmann
2017-07-06 14:35                             ` Tomasz Figa
2017-07-06 13:56                     ` Arnd Bergmann [this message]
2017-07-06 13:56                       ` Arnd Bergmann
2017-07-05  7:12 ` [RFC PATCH 2/5] base: dma-mapping: Provide a function to look up remapped pages Tomasz Figa
2017-07-05  7:12   ` Tomasz Figa
2017-07-05  7:12 ` [RFC PATCH 3/5] iommu: Export non-static functions to use in modules Tomasz Figa
2017-07-05  7:12   ` Tomasz Figa
2017-07-05  7:12 ` [RFC PATCH 4/5] iommu/dma: " Tomasz Figa
2017-07-05  7:12   ` Tomasz Figa
2017-07-05 16:22   ` Robin Murphy
2017-07-05 16:22     ` Robin Murphy
2017-07-06  2:25     ` Tomasz Figa
2017-07-06  2:25       ` Tomasz Figa
2017-07-06 11:09       ` Robin Murphy
2017-07-06 11:09         ` Robin Murphy
2017-07-06 14:10         ` Christoph Hellwig
2017-07-06 14:10           ` Christoph Hellwig
2017-07-06 14:17           ` Tomasz Figa
2017-07-06 14:24             ` Tomasz Figa
2017-07-06 14:24               ` Tomasz Figa
2017-07-06 14:35               ` Arnd Bergmann
2017-07-06 14:41                 ` Tomasz Figa
2017-07-05  7:12 ` [RFC PATCH 5/5] iommu/dma: Add iommu_dma_cleanup() Tomasz Figa
2017-07-05  7:12   ` Tomasz Figa

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='CAK8P3a2HS4O9fr2iWK6SjuZ7eiUL37y4SegsLGrf=z6DHtUb2w@mail.gmail.com' \
    --to=arnd@arndb.de \
    --cc=egtvedt@samfundet.no \
    --cc=gregkh@linuxfoundation.org \
    --cc=hch@lst.de \
    --cc=hverkuil@xs4all.nl \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=krzk@kernel.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mitchelh@codeaurora.org \
    --cc=posciak@chromium.org \
    --cc=robin.murphy@arm.com \
    --cc=sakari.ailus@iki.fi \
    --cc=tfiga@chromium.org \
    --cc=vgupta@synopsys.com \
    --cc=will.deacon@arm.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.