aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorBernd Schubert <bernd.schubert@itwm.fraunhofer.de>2013-09-23 08:47:32 -0400
committerJames Bottomley <JBottomley@Parallels.com>2013-10-25 04:58:12 -0400
commitaf73623f5f10eb3832c87a169b28f7df040a875b (patch)
tree0a7d02f6129de16d39abf6100a291b5b149ffa95 /drivers/scsi
parent51d648af5892219cbe97305efb300d3e56746591 (diff)
[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: 66c28f97120e8a621afd5aa7a31c4b85c547d33d 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>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/sd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 5693f6d7eddb..ab96b793f904 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2639,13 +2639,16 @@ static void sd_read_write_same(struct scsi_disk *sdkp, unsigned char *buffer)
2639 struct scsi_device *sdev = sdkp->device; 2639 struct scsi_device *sdev = sdkp->device;
2640 2640
2641 if (scsi_report_opcode(sdev, buffer, SD_BUF_SIZE, INQUIRY) < 0) { 2641 if (scsi_report_opcode(sdev, buffer, SD_BUF_SIZE, INQUIRY) < 0) {
2642 /* too large values might cause issues with arcmsr */
2643 int vpd_buf_len = 64;
2644
2642 sdev->no_report_opcodes = 1; 2645 sdev->no_report_opcodes = 1;
2643 2646
2644 /* Disable WRITE SAME if REPORT SUPPORTED OPERATION 2647 /* Disable WRITE SAME if REPORT SUPPORTED OPERATION
2645 * CODES is unsupported and the device has an ATA 2648 * CODES is unsupported and the device has an ATA
2646 * Information VPD page (SAT). 2649 * Information VPD page (SAT).
2647 */ 2650 */
2648 if (!scsi_get_vpd_page(sdev, 0x89, buffer, SD_BUF_SIZE)) 2651 if (!scsi_get_vpd_page(sdev, 0x89, buffer, vpd_buf_len))
2649 sdev->no_write_same = 1; 2652 sdev->no_write_same = 1;
2650 } 2653 }
2651 2654