Re: [Bug 1412] Copy from USB1 CF/SM reader stalls, no actual content is read (only directory structure)

From: Jens Axboe (axboe_at_suse.de)
Date: 11/07/03

  • Next message: Jean Delvare: "Re: I2C parallel port adapters drivers"
    Date:	Fri, 7 Nov 2003 22:22:19 +0100
    To: Alan Stern <stern@rowland.harvard.edu>
    
    

    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
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Jean Delvare: "Re: I2C parallel port adapters drivers"

    Relevant Pages

    • Re: [Bug 1412] Copy from USB1 CF/SM reader stalls, no actual content is read (only directory structu
      ... > are by no means highmem ready, it's easier just to set your dma mask low ... depends on the capabilities of the USB host controller that our device ... and if the result is 0 then calling kmap() ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: DRIVER_IRQL_NOT_LESS_OR_EQUAL
      ... Memory referenced. ... Stop 0xD1 messages can occur after installing faulty drivers or system ... For more information about Stop 0xD1 messages, see the Microsoft Knowledge ... > IRQ 21 Standard OpenHCD USB Host Controller ...
      (microsoft.public.windowsxp.help_and_support)
    • Re: 2.6.10-rc2 on VAIO laptop and PowerMac 8500/G3
      ... fbdev layer broke some of those old drivers. ... VT mode data structure, the driver is now sort-of supposed to re-invent ... but I suppose I'll have to fix controlfb (and platinumfb ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • RE: Driver Model 2 Proposal - Linux Kernel Performance v Usability
      ... I agree that it is an extra interface ... > Windows has many faults but drivers are often compatible across ... common users in the Windows world can't handle installing a driver any better than they would be able to in Linux. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: HighPoint 374
      ... > I'm using two seagates, one Samsung and one Maxtor, ... > drivers, pretty much everything that does not relate directly to the IDE ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)