diff options
Diffstat (limited to 'drivers/block/cciss.c')
-rw-r--r-- | drivers/block/cciss.c | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 4d4d5e0d3fa6..e714e7cce6f2 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -1299,7 +1299,6 @@ static void cciss_softirq_done(struct request *rq) | |||
1299 | { | 1299 | { |
1300 | CommandList_struct *cmd = rq->completion_data; | 1300 | CommandList_struct *cmd = rq->completion_data; |
1301 | ctlr_info_t *h = hba[cmd->ctlr]; | 1301 | ctlr_info_t *h = hba[cmd->ctlr]; |
1302 | unsigned int nr_bytes; | ||
1303 | unsigned long flags; | 1302 | unsigned long flags; |
1304 | u64bit temp64; | 1303 | u64bit temp64; |
1305 | int i, ddir; | 1304 | int i, ddir; |
@@ -1321,15 +1320,11 @@ static void cciss_softirq_done(struct request *rq) | |||
1321 | printk("Done with %p\n", rq); | 1320 | printk("Done with %p\n", rq); |
1322 | #endif /* CCISS_DEBUG */ | 1321 | #endif /* CCISS_DEBUG */ |
1323 | 1322 | ||
1324 | /* | 1323 | /* set the residual count for pc requests */ |
1325 | * Store the full size and set the residual count for pc requests | ||
1326 | */ | ||
1327 | nr_bytes = blk_rq_bytes(rq); | ||
1328 | if (blk_pc_request(rq)) | 1324 | if (blk_pc_request(rq)) |
1329 | rq->data_len = cmd->err_info->ResidualCnt; | 1325 | rq->resid_len = cmd->err_info->ResidualCnt; |
1330 | 1326 | ||
1331 | if (blk_end_request(rq, (rq->errors == 0) ? 0 : -EIO, nr_bytes)) | 1327 | blk_end_request_all(rq, (rq->errors == 0) ? 0 : -EIO); |
1332 | BUG(); | ||
1333 | 1328 | ||
1334 | spin_lock_irqsave(&h->lock, flags); | 1329 | spin_lock_irqsave(&h->lock, flags); |
1335 | cmd_free(h, cmd, 1); | 1330 | cmd_free(h, cmd, 1); |
@@ -2691,7 +2686,7 @@ static inline void complete_command(ctlr_info_t *h, CommandList_struct *cmd, | |||
2691 | printk(KERN_WARNING "cciss: cmd %p has" | 2686 | printk(KERN_WARNING "cciss: cmd %p has" |
2692 | " completed with data underrun " | 2687 | " completed with data underrun " |
2693 | "reported\n", cmd); | 2688 | "reported\n", cmd); |
2694 | cmd->rq->data_len = cmd->err_info->ResidualCnt; | 2689 | cmd->rq->resid_len = cmd->err_info->ResidualCnt; |
2695 | } | 2690 | } |
2696 | break; | 2691 | break; |
2697 | case CMD_DATA_OVERRUN: | 2692 | case CMD_DATA_OVERRUN: |
@@ -2806,7 +2801,7 @@ static void do_cciss_request(struct request_queue *q) | |||
2806 | goto startio; | 2801 | goto startio; |
2807 | 2802 | ||
2808 | queue: | 2803 | queue: |
2809 | creq = elv_next_request(q); | 2804 | creq = blk_peek_request(q); |
2810 | if (!creq) | 2805 | if (!creq) |
2811 | goto startio; | 2806 | goto startio; |
2812 | 2807 | ||
@@ -2815,7 +2810,7 @@ static void do_cciss_request(struct request_queue *q) | |||
2815 | if ((c = cmd_alloc(h, 1)) == NULL) | 2810 | if ((c = cmd_alloc(h, 1)) == NULL) |
2816 | goto full; | 2811 | goto full; |
2817 | 2812 | ||
2818 | blkdev_dequeue_request(creq); | 2813 | blk_start_request(creq); |
2819 | 2814 | ||
2820 | spin_unlock_irq(q->queue_lock); | 2815 | spin_unlock_irq(q->queue_lock); |
2821 | 2816 | ||
@@ -2840,10 +2835,10 @@ static void do_cciss_request(struct request_queue *q) | |||
2840 | c->Request.Timeout = 0; // Don't time out | 2835 | c->Request.Timeout = 0; // Don't time out |
2841 | c->Request.CDB[0] = | 2836 | c->Request.CDB[0] = |
2842 | (rq_data_dir(creq) == READ) ? h->cciss_read : h->cciss_write; | 2837 | (rq_data_dir(creq) == READ) ? h->cciss_read : h->cciss_write; |
2843 | start_blk = creq->sector; | 2838 | start_blk = blk_rq_pos(creq); |
2844 | #ifdef CCISS_DEBUG | 2839 | #ifdef CCISS_DEBUG |
2845 | printk(KERN_DEBUG "ciss: sector =%d nr_sectors=%d\n", (int)creq->sector, | 2840 | printk(KERN_DEBUG "ciss: sector =%d nr_sectors=%d\n", |
2846 | (int)creq->nr_sectors); | 2841 | (int)blk_rq_pos(creq), (int)blk_rq_sectors(creq)); |
2847 | #endif /* CCISS_DEBUG */ | 2842 | #endif /* CCISS_DEBUG */ |
2848 | 2843 | ||
2849 | sg_init_table(tmp_sg, MAXSGENTRIES); | 2844 | sg_init_table(tmp_sg, MAXSGENTRIES); |
@@ -2869,8 +2864,8 @@ static void do_cciss_request(struct request_queue *q) | |||
2869 | h->maxSG = seg; | 2864 | h->maxSG = seg; |
2870 | 2865 | ||
2871 | #ifdef CCISS_DEBUG | 2866 | #ifdef CCISS_DEBUG |
2872 | printk(KERN_DEBUG "cciss: Submitting %lu sectors in %d segments\n", | 2867 | printk(KERN_DEBUG "cciss: Submitting %u sectors in %d segments\n", |
2873 | creq->nr_sectors, seg); | 2868 | blk_rq_sectors(creq), seg); |
2874 | #endif /* CCISS_DEBUG */ | 2869 | #endif /* CCISS_DEBUG */ |
2875 | 2870 | ||
2876 | c->Header.SGList = c->Header.SGTotal = seg; | 2871 | c->Header.SGList = c->Header.SGTotal = seg; |
@@ -2882,8 +2877,8 @@ static void do_cciss_request(struct request_queue *q) | |||
2882 | c->Request.CDB[4] = (start_blk >> 8) & 0xff; | 2877 | c->Request.CDB[4] = (start_blk >> 8) & 0xff; |
2883 | c->Request.CDB[5] = start_blk & 0xff; | 2878 | c->Request.CDB[5] = start_blk & 0xff; |
2884 | c->Request.CDB[6] = 0; // (sect >> 24) & 0xff; MSB | 2879 | c->Request.CDB[6] = 0; // (sect >> 24) & 0xff; MSB |
2885 | c->Request.CDB[7] = (creq->nr_sectors >> 8) & 0xff; | 2880 | c->Request.CDB[7] = (blk_rq_sectors(creq) >> 8) & 0xff; |
2886 | c->Request.CDB[8] = creq->nr_sectors & 0xff; | 2881 | c->Request.CDB[8] = blk_rq_sectors(creq) & 0xff; |
2887 | c->Request.CDB[9] = c->Request.CDB[11] = c->Request.CDB[12] = 0; | 2882 | c->Request.CDB[9] = c->Request.CDB[11] = c->Request.CDB[12] = 0; |
2888 | } else { | 2883 | } else { |
2889 | u32 upper32 = upper_32_bits(start_blk); | 2884 | u32 upper32 = upper_32_bits(start_blk); |
@@ -2898,10 +2893,10 @@ static void do_cciss_request(struct request_queue *q) | |||
2898 | c->Request.CDB[7]= (start_blk >> 16) & 0xff; | 2893 | c->Request.CDB[7]= (start_blk >> 16) & 0xff; |
2899 | c->Request.CDB[8]= (start_blk >> 8) & 0xff; | 2894 | c->Request.CDB[8]= (start_blk >> 8) & 0xff; |
2900 | c->Request.CDB[9]= start_blk & 0xff; | 2895 | c->Request.CDB[9]= start_blk & 0xff; |
2901 | c->Request.CDB[10]= (creq->nr_sectors >> 24) & 0xff; | 2896 | c->Request.CDB[10]= (blk_rq_sectors(creq) >> 24) & 0xff; |
2902 | c->Request.CDB[11]= (creq->nr_sectors >> 16) & 0xff; | 2897 | c->Request.CDB[11]= (blk_rq_sectors(creq) >> 16) & 0xff; |
2903 | c->Request.CDB[12]= (creq->nr_sectors >> 8) & 0xff; | 2898 | c->Request.CDB[12]= (blk_rq_sectors(creq) >> 8) & 0xff; |
2904 | c->Request.CDB[13]= creq->nr_sectors & 0xff; | 2899 | c->Request.CDB[13]= blk_rq_sectors(creq) & 0xff; |
2905 | c->Request.CDB[14] = c->Request.CDB[15] = 0; | 2900 | c->Request.CDB[14] = c->Request.CDB[15] = 0; |
2906 | } | 2901 | } |
2907 | } else if (blk_pc_request(creq)) { | 2902 | } else if (blk_pc_request(creq)) { |