All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Whitcroft <apw@canonical.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Ben Howard <ben.howard@canonical.com>,
	linux-scsi@vger.kernel.org, devel@linuxdriverproject.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/4] Hyper-V TRIM support
Date: Fri, 13 Sep 2013 16:40:53 +0100	[thread overview]
Message-ID: <20130913154053.GS5382@dm> (raw)
In-Reply-To: <1379084278.2181.3.camel@dabdike.int.hansenpartnership.com>

On Fri, Sep 13, 2013 at 07:57:58AM -0700, James Bottomley wrote:

> This is an awful lot of contortions (which don't seem to have any other
> users on the horizon) to support a device that's not standards
> compliant.  What about this, it's simple, it does the right thing and
> it's contained in the driver of the problem device.
> 
> James
> 
> ---
> 
> diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
> index 83ec1aa..bd86a4b 100644
> --- a/drivers/scsi/storvsc_drv.c
> +++ b/drivers/scsi/storvsc_drv.c
> @@ -1438,6 +1438,12 @@ static int storvsc_device_configure(struct scsi_device *sdevice)
>  
>  	sdevice->no_write_same = 1;
>  
> +	/*
> +	 * hyper-v is stupid and lies about its capabilities
> +	 * If we pretend to be SPC-3, we send RC16 which activates trim
> +	 */
> +	sdevice->scsi_level = SCSI_SPC_3;
> +
>  	return 0;
>  }

I will get that tested and see if there are any other negative side effects.

-apw

  reply	other threads:[~2013-09-13 15:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-13 12:58 [PATCH 0/4] Hyper-V TRIM support Andy Whitcroft
2013-09-13 12:58 ` Andy Whitcroft
2013-09-13 12:58 ` [PATCH 1/4] scsi: add scsi device flag to request VPD pages be used at SPC-2 Andy Whitcroft
2013-09-13 12:58 ` [PATCH 2/4] scsi: add scsi device flag to request READ CAPACITY (16) be preferred Andy Whitcroft
2013-09-13 12:58   ` Andy Whitcroft
2013-09-13 12:58 ` [PATCH 3/4] scsi: hyper-v storage -- mark as VPD capable at SPC-2 Andy Whitcroft
2013-09-13 12:58   ` Andy Whitcroft
2013-09-13 12:58 ` [PATCH 4/4] scsi: hyper-v storage -- mark as preferring READ CAPACITY (16) " Andy Whitcroft
2013-09-13 12:58   ` Andy Whitcroft
2013-09-13 14:57 ` [PATCH 0/4] Hyper-V TRIM support James Bottomley
2013-09-13 15:40   ` Andy Whitcroft [this message]
2013-09-13 15:40 ` Douglas Gilbert

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=20130913154053.GS5382@dm \
    --to=apw@canonical.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=ben.howard@canonical.com \
    --cc=devel@linuxdriverproject.org \
    --cc=haiyangz@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@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.