[PATCH 0/2] fix the sense buffer DMA issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patchset is to solve the sense buffer DMA issue:

http://www.mail-archive.com/linux-scsi@xxxxxxxxxxxxxxx/msg12632.html

It's not good to fatten up scsi_cmnd so instead this allocates
sense_buffer dynamically with GFP_DMA.

We don't always need sense_buffer per scsi_cmnd but some LLDs assume
that scsi_cmnd:sense_buffer is always available (e.g, some do
dma_mapping for sense_buffer). So allocating sense_buffer only when
necessary is the best option but needs many changes to LLDs.

We need to solve the sense buffer DMA issue now (since critical for
some architectures) so this patchset tries to solve it with minimum
changes though in the long run, we need more changes to sense_buffer
handling.

This removes static array sense_buffer in scsi_cmnd and dynamically
allocates sense_buffer with GFP_DMA.

scsi_add_host allocates as many buffers as
scsi_host->can_queue. __scsi_get_command attaches sense_buffer to a
scsi_cmnd and __scsi_put_command detaches the sense_buffer from it. So
LLDs should work as before though we need one minor change, replacing
sizeof sense_buffer in some LLDs with SCSI_SENSE_BUFFERSIZE.

There is a small possibility that a host need more sense buffers than
can_queue. The failure of the buffer allocation works just like the
failure of scsi_cmnd allocation. So everything should work as before
(the block layer takes care about it).
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux