diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2014-07-01 10:00:32 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-07-25 17:17:02 -0400 |
commit | eeda47499f01878d60b3db8883fbbafc3c6a2a54 (patch) | |
tree | a81d23f82d1b104844b7207bc75c956cd057643d /drivers/scsi/ufs/ufshcd.c | |
parent | b2a6c5223c1e1fe293e965685a8373a6a7aca5fe (diff) |
ufs: adjust queue settings to PRDT limitations
The data byte count field of PRDT indicates the length of data block
which is a segment of data transfer for SCSI commands. The value of
this field shall have Dword granularity and the the maximum of length
is 256KB.
This adjusts dma pad mask and max segment size to the above-mentioned
PRDT limitations.
Signed-off-by: Akinobu Mita <mita@fixstars.com>
Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org>
Tested-by: Dolev Raviv <draviv@codeaurora.org>
Acked-by: Vinayak Holikatti <vinholikatti@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi/ufs/ufshcd.c')
-rw-r--r-- | drivers/scsi/ufs/ufshcd.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index f189e8a6cb1e..af1bffc1eac8 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c | |||
@@ -2043,6 +2043,20 @@ int ufshcd_change_queue_depth(struct scsi_device *sdev, int depth, int reason) | |||
2043 | } | 2043 | } |
2044 | 2044 | ||
2045 | /** | 2045 | /** |
2046 | * ufshcd_slave_configure - adjust SCSI device configurations | ||
2047 | * @sdev: pointer to SCSI device | ||
2048 | */ | ||
2049 | static int ufshcd_slave_configure(struct scsi_device *sdev) | ||
2050 | { | ||
2051 | struct request_queue *q = sdev->request_queue; | ||
2052 | |||
2053 | blk_queue_update_dma_pad(q, PRDT_DATA_BYTE_COUNT_PAD - 1); | ||
2054 | blk_queue_max_segment_size(q, PRDT_DATA_BYTE_COUNT_MAX); | ||
2055 | |||
2056 | return 0; | ||
2057 | } | ||
2058 | |||
2059 | /** | ||
2046 | * ufshcd_slave_destroy - remove SCSI device configurations | 2060 | * ufshcd_slave_destroy - remove SCSI device configurations |
2047 | * @sdev: pointer to SCSI device | 2061 | * @sdev: pointer to SCSI device |
2048 | */ | 2062 | */ |
@@ -3145,6 +3159,7 @@ static struct scsi_host_template ufshcd_driver_template = { | |||
3145 | .proc_name = UFSHCD, | 3159 | .proc_name = UFSHCD, |
3146 | .queuecommand = ufshcd_queuecommand, | 3160 | .queuecommand = ufshcd_queuecommand, |
3147 | .slave_alloc = ufshcd_slave_alloc, | 3161 | .slave_alloc = ufshcd_slave_alloc, |
3162 | .slave_configure = ufshcd_slave_configure, | ||
3148 | .slave_destroy = ufshcd_slave_destroy, | 3163 | .slave_destroy = ufshcd_slave_destroy, |
3149 | .change_queue_depth = ufshcd_change_queue_depth, | 3164 | .change_queue_depth = ufshcd_change_queue_depth, |
3150 | .eh_abort_handler = ufshcd_abort, | 3165 | .eh_abort_handler = ufshcd_abort, |