stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bernd Schubert <bernd.schubert@fastmail.fm>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Nix <nix@esperi.org.uk>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-scsi@vger.kernel.org, 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: Use its own buffer for the vpd request
Date: Thu, 01 Aug 2013 16:34:10 +0200	[thread overview]
Message-ID: <51FA71E2.6010501@fastmail.fm> (raw)
In-Reply-To: <51F95A2E.60805@fastmail.fm>

Once I noticed that scsi_get_vpd_page() works fine from other function
calls and that it is not 0x89, but already 0x0 that fails fixing it became
easy.

Nix, any chance you could verify it also works for you?


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

Somehow older areca firmware versions have issues with
scsi_get_vpd_page() and a large buffer.
Even scsi_get_vpd_page(, page=0,)  failed in sd_read_write_same(),
while a similar request from sd_read_block_limits() worked fine.
Limiting the buf-size to 64-bytes fixes the issue with F/W V1.46.

Fixes a regression with areca controllers and older firmware versions
introduced by commit: 66c28f97120e8a621afd5aa7a31c4b85c547d33d

Reported-by: Nix <nix@esperi.org.uk>
Signed-off-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
CC: stable@vger.kernel.org
---
 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 80f39b8..02e50ae 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2651,13 +2651,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;
 	}
 


  reply	other threads:[~2013-08-01 14:34 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87r4ehfzhf.fsf@spindle.srvr.nix>
     [not found] ` <51F667C2.4020801@fastmail.fm>
     [not found]   ` <87mwp5frdl.fsf@spindle.srvr.nix>
     [not found]     ` <51F67959.2060803@fastmail.fm>
2013-07-29 21:09       ` [SCSI REGRESSION] 3.10.2 or 3.10.3: arcmsr failure at bootup / early userspace transition 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                   ` Bernd Schubert [this message]
2013-08-01 14:37                     ` [PATCH] scsi disk: Use its own buffer for the vpd request 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-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

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=51FA71E2.6010501@fastmail.fm \
    --to=bernd.schubert@fastmail.fm \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=dgilbert@interlog.com \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).