Take the tour ×  here's my current scenario:  I'm currently
writing a block driver for some scsi block device. My setup uses
a 32-bit kernel 2.6.35. When copying files to my device, I'm
seeing scatterlists being sent from high memory (dma address are
higher, virt address non-existent, etc.) These buffers are meant
to be copied via memcpy to another buffer in memory prior to
dma, and so I needed virt addresses for those in high memory. I
used kmap_atomic to the sgl to get virtual address, did the
memcpy, and then kunmap_atomic those previous mappings.
Everything's ok so far until I hit a bug: unable to handle
kernel paging request at 0xfff34000.  I was logging the
scatterlist (let's call this variable sg) values sg dma_address
0x67891c00 sg page_link 0xc1cf2222 sg offset 0xc00 sg len 0x800
size 0x800  The mem location to transfer the buff contents baddr
0xf1270000  after I did kmap_atomic, I got a virt address vaddr
0xfff33c00  then proceed to memcpy  memcpy(baddr, vaddr, size);
This is where the bug appeared