···2178217821792179 start_io(h);21802180}21812181+21822182+static void cciss_softirq_done(struct request *rq)21832183+{21842184+ CommandList_struct *cmd = rq->completion_data;21852185+ ctlr_info_t *h = hba[cmd->ctlr];21862186+ u64bit temp64;21872187+ int i, ddir;21882188+21892189+ if (cmd->Request.Type.Direction == XFER_READ)21902190+ ddir = PCI_DMA_FROMDEVICE;21912191+ else21922192+ ddir = PCI_DMA_TODEVICE;21932193+21942194+ /* command did not need to be retried */21952195+ /* unmap the DMA mapping for all the scatter gather elements */21962196+ for(i=0; i<cmd->Header.SGList; i++) {21972197+ temp64.val32.lower = cmd->SG[i].Addr.lower;21982198+ temp64.val32.upper = cmd->SG[i].Addr.upper;21992199+ pci_unmap_page(h->pdev, temp64.val, cmd->SG[i].Len, ddir);22002200+ }22012201+22022202+ complete_buffers(rq->bio, rq->errors);22032203+22042204+#ifdef CCISS_DEBUG22052205+ printk("Done with %p\n", rq);22062206+#endif /* CCISS_DEBUG */ 22072207+22082208+ spin_lock_irq(&h->lock);22092209+ end_that_request_last(rq, rq->errors);22102210+ cmd_free(h, cmd,1);22112211+ spin_unlock_irq(&h->lock);22122212+}22132213+21812214/* checks the status of the job and calls complete buffers to mark all 21822182- * buffers for the completed job. 22152215+ * buffers for the completed job. Note that this function does not need22162216+ * to hold the hba/queue lock.21832217 */ 21842218static inline void complete_command( ctlr_info_t *h, CommandList_struct *cmd,21852219 int timeout)21862220{21872221 int status = 1;21882188- int i;21892222 int retry_cmd = 0;21902190- u64bit temp64;2191222321922224 if (timeout)21932225 status = 0; ···23272295 resend_cciss_cmd(h,cmd);23282296 return;23292297 } 23302330- /* command did not need to be retried */23312331- /* unmap the DMA mapping for all the scatter gather elements */23322332- for(i=0; i<cmd->Header.SGList; i++) {23332333- temp64.val32.lower = cmd->SG[i].Addr.lower;23342334- temp64.val32.upper = cmd->SG[i].Addr.upper;23352335- pci_unmap_page(hba[cmd->ctlr]->pdev,23362336- temp64.val, cmd->SG[i].Len,23372337- (cmd->Request.Type.Direction == XFER_READ) ?23382338- PCI_DMA_FROMDEVICE : PCI_DMA_TODEVICE);23392339- }23402340- complete_buffers(cmd->rq->bio, status);2341229823422342-#ifdef CCISS_DEBUG23432343- printk("Done with %p\n", cmd->rq);23442344-#endif /* CCISS_DEBUG */ 23452345-23462346- end_that_request_last(cmd->rq, status ? 1 : -EIO);23472347- cmd_free(h,cmd,1);22992299+ cmd->rq->completion_data = cmd;23002300+ cmd->rq->errors = status;23012301+ blk_complete_request(cmd->rq);23482302}2349230323502304/* ···32173199 drv->queue = q;3218320032193201 q->backing_dev_info.ra_pages = READ_AHEAD;32203220- blk_queue_bounce_limit(q, hba[i]->pdev->dma_mask);32023202+ blk_queue_bounce_limit(q, hba[i]->pdev->dma_mask);3221320332223222- /* This is a hardware imposed limit. */32233223- blk_queue_max_hw_segments(q, MAXSGENTRIES);32043204+ /* This is a hardware imposed limit. */32053205+ blk_queue_max_hw_segments(q, MAXSGENTRIES);3224320632253225- /* This is a limit in the driver and could be eliminated. */32263226- blk_queue_max_phys_segments(q, MAXSGENTRIES);32073207+ /* This is a limit in the driver and could be eliminated. */32083208+ blk_queue_max_phys_segments(q, MAXSGENTRIES);3227320932283228- blk_queue_max_sectors(q, 512);32103210+ blk_queue_max_sectors(q, 512);32113211+32123212+ blk_queue_softirq_done(q, cciss_softirq_done);3229321332303214 q->queuedata = hba[i];32313215 sprintf(disk->disk_name, "cciss/c%dd%d", i, j);