[lkml]   [2010]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectUSB transfer_buffer allocations on 64bit systems

    I was pointed to by
    Pedro Ribeiro, and unfortunately I'm pretty late in the game. I wasn't
    aware of that thread until yesterday.

    While the report is quite confusing, the reason seams pretty clear to me
    as I've been thru quite some time-demanding debugging of a very similar
    issue on Mac OS X. But I'm not totally sure whether we really hit the
    same issue here, so I'd like to have your opinions first.

    The problem is appearantly the way the transfer buffer is allocated in
    the drivers. In the snd-usb-caiaq driver, I used kzalloc() to get memory
    which works fine on 32bit systems. On x86_64, however, it seems that
    kzalloc() hands out memory beyond the 32bit addressable boundary, which
    the DMA controller of the 32bit PCI-connected EHCI controller is unable
    to write to or read from. Am I correct on this conclusion?

    Depending on the condition of the memory management, things might work
    or not, and especially right after a reboot, there's a better chance to
    get lower memory.

    The fix is to use usb_buffer_alloc() for that purpose which ensures
    memory that is suitable for DMA. And on x86_64, this also means that the
    upper 32 bits of the address returned are all 0's.

    If what I've stated is true, there are quite some more drivers affected
    by this issue. I collected a list of places where similar fixes are
    needed, and I can send patches if I get a thumbs-up.

    Pedro is currently testing a patch I sent out yesterday.


     \ /
      Last update: 2010-04-07 11:09    [W:0.019 / U:115.152 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site