Re: Patch added to scsi-rc-fixes-2.6: [SCSI] arcmsr: fix message allocation

Daniel Drake
2008-02-25T10:12:10Z

nickcheng wrote:
> Hi,
> I definitely agree it is in atomic context but why is the memory not for
> DMA?
> Would you please show me why?

It would probably be easier if you could explain where you believe the
memory IS used for DMA :)

Anyway, looking at ARCMSR_MESSAGE_READ_RQBUFFER
current code does this:
ver_addr = kmalloc(1032, GFP_ATOMIC);

Here are the cases when that buffer is used:

checking for successful malloc: not DMA
if (!ver_addr) {

copying the address: not DMA
ptmpQbuffer = ver_addr;

memcpying 1 byte into the buffer: not DMA
memcpy(ptmpQbuffer, pQbuffer, 1);

incrementing address: not DMA
ptmpQbuffer++;

memcpying from the buffer: not DMA
memcpy(pcmdmessagefld->messagedatabuffer, ver_addr, allxfer_len);

freeing the buffer: not DMA
kfree(ver_addr);

Daniel