lkml.org 
[lkml]   [2013]   [Aug]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] scsi disk: Use its own buffer for the vpd request
Whoops, the title is wrong, it should have been:

[PATCH] scsi disk: Limit get_vpd_page buf size

On 08/01/2013 04:34 PM, Bernd Schubert wrote:
> 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;
> }
>
>



\
 
 \ /
  Last update: 2013-08-01 17:01    [W:1.955 / U:1.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site