All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomasz Figa <tfiga@chromium.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: Ezequiel Garcia <ezequiel@collabora.com>,
	Linux Media Mailing List <linux-media@vger.kernel.org>,
	linux-usb@vger.kernel.org,
	"list@263.net:IOMMU DRIVERS <iommu@lists.linux-foundation.org>,
	Joerg Roedel <joro@8bytes.org>,"
	<linux-arm-kernel@lists.infradead.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	"Matwey V. Kornilov" <matwey@sai.msu.ru>,
	Alan Stern <stern@rowland.harvard.edu>,
	kernel@collabora.com, keiichiw@chromium.org
Subject: Re: [RFC 2/3] USB: core: Add non-coherent buffer allocation helpers
Date: Wed, 31 Oct 2018 10:55:23 +0900	[thread overview]
Message-ID: <CAAFQd5BjGkJf-Yz3ixiCjCaoeQJKKXbF41JyEvrm1DQ6uNnBrQ@mail.gmail.com> (raw)
In-Reply-To: <CAAFQd5DhFr8ywjc41oK9q+zZXH9zsOKh_7DxWmjzcE0+5Q3hGA@mail.gmail.com>

Hi Christoph and everyone,

On Fri, Aug 31, 2018 at 3:51 PM Tomasz Figa <tfiga@chromium.org> wrote:
>
> On Fri, Aug 31, 2018 at 2:50 PM Christoph Hellwig <hch@infradead.org> wrote:
> >
> > On Thu, Aug 30, 2018 at 07:11:35PM -0300, Ezequiel Garcia wrote:
> > > On Thu, 2018-08-30 at 10:58 -0700, Christoph Hellwig wrote:
> > > > Please don't introduce new DMA_ATTR_NON_CONSISTENT users, it is
> > > > a rather horrible interface, and I plan to kill it off rather sooner
> > > > than later.  I plan to post some patches for a better interface
> > > > that can reuse the normal dma_sync_single_* interfaces for ownership
> > > > transfers.  I can happily include usb in that initial patch set based
> > > > on your work here if that helps.
> > >
> > > Please do. Until we have proper allocators that go thru the DMA API,
> > > drivers will have to kmalloc the USB transfer buffers, and have
> > > streaming mappings. Which in turns mean not using IOMMU or CMA.
> >
> > dma_map_page will of course use the iommu.
>
> Sure, dma_map*() will, but using kmalloc() defeats (half of) the
> purpose of it, since contiguous memory would be allocated
> unnecessarily, risking failures due to fragmentation.

Have we reached a conclusion here?

It sounds like it's a quite significant problem, at least for some of
the camera (media) devices over there and there are people interested
in solving it, so all we need here is a conclusion on how to do it. :)

Best regards,
Tomasz

WARNING: multiple messages have this Message-ID (diff)
From: Tomasz Figa <tfiga@chromium.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: Ezequiel Garcia <ezequiel@collabora.com>,
	Linux Media Mailing List <linux-media@vger.kernel.org>,
	linux-usb@vger.kernel.org,
	"list@263.net:IOMMU DRIVERS <iommu@lists.linux-foundation.org>,
	Joerg Roedel <joro@8bytes.org>,"
	<linux-arm-kernel@lists.infradead.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	"Matwey V. Kornilov" <matwey@sai.msu.ru>,
	Alan Stern <stern@rowland.harvard.edu>,
	kernel@collabora.com, keiichiw@chromium.org
Subject: [RFC,2/3] USB: core: Add non-coherent buffer allocation helpers
Date: Wed, 31 Oct 2018 10:55:23 +0900	[thread overview]
Message-ID: <CAAFQd5BjGkJf-Yz3ixiCjCaoeQJKKXbF41JyEvrm1DQ6uNnBrQ@mail.gmail.com> (raw)

Hi Christoph and everyone,

On Fri, Aug 31, 2018 at 3:51 PM Tomasz Figa <tfiga@chromium.org> wrote:
>
> On Fri, Aug 31, 2018 at 2:50 PM Christoph Hellwig <hch@infradead.org> wrote:
> >
> > On Thu, Aug 30, 2018 at 07:11:35PM -0300, Ezequiel Garcia wrote:
> > > On Thu, 2018-08-30 at 10:58 -0700, Christoph Hellwig wrote:
> > > > Please don't introduce new DMA_ATTR_NON_CONSISTENT users, it is
> > > > a rather horrible interface, and I plan to kill it off rather sooner
> > > > than later.  I plan to post some patches for a better interface
> > > > that can reuse the normal dma_sync_single_* interfaces for ownership
> > > > transfers.  I can happily include usb in that initial patch set based
> > > > on your work here if that helps.
> > >
> > > Please do. Until we have proper allocators that go thru the DMA API,
> > > drivers will have to kmalloc the USB transfer buffers, and have
> > > streaming mappings. Which in turns mean not using IOMMU or CMA.
> >
> > dma_map_page will of course use the iommu.
>
> Sure, dma_map*() will, but using kmalloc() defeats (half of) the
> purpose of it, since contiguous memory would be allocated
> unnecessarily, risking failures due to fragmentation.

Have we reached a conclusion here?

It sounds like it's a quite significant problem, at least for some of
the camera (media) devices over there and there are people interested
in solving it, so all we need here is a conclusion on how to do it. :)

Best regards,
Tomasz

WARNING: multiple messages have this Message-ID (diff)
From: tfiga@chromium.org (Tomasz Figa)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC 2/3] USB: core: Add non-coherent buffer allocation helpers
Date: Wed, 31 Oct 2018 10:55:23 +0900	[thread overview]
Message-ID: <CAAFQd5BjGkJf-Yz3ixiCjCaoeQJKKXbF41JyEvrm1DQ6uNnBrQ@mail.gmail.com> (raw)
In-Reply-To: <CAAFQd5DhFr8ywjc41oK9q+zZXH9zsOKh_7DxWmjzcE0+5Q3hGA@mail.gmail.com>

Hi Christoph and everyone,

On Fri, Aug 31, 2018 at 3:51 PM Tomasz Figa <tfiga@chromium.org> wrote:
>
> On Fri, Aug 31, 2018 at 2:50 PM Christoph Hellwig <hch@infradead.org> wrote:
> >
> > On Thu, Aug 30, 2018 at 07:11:35PM -0300, Ezequiel Garcia wrote:
> > > On Thu, 2018-08-30 at 10:58 -0700, Christoph Hellwig wrote:
> > > > Please don't introduce new DMA_ATTR_NON_CONSISTENT users, it is
> > > > a rather horrible interface, and I plan to kill it off rather sooner
> > > > than later.  I plan to post some patches for a better interface
> > > > that can reuse the normal dma_sync_single_* interfaces for ownership
> > > > transfers.  I can happily include usb in that initial patch set based
> > > > on your work here if that helps.
> > >
> > > Please do. Until we have proper allocators that go thru the DMA API,
> > > drivers will have to kmalloc the USB transfer buffers, and have
> > > streaming mappings. Which in turns mean not using IOMMU or CMA.
> >
> > dma_map_page will of course use the iommu.
>
> Sure, dma_map*() will, but using kmalloc() defeats (half of) the
> purpose of it, since contiguous memory would be allocated
> unnecessarily, risking failures due to fragmentation.

Have we reached a conclusion here?

It sounds like it's a quite significant problem, at least for some of
the camera (media) devices over there and there are people interested
in solving it, so all we need here is a conclusion on how to do it. :)

Best regards,
Tomasz

  reply	other threads:[~2018-10-31  1:55 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-30 17:20 [RFC 0/3] Introduce usb_{alloc,free}_noncoherent API Ezequiel Garcia
2018-08-30 17:20 ` Ezequiel Garcia
2018-08-30 17:20 ` [RFC 1/3] HACK: ARM: dma-mapping: Get writeback memory for non-consistent mappings Ezequiel Garcia
2018-08-30 17:20   ` Ezequiel Garcia
2018-08-30 17:20   ` [RFC,1/3] " Ezequiel Garcia
2018-08-30 17:20 ` [RFC 2/3] USB: core: Add non-coherent buffer allocation helpers Ezequiel Garcia
2018-08-30 17:20   ` Ezequiel Garcia
2018-08-30 17:20   ` [RFC,2/3] " Ezequiel Garcia
2018-08-30 17:58   ` [RFC 2/3] " Christoph Hellwig
2018-08-30 17:58     ` Christoph Hellwig
2018-08-30 17:58     ` [RFC,2/3] " Christoph Hellwig
2018-08-30 22:11     ` [RFC 2/3] " Ezequiel Garcia
2018-08-30 22:11       ` Ezequiel Garcia
2018-08-30 22:11       ` [RFC,2/3] " Ezequiel Garcia
2018-08-31  5:50       ` [RFC 2/3] " Christoph Hellwig
2018-08-31  5:50         ` Christoph Hellwig
2018-08-31  5:50         ` [RFC,2/3] " Christoph Hellwig
2018-08-31  6:51         ` [RFC 2/3] " Tomasz Figa
2018-08-31  6:51           ` Tomasz Figa
2018-08-31  6:51           ` [RFC,2/3] " Tomasz Figa
2018-10-31  1:55           ` Tomasz Figa [this message]
2018-10-31  1:55             ` [RFC 2/3] " Tomasz Figa
2018-10-31  1:55             ` [RFC,2/3] " Tomasz Figa
2018-08-30 17:20 ` [RFC 3/3] stk1160: Use non-coherent buffers for USB transfers Ezequiel Garcia
2018-08-30 17:20   ` Ezequiel Garcia
2018-08-30 17:20   ` [RFC,3/3] " Ezequiel Garcia
2018-08-30 17:59   ` [RFC 3/3] " Christoph Hellwig
2018-08-30 17:59     ` Christoph Hellwig
2018-08-30 17:59     ` [RFC,3/3] " Christoph Hellwig
2018-09-07  8:54     ` [RFC 3/3] " Tomasz Figa
2018-09-07  8:54       ` Tomasz Figa
2018-09-07  8:54       ` [RFC,3/3] " 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=CAAFQd5BjGkJf-Yz3ixiCjCaoeQJKKXbF41JyEvrm1DQ6uNnBrQ@mail.gmail.com \
    --to=tfiga@chromium.org \
    --cc=ezequiel@collabora.com \
    --cc=hch@infradead.org \
    --cc=keiichiw@chromium.org \
    --cc=kernel@collabora.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=matwey@sai.msu.ru \
    --cc=stern@rowland.harvard.edu \
    /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.