From: Jens Axboe <axboe@suse.de>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Nicolas Mailhot <Nicolas.Mailhot@laPoste.net>,
USB development list <linux-usb-devel@lists.sourceforge.net>,
linux-kernel@vger.kernel.org
Subject: Re: [Bug 1412] Copy from USB1 CF/SM reader stalls, no actual content is read (only directory structure)
Date: Fri, 7 Nov 2003 22:22:19 +0100 [thread overview]
Message-ID: <20031107212219.GB14728@suse.de> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0311071039470.786-100000@ida.rowland.org>
On Fri, Nov 07 2003, Alan Stern wrote:
> On Fri, 7 Nov 2003, Jens Axboe wrote:
>
> > I've lost the original mail in the thread, but I'm quite sure it listed
> > sg[0].page as being valid. Maybe the driver cleared it somewhere too
> > early? page_address() will not have returned NULL for a valid page.
> > Unless it's a highmem page, in that case you have to map it and unmap
> > after use. For drivers like this that aren't performance critical and
> > are by no means highmem ready, it's easier just to set your dma mask low
> > enough that you wont be handed such pages.
>
> I think you may have put your finger on the problem. Our difficulty is
> that we have no control over where these sg pages are allocated; that
> depends on the capabilities of the USB host controller that our device
> happens to be plugged into. Probably all the spots in the usb-storage
> driver that directly access those sg pages will have to be rewritten to
> take into account that they may not be located in mapped memory.
>
> So I will need to learn the proper way of doing that. Is it as simple as
> calling page_address(), and if the result is 0 then calling kmap()
> followed by kunmap()?
Forget page_address(), you should never use it. _Always_ kmap the page
(or kmap_atomic() in irq context) and it will do the right thing
regardless.
--
Jens Axboe
next prev parent reply other threads:[~2003-11-07 22:33 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1067633171.3886.1.camel@m70.net81-64-235.noos.fr>
2003-11-01 15:47 ` [Bug 1412] Copy from USB1 CF/SM reader stalls, no actual content is read (only directory structure) Alan Stern
2003-11-04 7:49 ` Jens Axboe
2003-11-04 17:33 ` Alan Stern
2003-11-05 8:40 ` Jens Axboe
2003-11-05 15:47 ` Alan Stern
2003-11-07 8:24 ` Jens Axboe
2003-11-07 8:50 ` Nicolas Mailhot
2003-11-07 9:09 ` Jens Axboe
2003-11-07 9:25 ` Nicolas Mailhot
2003-11-07 21:02 ` Nicolas Mailhot
2003-11-07 21:03 ` Nicolas Mailhot
2003-11-07 21:22 ` Jens Axboe
2003-11-07 15:48 ` Alan Stern
2003-11-07 21:22 ` Jens Axboe [this message]
2003-11-07 18:56 ` [linux-usb-devel] " David Brownell
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=20031107212219.GB14728@suse.de \
--to=axboe@suse.de \
--cc=Nicolas.Mailhot@laPoste.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb-devel@lists.sourceforge.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).