Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6:
[SCSI] Retry commands with UNIT_ATTENTION sense codes to fix ext3/ext4 I/O error
[SCSI] Enable retries for SYNCRONIZE_CACHE commands to fix I/O error
[SCSI] scsi_debug: virtual_gb ignores sector_size
[SCSI] libiscsi: regression: fix header digest errors
[SCSI] fix locking around blk_abort_request()
[SCSI] advansys: fix narrow board error path

+62 -17
+36 -14
drivers/scsi/advansys.c
··· 4724 4724 BUG_ON((unsigned long)asc_dvc->overrun_buf & 7); 4725 4725 asc_dvc->overrun_dma = dma_map_single(board->dev, asc_dvc->overrun_buf, 4726 4726 ASC_OVERRUN_BSIZE, DMA_FROM_DEVICE); 4727 + if (dma_mapping_error(board->dev, asc_dvc->overrun_dma)) { 4728 + warn_code = -ENOMEM; 4729 + goto err_dma_map; 4730 + } 4727 4731 phy_addr = cpu_to_le32(asc_dvc->overrun_dma); 4728 4732 AscMemDWordCopyPtrToLram(iop_base, ASCV_OVERRUN_PADDR_D, 4729 4733 (uchar *)&phy_addr, 1); ··· 4743 4739 AscSetPCAddr(iop_base, ASC_MCODE_START_ADDR); 4744 4740 if (AscGetPCAddr(iop_base) != ASC_MCODE_START_ADDR) { 4745 4741 asc_dvc->err_code |= ASC_IERR_SET_PC_ADDR; 4746 - return warn_code; 4742 + warn_code = UW_ERR; 4743 + goto err_mcode_start; 4747 4744 } 4748 4745 if (AscStartChip(iop_base) != 1) { 4749 4746 asc_dvc->err_code |= ASC_IERR_START_STOP_CHIP; 4750 - return warn_code; 4747 + warn_code = UW_ERR; 4748 + goto err_mcode_start; 4751 4749 } 4752 4750 4751 + return warn_code; 4752 + 4753 + err_mcode_start: 4754 + dma_unmap_single(board->dev, asc_dvc->overrun_dma, 4755 + ASC_OVERRUN_BSIZE, DMA_FROM_DEVICE); 4756 + err_dma_map: 4757 + asc_dvc->overrun_dma = 0; 4753 4758 return warn_code; 4754 4759 } 4755 4760 ··· 4815 4802 } 4816 4803 release_firmware(fw); 4817 4804 warn_code |= AscInitMicroCodeVar(asc_dvc); 4805 + if (!asc_dvc->overrun_dma) 4806 + return warn_code; 4818 4807 asc_dvc->init_state |= ASC_INIT_STATE_END_LOAD_MC; 4819 4808 AscEnableInterrupt(iop_base); 4820 4809 return warn_code; ··· 7993 7978 status = AscInitAsc1000Driver(asc_dvc); 7994 7979 7995 7980 /* Refer to ASC_IERR_* definitions for meaning of 'err_code'. */ 7996 - if (asc_dvc->err_code) { 7981 + if (asc_dvc->err_code || !asc_dvc->overrun_dma) { 7997 7982 scmd_printk(KERN_INFO, scp, "SCSI bus reset error: " 7998 - "0x%x\n", asc_dvc->err_code); 7983 + "0x%x, status: 0x%x\n", asc_dvc->err_code, 7984 + status); 7999 7985 ret = FAILED; 8000 7986 } else if (status) { 8001 7987 scmd_printk(KERN_INFO, scp, "SCSI bus reset warning: " ··· 12327 12311 asc_dvc_varp->overrun_buf = kzalloc(ASC_OVERRUN_BSIZE, GFP_KERNEL); 12328 12312 if (!asc_dvc_varp->overrun_buf) { 12329 12313 ret = -ENOMEM; 12330 - goto err_free_wide_mem; 12314 + goto err_free_irq; 12331 12315 } 12332 12316 warn_code = AscInitAsc1000Driver(asc_dvc_varp); 12333 12317 ··· 12336 12320 "warn 0x%x, error 0x%x\n", 12337 12321 asc_dvc_varp->init_state, warn_code, 12338 12322 asc_dvc_varp->err_code); 12339 - if (asc_dvc_varp->err_code) { 12323 + if (!asc_dvc_varp->overrun_dma) { 12340 12324 ret = -ENODEV; 12341 - kfree(asc_dvc_varp->overrun_buf); 12325 + goto err_free_mem; 12342 12326 } 12343 12327 } 12344 12328 } else { 12345 - if (advansys_wide_init_chip(shost)) 12329 + if (advansys_wide_init_chip(shost)) { 12346 12330 ret = -ENODEV; 12331 + goto err_free_mem; 12332 + } 12347 12333 } 12348 - 12349 - if (ret) 12350 - goto err_free_wide_mem; 12351 12334 12352 12335 ASC_DBG_PRT_SCSI_HOST(2, shost); 12353 12336 12354 12337 ret = scsi_add_host(shost, boardp->dev); 12355 12338 if (ret) 12356 - goto err_free_wide_mem; 12339 + goto err_free_mem; 12357 12340 12358 12341 scsi_scan_host(shost); 12359 12342 return 0; 12360 12343 12361 - err_free_wide_mem: 12362 - advansys_wide_free_mem(boardp); 12344 + err_free_mem: 12345 + if (ASC_NARROW_BOARD(boardp)) { 12346 + if (asc_dvc_varp->overrun_dma) 12347 + dma_unmap_single(boardp->dev, asc_dvc_varp->overrun_dma, 12348 + ASC_OVERRUN_BSIZE, DMA_FROM_DEVICE); 12349 + kfree(asc_dvc_varp->overrun_buf); 12350 + } else 12351 + advansys_wide_free_mem(boardp); 12352 + err_free_irq: 12363 12353 free_irq(boardp->irq, shost); 12364 12354 err_free_dma: 12365 12355 #ifdef CONFIG_ISA
+1 -1
drivers/scsi/libiscsi.c
··· 471 471 472 472 WARN_ON(hdrlength >= 256); 473 473 hdr->hlength = hdrlength & 0xFF; 474 + hdr->cmdsn = task->cmdsn = cpu_to_be32(session->cmdsn); 474 475 475 476 if (session->tt->init_task && session->tt->init_task(task)) 476 477 return -EIO; 477 478 478 479 task->state = ISCSI_TASK_RUNNING; 479 - hdr->cmdsn = task->cmdsn = cpu_to_be32(session->cmdsn); 480 480 session->cmdsn++; 481 481 482 482 conn->scsicmd_pdus_cnt++;
+4
drivers/scsi/libsas/sas_ata.c
··· 395 395 void sas_ata_task_abort(struct sas_task *task) 396 396 { 397 397 struct ata_queued_cmd *qc = task->uldd_task; 398 + struct request_queue *q = qc->scsicmd->device->request_queue; 398 399 struct completion *waiting; 400 + unsigned long flags; 399 401 400 402 /* Bounce SCSI-initiated commands to the SCSI EH */ 401 403 if (qc->scsicmd) { 404 + spin_lock_irqsave(q->queue_lock, flags); 402 405 blk_abort_request(qc->scsicmd->request); 406 + spin_unlock_irqrestore(q->queue_lock, flags); 403 407 scsi_schedule_eh(qc->scsicmd->device->host); 404 408 return; 405 409 }
+4
drivers/scsi/libsas/sas_scsi_host.c
··· 1030 1030 void sas_task_abort(struct sas_task *task) 1031 1031 { 1032 1032 struct scsi_cmnd *sc = task->uldd_task; 1033 + struct request_queue *q = sc->device->request_queue; 1034 + unsigned long flags; 1033 1035 1034 1036 /* Escape for libsas internal commands */ 1035 1037 if (!sc) { ··· 1046 1044 return; 1047 1045 } 1048 1046 1047 + spin_lock_irqsave(q->queue_lock, flags); 1049 1048 blk_abort_request(sc->request); 1049 + spin_unlock_irqrestore(q->queue_lock, flags); 1050 1050 scsi_schedule_eh(sc->device->host); 1051 1051 } 1052 1052
+2 -1
drivers/scsi/scsi_debug.c
··· 957 957 static sector_t get_sdebug_capacity(void) 958 958 { 959 959 if (scsi_debug_virtual_gb > 0) 960 - return 2048 * 1024 * (sector_t)scsi_debug_virtual_gb; 960 + return (sector_t)scsi_debug_virtual_gb * 961 + (1073741824 / scsi_debug_sector_size); 961 962 else 962 963 return sdebug_store_sectors; 963 964 }
+14 -1
drivers/scsi/scsi_error.c
··· 302 302 if (scmd->device->allow_restart && 303 303 (sshdr.asc == 0x04) && (sshdr.ascq == 0x02)) 304 304 return FAILED; 305 - return SUCCESS; 305 + 306 + if (blk_barrier_rq(scmd->request)) 307 + /* 308 + * barrier requests should always retry on UA 309 + * otherwise block will get a spurious error 310 + */ 311 + return NEEDS_RETRY; 312 + else 313 + /* 314 + * for normal (non barrier) commands, pass the 315 + * UA upwards for a determination in the 316 + * completion functions 317 + */ 318 + return SUCCESS; 306 319 307 320 /* these three are not supported */ 308 321 case COPY_ABORTED:
+1
drivers/scsi/sd.c
··· 1040 1040 { 1041 1041 rq->cmd_type = REQ_TYPE_BLOCK_PC; 1042 1042 rq->timeout = SD_TIMEOUT; 1043 + rq->retries = SD_MAX_RETRIES; 1043 1044 rq->cmd[0] = SYNCHRONIZE_CACHE; 1044 1045 rq->cmd_len = 10; 1045 1046 }