public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* Is it safe to do DMA directly into scmd->sense_buffer?
@ 2003-06-22 16:09 Alan Stern
  2003-06-22 17:06 ` James Bottomley
  0 siblings, 1 reply; 9+ messages in thread
From: Alan Stern @ 2003-06-22 16:09 UTC (permalink / raw)
  To: SCSI development list

When retrieving sense data for a failed command, is it safe to transfer
the data by DMA directly into scmd->sense_buffer?  My guess is that on
architectures that have non-cache-coherent DMA, it's _not_.

The reason is that there is no guarantee the SCSI core won't touch the
scmd structure while the I/O is taking place.  For instance, should the
abort timer expire, the error-handler thread might very well end up
reading or writing data falling in the same cache line as the
sense_buffer.  That would corrupt the CPU's view of data transferred from
the device.

But maybe there's some provision for taking care of this I'm not aware of.  
If anyone can supply the correct answer, my sense-bounce-buffer and I
would appreciate it.

Alan Stern


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-07-31 19:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-22 16:09 Is it safe to do DMA directly into scmd->sense_buffer? Alan Stern
2003-06-22 17:06 ` James Bottomley
2003-07-17 14:50   ` Comments about the __scsi_mode_sense() routine Alan Stern
2003-07-17 15:47     ` James Bottomley
2003-07-17 19:51       ` Alan Stern
2003-07-30 20:36   ` PATCH: (as73) Do a minimal transfer for disk-cache mode-sense page Alan Stern
2003-07-30 21:04     ` James Bottomley
2003-07-31 15:12       ` Revised PATCH: (as73b) " Alan Stern
2003-07-31 19:53       ` PATCH: (as70b) Update request_bufflen to match this_count Alan Stern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox