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 ------------------------------------------------------- This SF.Net email sponsored by: ApacheCon 2003, 16-19 November in Las Vegas. Learn firsthand the latest developments in Apache, PHP, Perl, XML, Java, MySQL, WebDAV, and more! http://www.apachecon.com/ _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
