linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] scsi: Use new __dma_buffer to align sense buffer in scsi_cmnd
@ 2007-12-21  2:30 Benjamin Herrenschmidt
  2007-12-21 10:33 ` Alan Cox
  2007-12-23 11:09 ` Boaz Harrosh
  0 siblings, 2 replies; 14+ messages in thread
From: Benjamin Herrenschmidt @ 2007-12-21  2:30 UTC (permalink / raw)
  To: linux-kernel
  Cc: Andrew Morton, rdreier, linux-scsi, rmk, davem, james.bottomley, ralf

The sense buffer ins scsi_cmnd can nowadays be DMA'ed into directly
by some low level drivers (that typically happens with USB mass
storage).

This is a problem on non cache coherent architectures such as
embedded PowerPCs where the sense buffer can share cache lines with
other structure members, which leads to various forms of corruption.

This uses the newly defined __dma_buffer annotation to enforce that
on such platforms, the sense_buffer is contained within its own
cache line. This has no effect on cache coherent architectures.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

 include/scsi/scsi_cmnd.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-merge.orig/include/scsi/scsi_cmnd.h	2007-12-21 13:07:14.000000000 +1100
+++ linux-merge/include/scsi/scsi_cmnd.h	2007-12-21 13:07:29.000000000 +1100
@@ -88,7 +88,7 @@ struct scsi_cmnd {
 				   	   working on */
 
 #define SCSI_SENSE_BUFFERSIZE 	96
-	unsigned char sense_buffer[SCSI_SENSE_BUFFERSIZE];
+	unsigned char sense_buffer[SCSI_SENSE_BUFFERSIZE] __dma_buffer;
 				/* obtained by REQUEST SENSE when
 				 * CHECK CONDITION is received on original
 				 * command (auto-sense) */

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

end of thread, other threads:[~2008-01-07 23:35 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-21  2:30 [PATCH 2/2] scsi: Use new __dma_buffer to align sense buffer in scsi_cmnd Benjamin Herrenschmidt
2007-12-21 10:33 ` Alan Cox
2007-12-21 13:16   ` Matthew Wilcox
2007-12-21 13:30     ` Thomas Bogendoerfer
2007-12-21 14:00       ` Matthew Wilcox
2007-12-21 16:35         ` Thomas Bogendoerfer
2007-12-21 21:29     ` Benjamin Herrenschmidt
2007-12-21 16:57   ` Roland Dreier
2007-12-21 21:27   ` Benjamin Herrenschmidt
2007-12-23 11:09 ` Boaz Harrosh
2007-12-23 23:04   ` Benjamin Herrenschmidt
2008-01-07  6:53   ` FUJITA Tomonori
2008-01-07 13:25     ` Boaz Harrosh
2008-01-07 23:32       ` FUJITA Tomonori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).