···21782179 start_io(h);2180}0000000000000000000000000000000002181/* checks the status of the job and calls complete buffers to mark all 2182- * buffers for the completed job. 02183 */ 2184static inline void complete_command( ctlr_info_t *h, CommandList_struct *cmd,2185 int timeout)2186{2187 int status = 1;2188- int i;2189 int retry_cmd = 0;2190- u64bit temp64;21912192 if (timeout)2193 status = 0; ···2327 resend_cciss_cmd(h,cmd);2328 return;2329 } 2330- /* command did not need to be retried */2331- /* unmap the DMA mapping for all the scatter gather elements */2332- for(i=0; i<cmd->Header.SGList; i++) {2333- temp64.val32.lower = cmd->SG[i].Addr.lower;2334- temp64.val32.upper = cmd->SG[i].Addr.upper;2335- pci_unmap_page(hba[cmd->ctlr]->pdev,2336- temp64.val, cmd->SG[i].Len,2337- (cmd->Request.Type.Direction == XFER_READ) ?2338- PCI_DMA_FROMDEVICE : PCI_DMA_TODEVICE);2339- }2340- complete_buffers(cmd->rq->bio, status);23412342-#ifdef CCISS_DEBUG2343- printk("Done with %p\n", cmd->rq);2344-#endif /* CCISS_DEBUG */ 2345-2346- end_that_request_last(cmd->rq, status ? 1 : -EIO);2347- cmd_free(h,cmd,1);2348}23492350/* ···3217 drv->queue = q;32183219 q->backing_dev_info.ra_pages = READ_AHEAD;3220- blk_queue_bounce_limit(q, hba[i]->pdev->dma_mask);32213222- /* This is a hardware imposed limit. */3223- blk_queue_max_hw_segments(q, MAXSGENTRIES);32243225- /* This is a limit in the driver and could be eliminated. */3226- blk_queue_max_phys_segments(q, MAXSGENTRIES);32273228- blk_queue_max_sectors(q, 512);0032293230 q->queuedata = hba[i];3231 sprintf(disk->disk_name, "cciss/c%dd%d", i, j);
···21782179 start_io(h);2180}2181+2182+static void cciss_softirq_done(struct request *rq)2183+{2184+ CommandList_struct *cmd = rq->completion_data;2185+ ctlr_info_t *h = hba[cmd->ctlr];2186+ u64bit temp64;2187+ int i, ddir;2188+2189+ if (cmd->Request.Type.Direction == XFER_READ)2190+ ddir = PCI_DMA_FROMDEVICE;2191+ else2192+ ddir = PCI_DMA_TODEVICE;2193+2194+ /* command did not need to be retried */2195+ /* unmap the DMA mapping for all the scatter gather elements */2196+ for(i=0; i<cmd->Header.SGList; i++) {2197+ temp64.val32.lower = cmd->SG[i].Addr.lower;2198+ temp64.val32.upper = cmd->SG[i].Addr.upper;2199+ pci_unmap_page(h->pdev, temp64.val, cmd->SG[i].Len, ddir);2200+ }2201+2202+ complete_buffers(rq->bio, rq->errors);2203+2204+#ifdef CCISS_DEBUG2205+ printk("Done with %p\n", rq);2206+#endif /* CCISS_DEBUG */ 2207+2208+ spin_lock_irq(&h->lock);2209+ end_that_request_last(rq, rq->errors);2210+ cmd_free(h, cmd,1);2211+ spin_unlock_irq(&h->lock);2212+}2213+2214/* checks the status of the job and calls complete buffers to mark all 2215+ * buffers for the completed job. Note that this function does not need2216+ * to hold the hba/queue lock.2217 */ 2218static inline void complete_command( ctlr_info_t *h, CommandList_struct *cmd,2219 int timeout)2220{2221 int status = 1;02222 int retry_cmd = 0;022232224 if (timeout)2225 status = 0; ···2295 resend_cciss_cmd(h,cmd);2296 return;2297 } 0000000000022982299+ cmd->rq->completion_data = cmd;2300+ cmd->rq->errors = status;2301+ blk_complete_request(cmd->rq);0002302}23032304/* ···3199 drv->queue = q;32003201 q->backing_dev_info.ra_pages = READ_AHEAD;3202+ blk_queue_bounce_limit(q, hba[i]->pdev->dma_mask);32033204+ /* This is a hardware imposed limit. */3205+ blk_queue_max_hw_segments(q, MAXSGENTRIES);32063207+ /* This is a limit in the driver and could be eliminated. */3208+ blk_queue_max_phys_segments(q, MAXSGENTRIES);32093210+ blk_queue_max_sectors(q, 512);3211+3212+ blk_queue_softirq_done(q, cciss_softirq_done);32133214 q->queuedata = hba[i];3215 sprintf(disk->disk_name, "cciss/c%dd%d", i, j);