linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH] USB: OHCI: ohci-sm501: complete URBs in BH context
Date: Mon, 6 Aug 2018 10:33:22 +0200	[thread overview]
Message-ID: <20180806083322.GA31637@lst.de> (raw)
In-Reply-To: <55fffb30-1388-af6a-70a6-cb738dab062f@roeck-us.net>

On Sun, Aug 05, 2018 at 02:38:22PM -0700, Guenter Roeck wrote:
> AFAICS it used to be interrupt tolerant for all but x86 up to commit
> 6894258eda ("dma-mapping: consolidate dma_{alloc,free}_{attrs,coherent}").
> A quick test shows that the warning is indeed not seen if I run my test
> on v3.18.y.
>
> You would have to ask Christoph why it is now interrupt-intolerant for all
> architectures.

interrupt-tolerant actually is a very odd wording.  x86 itself (at least
unless using an iommu) actually is fine with calling dma_free_* with
interrupts disabled, but many other architectures are not.  For many
architectures that are not cache coherent we'll have to manipulale
the kernel page tables when freeing coherent memory, which we absolutely
can't do from irq context.  And as usual in the kernel we try to enforce
the same rules on everyone to allow for portable code.

Also except for the odd USB use cases that abuses dma_alloc_coherent
for the bounce buffers in device local memory you are doing something
wrong if you call dma_alloc*/dma_free* anywhere but during device
initialization and removal.  These are slow path interfaces for
allocating memory for things like descriptors and similar.  Your fast
path should be using dma_map*/dma_unmap*.

  reply	other threads:[~2018-08-06  8:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-04  4:01 [PATCH] USB: OHCI: ohci-sm501: complete URBs in BH context Guenter Roeck
2018-08-04 14:50 ` Alan Stern
2018-08-04 19:19   ` Guenter Roeck
2018-08-05 18:31     ` Alan Stern
2018-08-05 21:38       ` Guenter Roeck
2018-08-06  8:33         ` Christoph Hellwig [this message]
2018-08-06 15:58           ` Guenter Roeck
2018-08-06  8:37 ` Christoph Hellwig
2018-08-06 16:03   ` Guenter Roeck
2018-08-07  7:25     ` 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=20180806083322.GA31637@lst.de \
    --to=hch@lst.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).