aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorAsai Thambi S P <asamymuthupa@micron.com>2012-04-09 02:35:38 -0400
committerJens Axboe <axboe@kernel.dk>2012-04-09 02:35:38 -0400
commitdad40f16ff683a10f4f2bea55a0b9fd86d3db58e (patch)
treef099fbebdca4df4b7d5421443f5f5a6ddd58a8e4 /drivers/block
parent45038367c271f83b649b16551bf2d8174b203cb9 (diff)
mtip32xx: make setting comp_time as common
Moved setting completion time into mtip_issue_ncq_command() Signed-off-by: Asai Thambi S P <asamymuthupa@micron.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/mtip32xx/mtip32xx.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c
index 34b395d2d98d..aaa82453ae74 100644
--- a/drivers/block/mtip32xx/mtip32xx.c
+++ b/drivers/block/mtip32xx/mtip32xx.c
@@ -306,6 +306,10 @@ static inline void mtip_issue_ncq_command(struct mtip_port *port, int tag)
306 port->cmd_issue[MTIP_TAG_INDEX(tag)]); 306 port->cmd_issue[MTIP_TAG_INDEX(tag)]);
307 307
308 spin_unlock_irqrestore(&port->cmd_issue_lock, flags); 308 spin_unlock_irqrestore(&port->cmd_issue_lock, flags);
309
310 /* Set the command's timeout value.*/
311 port->commands[tag].comp_time = jiffies + msecs_to_jiffies(
312 MTIP_NCQ_COMMAND_TIMEOUT_MS);
309} 313}
310 314
311/* 315/*
@@ -824,10 +828,6 @@ static void mtip_handle_tfe(struct driver_data *dd)
824 828
825 set_bit(tag, tagaccum); 829 set_bit(tag, tagaccum);
826 830
827 /* Update the timeout value. */
828 port->commands[tag].comp_time =
829 jiffies + msecs_to_jiffies(
830 MTIP_NCQ_COMMAND_TIMEOUT_MS);
831 /* Re-issue the command. */ 831 /* Re-issue the command. */
832 mtip_issue_ncq_command(port, tag); 832 mtip_issue_ncq_command(port, tag);
833 833
@@ -2204,9 +2204,7 @@ static void mtip_hw_submit_io(struct driver_data *dd, sector_t start,
2204 /* Issue the command to the hardware */ 2204 /* Issue the command to the hardware */
2205 mtip_issue_ncq_command(port, tag); 2205 mtip_issue_ncq_command(port, tag);
2206 2206
2207 /* Set the command's timeout value.*/ 2207 return;
2208 port->commands[tag].comp_time = jiffies + msecs_to_jiffies(
2209 MTIP_NCQ_COMMAND_TIMEOUT_MS);
2210} 2208}
2211 2209
2212/* 2210/*
@@ -2538,10 +2536,6 @@ static int mtip_service_thread(void *data)
2538 /* Issue the command to the hardware */ 2536 /* Issue the command to the hardware */
2539 mtip_issue_ncq_command(port, slot); 2537 mtip_issue_ncq_command(port, slot);
2540 2538
2541 /* Set the command's timeout value.*/
2542 port->commands[slot].comp_time = jiffies +
2543 msecs_to_jiffies(MTIP_NCQ_COMMAND_TIMEOUT_MS);
2544
2545 clear_bit(slot, port->cmds_to_issue); 2539 clear_bit(slot, port->cmds_to_issue);
2546 } 2540 }
2547 2541