]> pilppa.com Git - linux-2.6-omap-h63xx.git/commit
[SCSI] use dynamically allocated sense buffer
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Wed, 16 Jan 2008 04:32:17 +0000 (13:32 +0900)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Wed, 23 Jan 2008 17:37:37 +0000 (11:37 -0600)
commitde25deb18016f66dcdede165d07654559bb332bc
treeb566c2a369d3dce85507ab28ea20ffee020e0c06
parentb30c2fc1113edfb2371427c10503ff942b0a0370
[SCSI] use dynamically allocated sense buffer

This removes static array sense_buffer in scsi_cmnd and uses
dynamically allocated sense_buffer (with GFP_DMA).

The reason for doing this is that some architectures need cacheline
aligned buffer for DMA:

http://lkml.org/lkml/2007/11/19/2

The problems are that scsi_eh_prep_cmnd puts scsi_cmnd::sense_buffer
to sglist and some LLDs directly DMA to scsi_cmnd::sense_buffer. It's
necessary to DMA to scsi_cmnd::sense_buffer safely. This patch solves
these issues.

__scsi_get_command allocates sense_buffer via kmem_cache_alloc and
attaches it to a scsi_cmnd so everything just work as before.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/hosts.c
drivers/scsi/scsi.c
drivers/scsi/scsi_priv.h
include/scsi/scsi_cmnd.h