All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bernd Schubert <bernd.schubert@fastmail.fm>
To: linux-scsi@vger.kernel.org
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
	Nix <nix@esperi.org.uk>,
	nick.cheng@areca.com.tw, stable@vger.kernel.org,
	Douglas Gilbert <dgilbert@interlog.com>,
	"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Subject: [PATCH] scsi disk: Reduce buffer size for vpd request
Date: Mon, 23 Sep 2013 14:47:32 +0200	[thread overview]
Message-ID: <52403864.9020507@fastmail.fm> (raw)
In-Reply-To: <51F95A2E.60805@fastmail.fm>

From: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>

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
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>

---
 drivers/scsi/sd.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index b58e8f8..09a599f 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2644,13 +2644,16 @@ static void sd_read_write_same(struct scsi_disk *sdkp, unsigned char *buffer)
 	struct scsi_device *sdev = sdkp->device;
 
 	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;
 
 		/* Disable WRITE SAME if REPORT SUPPORTED OPERATION
 		 * CODES is unsupported and the device has an ATA
 		 * 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;
 	}
 

  parent reply	other threads:[~2013-09-23 13:03 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-29 10:10 [SCSI REGRESSION] 3.10.2 or 3.10.3: arcmsr failure at bootup / early userspace transition Nick Alcock
2013-07-29 13:01 ` Bernd Schubert
2013-07-29 13:05   ` Nix
2013-07-29 14:16     ` Bernd Schubert
2013-07-29 15:01       ` Nix
2013-07-29 20:04       ` Nix
2013-07-29 20:15         ` Martin K. Petersen
2013-07-29 21:09       ` Nix
2013-07-29 23:34         ` Martin K. Petersen
2013-07-30 18:09           ` Bernd Schubert
2013-07-31  0:07             ` Nick Alcock
2013-07-31  3:19               ` Martin K. Petersen
2013-07-31  3:15             ` Martin K. Petersen
2013-07-31 17:51               ` Bernd Schubert
2013-07-31 18:40                 ` Bernd Schubert
2013-08-01 14:34                   ` [PATCH] scsi disk: Use its own buffer for the vpd request Bernd Schubert
2013-08-01 14:37                     ` Bernd Schubert
2013-08-02  3:00                     ` Martin K. Petersen
2013-08-26 20:15                       ` Bernd Schubert
2013-08-02 23:46                     ` Nick Alcock
2013-08-03 11:17                     ` Nick Alcock
2013-08-30 10:01                     ` Nix
2013-08-31  1:53                       ` Greg KH
2013-08-31 19:48                         ` Nix
2013-09-01 18:40                           ` Bernd Schubert
2013-09-20 22:51                             ` Martin K. Petersen
2013-09-23 12:47                   ` Bernd Schubert [this message]
2013-07-30  0:28         ` [SCSI REGRESSION] 3.10.2 or 3.10.3: arcmsr failure at bootup / early userspace transition Douglas Gilbert
2013-07-30  0:56           ` Nix
2013-07-30 18:14             ` Bernd Schubert
2013-07-30 21:20               ` Nix
2013-08-01 14:55                 ` Bernd Schubert
2013-08-01 16:04                   ` Nix
2013-08-01 16:21                     ` Bernd Schubert
2013-07-31  3:10           ` Martin K. Petersen
2013-07-29 14:27   ` Martin K. Petersen
2013-07-29 14:26 ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52403864.9020507@fastmail.fm \
    --to=bernd.schubert@fastmail.fm \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=dgilbert@interlog.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=nick.cheng@areca.com.tw \
    --cc=nix@esperi.org.uk \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.