linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Christoph Hellwig <hch@infradead.org>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] USB: OHCI: ohci-sm501: complete URBs in BH context
Date: Mon, 6 Aug 2018 09:03:35 -0700	[thread overview]
Message-ID: <cbbcbe2c-28c6-faa1-4ef4-8e59c486e2a4@roeck-us.net> (raw)
In-Reply-To: <20180806083730.GA32650@infradead.org>

On 08/06/2018 01:37 AM, Christoph Hellwig wrote:
> On Fri, Aug 03, 2018 at 09:01:19PM -0700, Guenter Roeck wrote:
>> Testing an USB drive connected to ohci-sm501 results in a large number
>> of runtime warnings.
> 
> As far as I can tell this driver uses the HCD_LOCAL_MEM feature flag
> for memory declared using dma_declare_coherent_memory.  Unlike the
> mormal dma mapping interfaces this special case can actually be freed
> from interrupt context, and we have a fix for this warning queued
> up in linux-next:
> 
> http://git.infradead.org/users/hch/dma-mapping.git/commitdiff/d27fb99f62af7b79c542d161aa5155ed57271ddc
> 
> That being said I'm generally very unhappy how dma_init_coherent_memory
> turned out.  The idea was to allow device local memory to be hidden
> behind the DMA API, but in general we use it either as a way to declare
> special uncache system memory (which would really be the plaform codes
> job), or as a magic bounce buffer like in the USB code.  I plan to
> eventually untangle this, but it is going to take some time.
> 

Yes, I can confirm that the warning is gone in -next. Problem solved,
except of course there are still the warnings about the missing
coherent_dma_mask.

sm501-usb sm501-usb: SM501 OHCI
sm501-usb sm501-usb: new USB bus registered, assigned bus number 1
WARNING: CPU: 0 PID: 1 at ./include/linux/dma-mapping.h:516 ohci_init+0x194/0x2d8

Is that warning also not warranted for the given use case, or is
the missing mask indeed necessary ? It is easy to add - see
https://lore.kernel.org/patchwork/patch/971411/ - but I do wonder
if that change is appropriate.

Thanks,
Guenter

  reply	other threads:[~2018-08-06 16:03 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
2018-08-06 15:58           ` Guenter Roeck
2018-08-06  8:37 ` Christoph Hellwig
2018-08-06 16:03   ` Guenter Roeck [this message]
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=cbbcbe2c-28c6-faa1-4ef4-8e59c486e2a4@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --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).