forked from mirrors/linux
		
	[SCSI] sd: Reduce buffer size for vpd request
Somehow older areca firmware versions have issues with
scsi_get_vpd_page() and a large buffer, the firmware
seems to crash and the scsi error-handler will start endless
recovery retries.
Limiting the buf-size to 64-bytes fixes this issue with older
firmware versions (<1.49 for my controller).
Fixes a regression with areca controllers and older firmware versions
introduced by commit: 66c28f9712
Reported-by: Nix <nix@esperi.org.uk>
Tested-by: Nix <nix@esperi.org.uk>
Signed-off-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
Cc: stable@vger.kernel.org # delay inclusion for 2 months for testing
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
			
			
This commit is contained in:
		
							parent
							
								
									51d648af58
								
							
						
					
					
						commit
						af73623f5f
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		|  | @ -2639,13 +2639,16 @@ static void sd_read_write_same(struct scsi_disk *sdkp, unsigned char *buffer) | ||||||
| 	struct scsi_device *sdev = sdkp->device; | 	struct scsi_device *sdev = sdkp->device; | ||||||
| 
 | 
 | ||||||
| 	if (scsi_report_opcode(sdev, buffer, SD_BUF_SIZE, INQUIRY) < 0) { | 	if (scsi_report_opcode(sdev, buffer, SD_BUF_SIZE, INQUIRY) < 0) { | ||||||
|  | 		/* too large values might cause issues with arcmsr */ | ||||||
|  | 		int vpd_buf_len = 64; | ||||||
|  | 
 | ||||||
| 		sdev->no_report_opcodes = 1; | 		sdev->no_report_opcodes = 1; | ||||||
| 
 | 
 | ||||||
| 		/* Disable WRITE SAME if REPORT SUPPORTED OPERATION
 | 		/* Disable WRITE SAME if REPORT SUPPORTED OPERATION
 | ||||||
| 		 * CODES is unsupported and the device has an ATA | 		 * CODES is unsupported and the device has an ATA | ||||||
| 		 * Information VPD page (SAT). | 		 * Information VPD page (SAT). | ||||||
| 		 */ | 		 */ | ||||||
| 		if (!scsi_get_vpd_page(sdev, 0x89, buffer, SD_BUF_SIZE)) | 		if (!scsi_get_vpd_page(sdev, 0x89, buffer, vpd_buf_len)) | ||||||
| 			sdev->no_write_same = 1; | 			sdev->no_write_same = 1; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Bernd Schubert
						Bernd Schubert