summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ufs/ufshcd.c
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2014-07-01 16:00:32 +0200
committerChristoph Hellwig <hch@lst.de>2014-07-25 23:17:02 +0200
commiteeda47499f01878d60b3db8883fbbafc3c6a2a54 (patch)
treea81d23f82d1b104844b7207bc75c956cd057643d /drivers/scsi/ufs/ufshcd.c
parentufs: Fix sending unsupported SCSI command (diff)
downloadlinux-eeda47499f01878d60b3db8883fbbafc3c6a2a54.tar.xz
linux-eeda47499f01878d60b3db8883fbbafc3c6a2a54.zip
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.c15
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)
}
/**
+ * ufshcd_slave_configure - adjust SCSI device configurations
+ * @sdev: pointer to SCSI device
+ */
+static int ufshcd_slave_configure(struct scsi_device *sdev)
+{
+ struct request_queue *q = sdev->request_queue;
+
+ blk_queue_update_dma_pad(q, PRDT_DATA_BYTE_COUNT_PAD - 1);
+ blk_queue_max_segment_size(q, PRDT_DATA_BYTE_COUNT_MAX);
+
+ return 0;
+}
+
+/**
* ufshcd_slave_destroy - remove SCSI device configurations
* @sdev: pointer to SCSI device
*/
@@ -3145,6 +3159,7 @@ static struct scsi_host_template ufshcd_driver_template = {
.proc_name = UFSHCD,
.queuecommand = ufshcd_queuecommand,
.slave_alloc = ufshcd_slave_alloc,
+ .slave_configure = ufshcd_slave_configure,
.slave_destroy = ufshcd_slave_destroy,
.change_queue_depth = ufshcd_change_queue_depth,
.eh_abort_handler = ufshcd_abort,