Re: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags

2014-08-01 Thread Sitsofe Wheeler
On Thu, Jul 24, 2014 at 07:40:36AM +0200, Hannes Reinecke wrote:
> On 07/22/2014 01:06 AM, K. Y. Srinivasan wrote:
> >Add blist flags to permit the reading of the VPD pages even when
> >the target may claim SPC-2 compliance. MSFT targets currently
> >claim SPC-2 compliance while they implement post SPC-2 features.
> >With this patch we can correctly handle WRITE_SAME_16 issues.
> >
> >Signed-off-by: K. Y. Srinivasan 
> >
> Reviewed-by: Hannes Reinecke 

On Wed, Jul 23, 2014 at 09:13:41PM +0100, Sitsofe Wheeler wrote:
> On Wed, Jul 23, 2014 at 07:15:58AM -0700, Christoph Hellwig wrote:
> > On Wed, Jul 23, 2014 at 03:10:28PM +0100, Sitsofe Wheeler wrote:
> > > I'm not sure this alone will work - won't sdev_bflags/bflags have
> > > already been built at this point?
> > 
> > They've been built up, but we can still or new values into it.  It looks
> > fine to me from review, but if you can test it on an actualy hypverv
> > setup that would be valueable feedback.
> 
> The previous patches didn't work for me with a Windows 2012 R2 host with a
> 3.16.0-rc6.x86_64-00076-g2f7d2ec-dirty guest. After applying
> https://patchwork.kernel.org/patch/4541201 (which needed a small fixup) and
> https://patchwork.kernel.org/patch/4598601 and the attached debugging output

I've tested f3cfabce7a2e92564d380de3aad4b43901fb7ae6 (Drivers: add blist
flags) from the drivers-for-3.17 branch of scsi-queue
(http://git.infradead.org/users/hch/scsi-queue.git/commit/f3cfabce7a2e92564d380de3aad4b43901fb7ae6
) and this patch still doesn't appear to work (thin provisioning on
Hyper-V's Virtual Disks is not enabled):

# sg_inq  /dev/sda
standard INQUIRY:
  PQual=0  Device_type=0  RMB=0  version=0x04  [SPC-2]
  [AERC=0]  [TrmTsk=0]  NormACA=0  HiSUP=0  Resp_data_format=2
  SCCS=0  ACC=0  TPGS=0  3PC=0  Protect=0  [BQue=0]
  EncServ=0  MultiP=0  [MChngr=0]  [ACKREQQ=0]  Addr16=0
  [RelAdr=0]  WBus16=0  Sync=0  Linked=0  [TranDis=0]  CmdQue=1
length=36 (0x24)   Peripheral device type: disk
 Vendor identification: Msft
 Product identification: Virtual Disk
 Product revision level: 1.0 
# sg_vpd -p lbpv /dev/sda
Logical block provisioning VPD page (SBC):
  Unmap command supported (LBPU): 1
  Write same (16) with unmap bit supported (LBWS): 0
  Write same (10) with unmap bit supported (LBWS10): 0
  Logical block provisioning read zeros (LBPRZ): 0
  Anchored LBAs supported (ANC_SUP): 0
  Threshold exponent: 1
  Descriptor present (DP): 0
  Provisioning type: 2

grep . /sys/block/sd*/device/scsi_disk/*/{thin,prov,rotat,device/model}* | sort
/sys/block/sda/device/scsi_disk/0:0:0:0/device/model:Virtual Disk
/sys/block/sda/device/scsi_disk/0:0:0:0/provisioning_mode:full
/sys/block/sda/device/scsi_disk/0:0:0:0/thin_provisioning:0
/sys/block/sdb/device/scsi_disk/1:0:0:0/device/model:Virtual Disk
/sys/block/sdb/device/scsi_disk/1:0:0:0/provisioning_mode:full
/sys/block/sdb/device/scsi_disk/1:0:0:0/thin_provisioning:0
/sys/block/sdc/device/scsi_disk/1:0:0:2/device/model:00AAKS-00TMA0   
/sys/block/sdc/device/scsi_disk/1:0:0:2/provisioning_mode:full
/sys/block/sdc/device/scsi_disk/1:0:0:2/thin_provisioning:0
/sys/block/sdd/device/scsi_disk/1:0:0:1/device/model:SSD S510 120GB  
/sys/block/sdd/device/scsi_disk/1:0:0:1/provisioning_mode:full
/sys/block/sdd/device/scsi_disk/1:0:0:1/thin_provisioning:0
/sys/block/sde/device/scsi_disk/1:0:0:3/device/model:Virtual Disk
/sys/block/sde/device/scsi_disk/1:0:0:3/provisioning_mode:full
/sys/block/sde/device/scsi_disk/1:0:0:3/thin_provisioning:0
/sys/block/sdf/device/scsi_disk/1:0:0:4/device/model:ST1000DM003-9YN1
/sys/block/sdf/device/scsi_disk/1:0:0:4/provisioning_mode:full
/sys/block/sdf/device/scsi_disk/1:0:0:4/thin_provisioning:0

At least the virtual disks should have thin_provisioning... I was also
expecting the passthrough SSD to be reported as non-rotational with this patch:

# sg_inq /dev/sdd
standard INQUIRY:
  PQual=0  Device_type=0  RMB=0  version=0x00  [no conformance claimed]
  [AERC=0]  [TrmTsk=0]  NormACA=0  HiSUP=0  Resp_data_format=2
  SCCS=0  ACC=0  TPGS=0  3PC=0  Protect=0  [BQue=0]
  EncServ=0  MultiP=0  [MChngr=0]  [ACKREQQ=0]  Addr16=0
  [RelAdr=0]  WBus16=0  Sync=0  Linked=0  [TranDis=0]  CmdQue=1
  [SPI: Clocking=0x0  QAS=0  IUS=0]
length=60 (0x3c)   Peripheral device type: disk
 Vendor identification: ADATA   
 Product identification: SSD S510 120GB
 Product revision level: 5.2.
 Unit serial number: 0320511550032076
# sg_vpd -p bdc /dev/sdd
Block device characteristics VPD page (SBC):
  Non-rotating medium (e.g. solid state)
  Product type: Not specified
  WABEREQ=0
  WACEREQ=0
  Nominal form factor not reported
  FUAB=0
  VBULS=0
# grep -H . /sys/block/sdd/queue/rot*
/sys/block/sdd/queue/rotational:1

-- 
Sitsofe | http://sucs.org/~sits/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  

Re: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags

2014-08-01 Thread Sitsofe Wheeler
On Thu, Jul 24, 2014 at 07:40:36AM +0200, Hannes Reinecke wrote:
 On 07/22/2014 01:06 AM, K. Y. Srinivasan wrote:
 Add blist flags to permit the reading of the VPD pages even when
 the target may claim SPC-2 compliance. MSFT targets currently
 claim SPC-2 compliance while they implement post SPC-2 features.
 With this patch we can correctly handle WRITE_SAME_16 issues.
 
 Signed-off-by: K. Y. Srinivasan k...@microsoft.com
 
 Reviewed-by: Hannes Reinecke h...@suse.de

On Wed, Jul 23, 2014 at 09:13:41PM +0100, Sitsofe Wheeler wrote:
 On Wed, Jul 23, 2014 at 07:15:58AM -0700, Christoph Hellwig wrote:
  On Wed, Jul 23, 2014 at 03:10:28PM +0100, Sitsofe Wheeler wrote:
   I'm not sure this alone will work - won't sdev_bflags/bflags have
   already been built at this point?
  
  They've been built up, but we can still or new values into it.  It looks
  fine to me from review, but if you can test it on an actualy hypverv
  setup that would be valueable feedback.
 
 The previous patches didn't work for me with a Windows 2012 R2 host with a
 3.16.0-rc6.x86_64-00076-g2f7d2ec-dirty guest. After applying
 https://patchwork.kernel.org/patch/4541201 (which needed a small fixup) and
 https://patchwork.kernel.org/patch/4598601 and the attached debugging output

I've tested f3cfabce7a2e92564d380de3aad4b43901fb7ae6 (Drivers: add blist
flags) from the drivers-for-3.17 branch of scsi-queue
(http://git.infradead.org/users/hch/scsi-queue.git/commit/f3cfabce7a2e92564d380de3aad4b43901fb7ae6
) and this patch still doesn't appear to work (thin provisioning on
Hyper-V's Virtual Disks is not enabled):

# sg_inq  /dev/sda
standard INQUIRY:
  PQual=0  Device_type=0  RMB=0  version=0x04  [SPC-2]
  [AERC=0]  [TrmTsk=0]  NormACA=0  HiSUP=0  Resp_data_format=2
  SCCS=0  ACC=0  TPGS=0  3PC=0  Protect=0  [BQue=0]
  EncServ=0  MultiP=0  [MChngr=0]  [ACKREQQ=0]  Addr16=0
  [RelAdr=0]  WBus16=0  Sync=0  Linked=0  [TranDis=0]  CmdQue=1
length=36 (0x24)   Peripheral device type: disk
 Vendor identification: Msft
 Product identification: Virtual Disk
 Product revision level: 1.0 
# sg_vpd -p lbpv /dev/sda
Logical block provisioning VPD page (SBC):
  Unmap command supported (LBPU): 1
  Write same (16) with unmap bit supported (LBWS): 0
  Write same (10) with unmap bit supported (LBWS10): 0
  Logical block provisioning read zeros (LBPRZ): 0
  Anchored LBAs supported (ANC_SUP): 0
  Threshold exponent: 1
  Descriptor present (DP): 0
  Provisioning type: 2

grep . /sys/block/sd*/device/scsi_disk/*/{thin,prov,rotat,device/model}* | sort
/sys/block/sda/device/scsi_disk/0:0:0:0/device/model:Virtual Disk
/sys/block/sda/device/scsi_disk/0:0:0:0/provisioning_mode:full
/sys/block/sda/device/scsi_disk/0:0:0:0/thin_provisioning:0
/sys/block/sdb/device/scsi_disk/1:0:0:0/device/model:Virtual Disk
/sys/block/sdb/device/scsi_disk/1:0:0:0/provisioning_mode:full
/sys/block/sdb/device/scsi_disk/1:0:0:0/thin_provisioning:0
/sys/block/sdc/device/scsi_disk/1:0:0:2/device/model:00AAKS-00TMA0   
/sys/block/sdc/device/scsi_disk/1:0:0:2/provisioning_mode:full
/sys/block/sdc/device/scsi_disk/1:0:0:2/thin_provisioning:0
/sys/block/sdd/device/scsi_disk/1:0:0:1/device/model:SSD S510 120GB  
/sys/block/sdd/device/scsi_disk/1:0:0:1/provisioning_mode:full
/sys/block/sdd/device/scsi_disk/1:0:0:1/thin_provisioning:0
/sys/block/sde/device/scsi_disk/1:0:0:3/device/model:Virtual Disk
/sys/block/sde/device/scsi_disk/1:0:0:3/provisioning_mode:full
/sys/block/sde/device/scsi_disk/1:0:0:3/thin_provisioning:0
/sys/block/sdf/device/scsi_disk/1:0:0:4/device/model:ST1000DM003-9YN1
/sys/block/sdf/device/scsi_disk/1:0:0:4/provisioning_mode:full
/sys/block/sdf/device/scsi_disk/1:0:0:4/thin_provisioning:0

At least the virtual disks should have thin_provisioning... I was also
expecting the passthrough SSD to be reported as non-rotational with this patch:

# sg_inq /dev/sdd
standard INQUIRY:
  PQual=0  Device_type=0  RMB=0  version=0x00  [no conformance claimed]
  [AERC=0]  [TrmTsk=0]  NormACA=0  HiSUP=0  Resp_data_format=2
  SCCS=0  ACC=0  TPGS=0  3PC=0  Protect=0  [BQue=0]
  EncServ=0  MultiP=0  [MChngr=0]  [ACKREQQ=0]  Addr16=0
  [RelAdr=0]  WBus16=0  Sync=0  Linked=0  [TranDis=0]  CmdQue=1
  [SPI: Clocking=0x0  QAS=0  IUS=0]
length=60 (0x3c)   Peripheral device type: disk
 Vendor identification: ADATA   
 Product identification: SSD S510 120GB
 Product revision level: 5.2.
 Unit serial number: 0320511550032076
# sg_vpd -p bdc /dev/sdd
Block device characteristics VPD page (SBC):
  Non-rotating medium (e.g. solid state)
  Product type: Not specified
  WABEREQ=0
  WACEREQ=0
  Nominal form factor not reported
  FUAB=0
  VBULS=0
# grep -H . /sys/block/sdd/queue/rot*
/sys/block/sdd/queue/rotational:1

-- 
Sitsofe | http://sucs.org/~sits/
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  

Re: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags

2014-07-23 Thread Hannes Reinecke

On 07/22/2014 01:06 AM, K. Y. Srinivasan wrote:

Add blist flags to permit the reading of the VPD pages even when
the target may claim SPC-2 compliance. MSFT targets currently
claim SPC-2 compliance while they implement post SPC-2 features.
With this patch we can correctly handle WRITE_SAME_16 issues.

Signed-off-by: K. Y. Srinivasan 
---
  drivers/scsi/storvsc_drv.c |   10 ++
  1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 29d0329..15ba695 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -327,6 +327,8 @@ MODULE_PARM_DESC(storvsc_ringbuffer_size, "Ring buffer size 
(bytes)");
   */
  static int storvsc_timeout = 180;

+static int msft_blist_flags = BLIST_TRY_VPD_PAGES;
+
  #define STORVSC_MAX_IO_REQUESTS   200

  static void storvsc_on_channel_callback(void *context);
@@ -1449,6 +1451,14 @@ static int storvsc_device_configure(struct scsi_device 
*sdevice)

sdevice->no_write_same = 1;

+   /*
+* Add blist flags to permit the reading of the VPD pages even when
+* the target may claim SPC-2 compliance. MSFT targets currently
+* claim SPC-2 compliance while they implement post SPC-2 features.
+* With this patch we can correctly handle WRITE_SAME_16 issues.
+*/
+   sdevice->sdev_bflags |= msft_blist_flags;
+
return 0;
  }



Reviewed-by: Hannes Reinecke 

Cheers,

Hannes
--
Dr. Hannes Reinecke   zSeries & Storage
h...@suse.de  +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags

2014-07-23 Thread Sitsofe Wheeler
On Wed, Jul 23, 2014 at 07:15:58AM -0700, Christoph Hellwig wrote:
> On Wed, Jul 23, 2014 at 03:10:28PM +0100, Sitsofe Wheeler wrote:
> > I'm not sure this alone will work - won't sdev_bflags/bflags have
> > already been built at this point?
> 
> They've been built up, but we can still or new values into it.  It looks
> fine to me from review, but if you can test it on an actualy hypverv
> setup that would be valueable feedback.

The previous patches didn't work for me with a Windows 2012 R2 host with a
3.16.0-rc6.x86_64-00076-g2f7d2ec-dirty guest. After applying
https://patchwork.kernel.org/patch/4541201 (which needed a small fixup) and
https://patchwork.kernel.org/patch/4598601 and the attached debugging output
patch here's the result I got:

hv_vmbus: registering driver hv_storvsc
scsi0 : storvsc_host_t
scsi 0:0:0:0: scsi_get_device_flags_keyed: key: 3
scsi 0:0:0:0: scsi_get_device_flags_keyed: Post SCSI_DEVINFO_GLOBAL
scsi 0:0:0:0: scsi_get_device_flags_keyed: No sdev_bflags
scsi 0:0:0:0: sdev->scsi_level: 5
scsi 0:0:0:0: Direct-Access Msft Virtual Disk 1.0  PQ: 0 ANSI: 4
scsi 0:0:0:0: scsi_add_lun: Have BLIST_TRY_VPD_PAGES? No
scsi 0:0:0:0: storvsc_device_configure: Added BLIST_TRY_VPD_PAGES
scsi1 : storvsc_host_t
sd 0:0:0:0: Attached scsi generic sg0 type 0
scsi 1:0:0:0: scsi_get_device_flags_keyed: key: 3
scsi 1:0:0:0: scsi_get_device_flags_keyed: Post SCSI_DEVINFO_GLOBAL
scsi 1:0:0:0: scsi_get_device_flags_keyed: No sdev_bflags
scsi 1:0:0:0: sdev->scsi_level: 5
scsi 1:0:0:0: Direct-Access Msft Virtual Disk 1.0  PQ: 0 ANSI: 4
scsi 1:0:0:0: scsi_add_lun: Have BLIST_TRY_VPD_PAGES? No
scsi 1:0:0:0: storvsc_device_configure: Added BLIST_TRY_VPD_PAGES
scsi 1:0:0:1: scsi_get_device_flags_keyed: key: 5
scsi 1:0:0:1: scsi_get_device_flags_keyed: Post SCSI_DEVINFO_GLOBAL
scsi 1:0:0:1: scsi_get_device_flags_keyed: No sdev_bflags
scsi 1:0:0:1: scsi_get_device_flags_keyed: key: 5
scsi 1:0:0:1: scsi_get_device_flags_keyed: Post SCSI_DEVINFO_GLOBAL
scsi 1:0:0:1: scsi_get_device_flags_keyed: No sdev_bflags
scsi 1:0:0:1: sdev->scsi_level: 0
scsi 1:0:0:1: Direct-Access ADATASSD S510 120GB   5.2. PQ: 0 ANSI: 0
scsi 1:0:0:1: scsi_add_lun: Have BLIST_TRY_VPD_PAGES? No
scsi 1:0:0:1: storvsc_device_configure: Added BLIST_TRY_VPD_PAGES
scsi 1:0:0:3: scsi_get_device_flags_keyed: key: 0
scsi 1:0:0:3: scsi_get_device_flags_keyed: Post SCSI_DEVINFO_GLOBAL
scsi 1:0:0:3: scsi_get_device_flags_keyed: No sdev_bflags
scsi 1:0:0:3: sdev->scsi_level: 5
scsi 1:0:0:3: Direct-Access Msft Virtual Disk 1.0  PQ: 0 ANSI: 4
scsi 1:0:0:3: scsi_add_lun: Have BLIST_TRY_VPD_PAGES? No
scsi 1:0:0:3: storvsc_device_configure: Added BLIST_TRY_VPD_PAGES
sd 1:0:0:0: sd_try_rc16_first: sdp->scsi_level: 5
sd 1:0:0:0: [sdb] 2097152 512-byte logical blocks: (1.07 GB/1.00 GiB)
sd 1:0:0:0: [sdb] sd_revalidate_disk: Extended inquiry check...
sd 1:0:0:0: [sdb] sd_revalidate_disk: Skipped extended inquiries
sd 1:0:0:0: [sdb] Write Protect is off
sd 1:0:0:0: [sdb] Mode Sense: 0f 00 00 00
sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support 
DPO or FUA
sd 0:0:0:0: sd_try_rc16_first: sdp->scsi_level: 5
ata_piix :00:07.1: version 2.13
sd 1:0:0:0: sd_try_rc16_first: sdp->scsi_level: 5
sd 1:0:0:0: [sdb] sd_revalidate_disk: Extended inquiry check...
sd 1:0:0:0: [sdb] sd_revalidate_disk: Skipped extended inquiries
 sdb: unknown partition table
ata_piix :00:07.1: Hyper-V Virtual Machine detected, ATA device ignore set
sd 1:0:0:0: sd_try_rc16_first: sdp->scsi_level: 5
sd 1:0:0:0: [sdb] sd_revalidate_disk: Extended inquiry check...
sd 1:0:0:0: [sdb] sd_revalidate_disk: Skipped extended inquiries
sd 1:0:0:0: [sdb] Attached SCSI disk
sd 1:0:0:0: Attached scsi generic sg1 type 0
sd 0:0:0:0: [sda] 8388608 512-byte logical blocks: (4.29 GB/4.00 GiB)
scsi2 : ata_piix
scsi3 : ata_piix
ata1: PATA max UDMA/33 cmd 0x1f0 ctl 0x3f6 bmdma 0xffa0 irq 14
ata2: PATA max UDMA/33 cmd 0x170 ctl 0x376 bmdma 0xffa8 irq 15
sd 1:0:0:1: Attached scsi generic sg2 type 0
libphy: Fixed MDIO Bus: probed
hv_vmbus: registering driver hv_netvsc
sd 1:0:0:3: Attached scsi generic sg3 type 0
hv_netvsc: hv_netvsc channel opened successfully
sd 0:0:0:0: [sda] sd_revalidate_disk: Extended inquiry check...
sd 0:0:0:0: [sda] sd_revalidate_disk: Skipped extended inquiries
sd 1:0:0:1: sd_try_rc16_first: sdp->scsi_level: 0
sd 1:0:0:3: sd_try_rc16_first: sdp->scsi_level: 5
sd 1:0:0:1: [sdc] 234441648 512-byte logical blocks: (120 GB/111 GiB)
sd 1:0:0:1: [sdc] sd_revalidate_disk: Extended inquiry check...
sd 1:0:0:1: [sdc] sd_revalidate_disk: Skipped extended inquiries
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 0f 00 00 00
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support 
DPO or FUA
sd 0:0:0:0: sd_try_rc16_first: sdp->scsi_level: 5
sd 0:0:0:0: [sda] sd_revalidate_disk: Extended inquiry check...
sd 0:0:0:0: [sda] sd_revalidate_disk: Skipped extended inquiries
 sda: sda1
sd 0:0:0:0: 

RE: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags

2014-07-23 Thread KY Srinivasan


> -Original Message-
> From: Christoph Hellwig [mailto:h...@infradead.org]
> Sent: Wednesday, July 23, 2014 7:10 AM
> To: Sitsofe Wheeler
> Cc: KY Srinivasan; gre...@linuxfoundation.org; linux-
> ker...@vger.kernel.org; de...@linuxdriverproject.org; oher...@suse.com;
> a...@canonical.com; jasow...@redhat.com; jbottom...@parallels.com;
> linux-s...@vger.kernel.org
> Subject: Re: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags
> 
> On Wed, Jul 23, 2014 at 01:54:43PM +0100, Sitsofe Wheeler wrote:
> > That's good to know (I was worried the device would not be detected as
> > supporting discard because it doesn't report lbpme and doesn't declare
> > a conformance version (see below)).
> 
> Ok, that makes things worse - you might be able to force it through sysfs,
> though.
> 
> > Is there a tree with all these updates in or do they need to be pieced
> > together from this email thread?
> 
> I'm picking this up for my scsi-queue tree.  Still need a review for the patch
> we're replying to before that one can go in, though.

Hannes, could you please review this patch. Christoph, other than the review of 
this patch,
Is there something you want done before these can be committed.

Regards,

K. Y
> 
> > Additionally is it worth quirking sd_try_rc16_first on when
> > BLIST_TRY_VPD_PAGES is present?
> 
> Sounds reasonable to me.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags

2014-07-23 Thread KY Srinivasan


> -Original Message-
> From: Sitsofe Wheeler [mailto:sits...@gmail.com]
> Sent: Wednesday, July 23, 2014 3:05 AM
> To: KY Srinivasan
> Cc: gre...@linuxfoundation.org; linux-kernel@vger.kernel.org;
> de...@linuxdriverproject.org; oher...@suse.com; a...@canonical.com;
> jasow...@redhat.com; jbottom...@parallels.com; h...@infradead.org;
> linux-s...@vger.kernel.org
> Subject: Re: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags
> 
> On Mon, Jul 21, 2014 at 04:06:01PM -0700, K. Y. Srinivasan wrote:
> > Add blist flags to permit the reading of the VPD pages even when the
> > target may claim SPC-2 compliance. MSFT targets currently claim SPC-2
> > compliance while they implement post SPC-2 features.
> > With this patch we can correctly handle WRITE_SAME_16 issues.
> 
> OK I've just seen this as I was about to post a similar patch to get discard
> going on Hyper-V. Will your patches handle Hyper-V pass through devices
> that support discard? The SSD I have here reports the following in the Linux

It should. Hyper-V does support pass through devices.

K. Y
> VM:
> 
> # sg_vpd -p lbpv  /dev/sdc
> Logical block provisioning VPD page (SBC):
>   Unmap command supported (LBPU): 1
>   Write same (16) with unmap bit supported (LBWS): 0
>   Write same (10) with unmap bit supported (LBWS10): 0
>   Logical block provisioning read zeros (LBPRZ): 0
>   Anchored LBAs supported (ANC_SUP): 1
>   Threshold exponent: 0
>   Descriptor present (DP): 0
>   Provisioning type: 0
> 
> # sg_readcap -l /dev/sdc
> Read Capacity results:
>Protection: prot_en=0, p_type=0, p_i_exponent=0
>Logical block provisioning: lbpme=0, lbprz=0
>Last logical block address=234441647 (0xdf94baf), Number of logical
> blocks=234441648
>Logical block length=512 bytes
>Logical blocks per physical block exponent=0
>Lowest aligned logical block address=0
> Hence:
>Device size: 120034123776 bytes, 114473.5 MiB, 120.03 GB
> 
> --
> Sitsofe | http://sucs.org/~sits/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags

2014-07-23 Thread Sitsofe Wheeler
On Wed, Jul 23, 2014 at 07:10:14AM -0700, Christoph Hellwig wrote:
> On Wed, Jul 23, 2014 at 01:54:43PM +0100, Sitsofe Wheeler wrote:
> > That's good to know (I was worried the device would not be detected as
> > supporting discard because it doesn't report lbpme and doesn't declare a
> > conformance version (see below)).
> 
> Ok, that makes things worse - you might be able to force it through
> sysfs, though.

I've got a hack that seems to be working for me - see below.

> > Is there a tree with all these updates
> > in or do they need to be pieced together from this email thread?
> 
> I'm picking this up for my scsi-queue tree.  Still need a review
> for the patch we're replying to before that one can go in, though.

OK.

> > Additionally is it worth quirking sd_try_rc16_first on when
> > BLIST_TRY_VPD_PAGES is present?
> 
> Sounds reasonable to me.

OK did you want me to post a set of changes to your patch? I've
basically changed the patches from bypassing the SCSI level check (to
allow scanning of VPD pages) to also try READ_CAPACITY(16) first and
bypass lbpme checks. Now it's more of a case of BLIST_TRY_LBP...

-- 
Sitsofe | http://sucs.org/~sits/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags

2014-07-23 Thread Christoph Hellwig
On Wed, Jul 23, 2014 at 03:10:28PM +0100, Sitsofe Wheeler wrote:
> I'm not sure this alone will work - won't sdev_bflags/bflags have
> already been built at this point?

They've been built up, but we can still or new values into it.  It looks
fine to me from review, but if you can test it on an actualy hypverv
setup that would be valueable feedback.

> If the setting of this has to stay in
> this function why don't you (also) set sdevice->try_vpd_pages in a
> similar way to no_write_same?

We could probably do that.  I don't actually like this whole split
between the blacklist flags, and the bitfields.  I'll see if we can
just get rid of those bitfields an always just use the blacklist
flags directly, now that we have precedence of setting them in drivers
and not just the table keyed by the inquiry data.  But that's a longer
term project, this late in the 3.17 cycle I'd just like to merge
something that gets discards on hyperv to work.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags

2014-07-23 Thread Sitsofe Wheeler
On Mon, Jul 21, 2014 at 04:06:01PM -0700, K. Y. Srinivasan wrote:
> Add blist flags to permit the reading of the VPD pages even when
> the target may claim SPC-2 compliance. MSFT targets currently
> claim SPC-2 compliance while they implement post SPC-2 features.
> With this patch we can correctly handle WRITE_SAME_16 issues.
> 
>  static void storvsc_on_channel_callback(void *context);
> @@ -1449,6 +1451,14 @@ static int storvsc_device_configure(struct scsi_device 
> *sdevice)
>  
>   sdevice->no_write_same = 1;
>  
> + /*
> +  * Add blist flags to permit the reading of the VPD pages even when
> +  * the target may claim SPC-2 compliance. MSFT targets currently
> +  * claim SPC-2 compliance while they implement post SPC-2 features.
> +  * With this patch we can correctly handle WRITE_SAME_16 issues.
> +  */
> + sdevice->sdev_bflags |= msft_blist_flags;
> +

I'm not sure this alone will work - won't sdev_bflags/bflags have
already been built at this point? If the setting of this has to stay in
this function why don't you (also) set sdevice->try_vpd_pages in a
similar way to no_write_same?

-- 
Sitsofe | http://sucs.org/~sits/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags

2014-07-23 Thread Christoph Hellwig
On Wed, Jul 23, 2014 at 01:54:43PM +0100, Sitsofe Wheeler wrote:
> That's good to know (I was worried the device would not be detected as
> supporting discard because it doesn't report lbpme and doesn't declare a
> conformance version (see below)).

Ok, that makes things worse - you might be able to force it through
sysfs, though.

> Is there a tree with all these updates
> in or do they need to be pieced together from this email thread?

I'm picking this up for my scsi-queue tree.  Still need a review
for the patch we're replying to before that one can go in, though.

> Additionally is it worth quirking sd_try_rc16_first on when
> BLIST_TRY_VPD_PAGES is present?

Sounds reasonable to me.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags

2014-07-23 Thread Sitsofe Wheeler
On Wed, Jul 23, 2014 at 04:51:28AM -0700, Christoph Hellwig wrote:
> On Wed, Jul 23, 2014 at 11:04:48AM +0100, Sitsofe Wheeler wrote:
> > OK I've just seen this as I was about to post a similar patch to get
> > discard going on Hyper-V. Will your patches handle Hyper-V pass through 
> > devices
> > that support discard? The SSD I have here reports the following in the Linux
> > VM:
> 
> I didn't know hyperv also supports pass through, but it should work fine.
> The only thing I'm worried about is real SCSI-2 devices or crappy USB
> devices that don't support EVPD pages and might cause problems.  But
> let's ignore that problem for now..

That's good to know (I was worried the device would not be detected as
supporting discard because it doesn't report lbpme and doesn't declare a
conformance version (see below)). Is there a tree with all these updates
in or do they need to be pieced together from this email thread?

Additionally is it worth quirking sd_try_rc16_first on when
BLIST_TRY_VPD_PAGES is present?

# sg_inq  /dev/sdc
standard INQUIRY:
  PQual=0  Device_type=0  RMB=0  version=0x00  [no conformance claimed]
  [AERC=0]  [TrmTsk=0]  NormACA=0  HiSUP=0  Resp_data_format=2
  SCCS=0  ACC=0  TPGS=0  3PC=0  Protect=0  [BQue=0]
  EncServ=0  MultiP=0  [MChngr=0]  [ACKREQQ=0]  Addr16=0
  [RelAdr=0]  WBus16=0  Sync=0  Linked=0  [TranDis=0]  CmdQue=1
  [SPI: Clocking=0x0  QAS=0  IUS=0]
length=60 (0x3c)   Peripheral device type: disk
 Vendor identification: ADATA   
 Product identification: SSD S510 120GB
 Product revision level: 5.2.
 Unit serial number: 0320511550032076

-- 
Sitsofe | http://sucs.org/~sits/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags

2014-07-23 Thread Christoph Hellwig
On Wed, Jul 23, 2014 at 11:04:48AM +0100, Sitsofe Wheeler wrote:
> OK I've just seen this as I was about to post a similar patch to get
> discard going on Hyper-V. Will your patches handle Hyper-V pass through 
> devices
> that support discard? The SSD I have here reports the following in the Linux
> VM:

I didn't know hyperv also supports pass through, but it should work fine.
The only thing I'm worried about is real SCSI-2 devices or crappy USB
devices that don't support EVPD pages and might cause problems.  But
let's ignore that problem for now..

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags

2014-07-23 Thread Sitsofe Wheeler
On Mon, Jul 21, 2014 at 04:06:01PM -0700, K. Y. Srinivasan wrote:
> Add blist flags to permit the reading of the VPD pages even when
> the target may claim SPC-2 compliance. MSFT targets currently
> claim SPC-2 compliance while they implement post SPC-2 features.
> With this patch we can correctly handle WRITE_SAME_16 issues.

OK I've just seen this as I was about to post a similar patch to get
discard going on Hyper-V. Will your patches handle Hyper-V pass through devices
that support discard? The SSD I have here reports the following in the Linux
VM:

# sg_vpd -p lbpv  /dev/sdc
Logical block provisioning VPD page (SBC):
  Unmap command supported (LBPU): 1
  Write same (16) with unmap bit supported (LBWS): 0
  Write same (10) with unmap bit supported (LBWS10): 0
  Logical block provisioning read zeros (LBPRZ): 0
  Anchored LBAs supported (ANC_SUP): 1
  Threshold exponent: 0
  Descriptor present (DP): 0
  Provisioning type: 0

# sg_readcap -l /dev/sdc
Read Capacity results:
   Protection: prot_en=0, p_type=0, p_i_exponent=0
   Logical block provisioning: lbpme=0, lbprz=0
   Last logical block address=234441647 (0xdf94baf), Number of logical 
blocks=234441648
   Logical block length=512 bytes
   Logical blocks per physical block exponent=0
   Lowest aligned logical block address=0
Hence:
   Device size: 120034123776 bytes, 114473.5 MiB, 120.03 GB

-- 
Sitsofe | http://sucs.org/~sits/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags

2014-07-23 Thread Sitsofe Wheeler
On Mon, Jul 21, 2014 at 04:06:01PM -0700, K. Y. Srinivasan wrote:
 Add blist flags to permit the reading of the VPD pages even when
 the target may claim SPC-2 compliance. MSFT targets currently
 claim SPC-2 compliance while they implement post SPC-2 features.
 With this patch we can correctly handle WRITE_SAME_16 issues.

OK I've just seen this as I was about to post a similar patch to get
discard going on Hyper-V. Will your patches handle Hyper-V pass through devices
that support discard? The SSD I have here reports the following in the Linux
VM:

# sg_vpd -p lbpv  /dev/sdc
Logical block provisioning VPD page (SBC):
  Unmap command supported (LBPU): 1
  Write same (16) with unmap bit supported (LBWS): 0
  Write same (10) with unmap bit supported (LBWS10): 0
  Logical block provisioning read zeros (LBPRZ): 0
  Anchored LBAs supported (ANC_SUP): 1
  Threshold exponent: 0
  Descriptor present (DP): 0
  Provisioning type: 0

# sg_readcap -l /dev/sdc
Read Capacity results:
   Protection: prot_en=0, p_type=0, p_i_exponent=0
   Logical block provisioning: lbpme=0, lbprz=0
   Last logical block address=234441647 (0xdf94baf), Number of logical 
blocks=234441648
   Logical block length=512 bytes
   Logical blocks per physical block exponent=0
   Lowest aligned logical block address=0
Hence:
   Device size: 120034123776 bytes, 114473.5 MiB, 120.03 GB

-- 
Sitsofe | http://sucs.org/~sits/
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags

2014-07-23 Thread Christoph Hellwig
On Wed, Jul 23, 2014 at 11:04:48AM +0100, Sitsofe Wheeler wrote:
 OK I've just seen this as I was about to post a similar patch to get
 discard going on Hyper-V. Will your patches handle Hyper-V pass through 
 devices
 that support discard? The SSD I have here reports the following in the Linux
 VM:

I didn't know hyperv also supports pass through, but it should work fine.
The only thing I'm worried about is real SCSI-2 devices or crappy USB
devices that don't support EVPD pages and might cause problems.  But
let's ignore that problem for now..

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags

2014-07-23 Thread Sitsofe Wheeler
On Wed, Jul 23, 2014 at 04:51:28AM -0700, Christoph Hellwig wrote:
 On Wed, Jul 23, 2014 at 11:04:48AM +0100, Sitsofe Wheeler wrote:
  OK I've just seen this as I was about to post a similar patch to get
  discard going on Hyper-V. Will your patches handle Hyper-V pass through 
  devices
  that support discard? The SSD I have here reports the following in the Linux
  VM:
 
 I didn't know hyperv also supports pass through, but it should work fine.
 The only thing I'm worried about is real SCSI-2 devices or crappy USB
 devices that don't support EVPD pages and might cause problems.  But
 let's ignore that problem for now..

That's good to know (I was worried the device would not be detected as
supporting discard because it doesn't report lbpme and doesn't declare a
conformance version (see below)). Is there a tree with all these updates
in or do they need to be pieced together from this email thread?

Additionally is it worth quirking sd_try_rc16_first on when
BLIST_TRY_VPD_PAGES is present?

# sg_inq  /dev/sdc
standard INQUIRY:
  PQual=0  Device_type=0  RMB=0  version=0x00  [no conformance claimed]
  [AERC=0]  [TrmTsk=0]  NormACA=0  HiSUP=0  Resp_data_format=2
  SCCS=0  ACC=0  TPGS=0  3PC=0  Protect=0  [BQue=0]
  EncServ=0  MultiP=0  [MChngr=0]  [ACKREQQ=0]  Addr16=0
  [RelAdr=0]  WBus16=0  Sync=0  Linked=0  [TranDis=0]  CmdQue=1
  [SPI: Clocking=0x0  QAS=0  IUS=0]
length=60 (0x3c)   Peripheral device type: disk
 Vendor identification: ADATA   
 Product identification: SSD S510 120GB
 Product revision level: 5.2.
 Unit serial number: 0320511550032076

-- 
Sitsofe | http://sucs.org/~sits/
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags

2014-07-23 Thread Christoph Hellwig
On Wed, Jul 23, 2014 at 01:54:43PM +0100, Sitsofe Wheeler wrote:
 That's good to know (I was worried the device would not be detected as
 supporting discard because it doesn't report lbpme and doesn't declare a
 conformance version (see below)).

Ok, that makes things worse - you might be able to force it through
sysfs, though.

 Is there a tree with all these updates
 in or do they need to be pieced together from this email thread?

I'm picking this up for my scsi-queue tree.  Still need a review
for the patch we're replying to before that one can go in, though.

 Additionally is it worth quirking sd_try_rc16_first on when
 BLIST_TRY_VPD_PAGES is present?

Sounds reasonable to me.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags

2014-07-23 Thread Sitsofe Wheeler
On Mon, Jul 21, 2014 at 04:06:01PM -0700, K. Y. Srinivasan wrote:
 Add blist flags to permit the reading of the VPD pages even when
 the target may claim SPC-2 compliance. MSFT targets currently
 claim SPC-2 compliance while they implement post SPC-2 features.
 With this patch we can correctly handle WRITE_SAME_16 issues.
 
  static void storvsc_on_channel_callback(void *context);
 @@ -1449,6 +1451,14 @@ static int storvsc_device_configure(struct scsi_device 
 *sdevice)
  
   sdevice-no_write_same = 1;
  
 + /*
 +  * Add blist flags to permit the reading of the VPD pages even when
 +  * the target may claim SPC-2 compliance. MSFT targets currently
 +  * claim SPC-2 compliance while they implement post SPC-2 features.
 +  * With this patch we can correctly handle WRITE_SAME_16 issues.
 +  */
 + sdevice-sdev_bflags |= msft_blist_flags;
 +

I'm not sure this alone will work - won't sdev_bflags/bflags have
already been built at this point? If the setting of this has to stay in
this function why don't you (also) set sdevice-try_vpd_pages in a
similar way to no_write_same?

-- 
Sitsofe | http://sucs.org/~sits/
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags

2014-07-23 Thread Christoph Hellwig
On Wed, Jul 23, 2014 at 03:10:28PM +0100, Sitsofe Wheeler wrote:
 I'm not sure this alone will work - won't sdev_bflags/bflags have
 already been built at this point?

They've been built up, but we can still or new values into it.  It looks
fine to me from review, but if you can test it on an actualy hypverv
setup that would be valueable feedback.

 If the setting of this has to stay in
 this function why don't you (also) set sdevice-try_vpd_pages in a
 similar way to no_write_same?

We could probably do that.  I don't actually like this whole split
between the blacklist flags, and the bitfields.  I'll see if we can
just get rid of those bitfields an always just use the blacklist
flags directly, now that we have precedence of setting them in drivers
and not just the table keyed by the inquiry data.  But that's a longer
term project, this late in the 3.17 cycle I'd just like to merge
something that gets discards on hyperv to work.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags

2014-07-23 Thread Sitsofe Wheeler
On Wed, Jul 23, 2014 at 07:10:14AM -0700, Christoph Hellwig wrote:
 On Wed, Jul 23, 2014 at 01:54:43PM +0100, Sitsofe Wheeler wrote:
  That's good to know (I was worried the device would not be detected as
  supporting discard because it doesn't report lbpme and doesn't declare a
  conformance version (see below)).
 
 Ok, that makes things worse - you might be able to force it through
 sysfs, though.

I've got a hack that seems to be working for me - see below.

  Is there a tree with all these updates
  in or do they need to be pieced together from this email thread?
 
 I'm picking this up for my scsi-queue tree.  Still need a review
 for the patch we're replying to before that one can go in, though.

OK.

  Additionally is it worth quirking sd_try_rc16_first on when
  BLIST_TRY_VPD_PAGES is present?
 
 Sounds reasonable to me.

OK did you want me to post a set of changes to your patch? I've
basically changed the patches from bypassing the SCSI level check (to
allow scanning of VPD pages) to also try READ_CAPACITY(16) first and
bypass lbpme checks. Now it's more of a case of BLIST_TRY_LBP...

-- 
Sitsofe | http://sucs.org/~sits/
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags

2014-07-23 Thread KY Srinivasan


 -Original Message-
 From: Sitsofe Wheeler [mailto:sits...@gmail.com]
 Sent: Wednesday, July 23, 2014 3:05 AM
 To: KY Srinivasan
 Cc: gre...@linuxfoundation.org; linux-kernel@vger.kernel.org;
 de...@linuxdriverproject.org; oher...@suse.com; a...@canonical.com;
 jasow...@redhat.com; jbottom...@parallels.com; h...@infradead.org;
 linux-s...@vger.kernel.org
 Subject: Re: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags
 
 On Mon, Jul 21, 2014 at 04:06:01PM -0700, K. Y. Srinivasan wrote:
  Add blist flags to permit the reading of the VPD pages even when the
  target may claim SPC-2 compliance. MSFT targets currently claim SPC-2
  compliance while they implement post SPC-2 features.
  With this patch we can correctly handle WRITE_SAME_16 issues.
 
 OK I've just seen this as I was about to post a similar patch to get discard
 going on Hyper-V. Will your patches handle Hyper-V pass through devices
 that support discard? The SSD I have here reports the following in the Linux

It should. Hyper-V does support pass through devices.

K. Y
 VM:
 
 # sg_vpd -p lbpv  /dev/sdc
 Logical block provisioning VPD page (SBC):
   Unmap command supported (LBPU): 1
   Write same (16) with unmap bit supported (LBWS): 0
   Write same (10) with unmap bit supported (LBWS10): 0
   Logical block provisioning read zeros (LBPRZ): 0
   Anchored LBAs supported (ANC_SUP): 1
   Threshold exponent: 0
   Descriptor present (DP): 0
   Provisioning type: 0
 
 # sg_readcap -l /dev/sdc
 Read Capacity results:
Protection: prot_en=0, p_type=0, p_i_exponent=0
Logical block provisioning: lbpme=0, lbprz=0
Last logical block address=234441647 (0xdf94baf), Number of logical
 blocks=234441648
Logical block length=512 bytes
Logical blocks per physical block exponent=0
Lowest aligned logical block address=0
 Hence:
Device size: 120034123776 bytes, 114473.5 MiB, 120.03 GB
 
 --
 Sitsofe | http://sucs.org/~sits/
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags

2014-07-23 Thread KY Srinivasan


 -Original Message-
 From: Christoph Hellwig [mailto:h...@infradead.org]
 Sent: Wednesday, July 23, 2014 7:10 AM
 To: Sitsofe Wheeler
 Cc: KY Srinivasan; gre...@linuxfoundation.org; linux-
 ker...@vger.kernel.org; de...@linuxdriverproject.org; oher...@suse.com;
 a...@canonical.com; jasow...@redhat.com; jbottom...@parallels.com;
 linux-s...@vger.kernel.org
 Subject: Re: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags
 
 On Wed, Jul 23, 2014 at 01:54:43PM +0100, Sitsofe Wheeler wrote:
  That's good to know (I was worried the device would not be detected as
  supporting discard because it doesn't report lbpme and doesn't declare
  a conformance version (see below)).
 
 Ok, that makes things worse - you might be able to force it through sysfs,
 though.
 
  Is there a tree with all these updates in or do they need to be pieced
  together from this email thread?
 
 I'm picking this up for my scsi-queue tree.  Still need a review for the patch
 we're replying to before that one can go in, though.

Hannes, could you please review this patch. Christoph, other than the review of 
this patch,
Is there something you want done before these can be committed.

Regards,

K. Y
 
  Additionally is it worth quirking sd_try_rc16_first on when
  BLIST_TRY_VPD_PAGES is present?
 
 Sounds reasonable to me.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags

2014-07-23 Thread Sitsofe Wheeler
On Wed, Jul 23, 2014 at 07:15:58AM -0700, Christoph Hellwig wrote:
 On Wed, Jul 23, 2014 at 03:10:28PM +0100, Sitsofe Wheeler wrote:
  I'm not sure this alone will work - won't sdev_bflags/bflags have
  already been built at this point?
 
 They've been built up, but we can still or new values into it.  It looks
 fine to me from review, but if you can test it on an actualy hypverv
 setup that would be valueable feedback.

The previous patches didn't work for me with a Windows 2012 R2 host with a
3.16.0-rc6.x86_64-00076-g2f7d2ec-dirty guest. After applying
https://patchwork.kernel.org/patch/4541201 (which needed a small fixup) and
https://patchwork.kernel.org/patch/4598601 and the attached debugging output
patch here's the result I got:

hv_vmbus: registering driver hv_storvsc
scsi0 : storvsc_host_t
scsi 0:0:0:0: scsi_get_device_flags_keyed: key: 3
scsi 0:0:0:0: scsi_get_device_flags_keyed: Post SCSI_DEVINFO_GLOBAL
scsi 0:0:0:0: scsi_get_device_flags_keyed: No sdev_bflags
scsi 0:0:0:0: sdev-scsi_level: 5
scsi 0:0:0:0: Direct-Access Msft Virtual Disk 1.0  PQ: 0 ANSI: 4
scsi 0:0:0:0: scsi_add_lun: Have BLIST_TRY_VPD_PAGES? No
scsi 0:0:0:0: storvsc_device_configure: Added BLIST_TRY_VPD_PAGES
scsi1 : storvsc_host_t
sd 0:0:0:0: Attached scsi generic sg0 type 0
scsi 1:0:0:0: scsi_get_device_flags_keyed: key: 3
scsi 1:0:0:0: scsi_get_device_flags_keyed: Post SCSI_DEVINFO_GLOBAL
scsi 1:0:0:0: scsi_get_device_flags_keyed: No sdev_bflags
scsi 1:0:0:0: sdev-scsi_level: 5
scsi 1:0:0:0: Direct-Access Msft Virtual Disk 1.0  PQ: 0 ANSI: 4
scsi 1:0:0:0: scsi_add_lun: Have BLIST_TRY_VPD_PAGES? No
scsi 1:0:0:0: storvsc_device_configure: Added BLIST_TRY_VPD_PAGES
scsi 1:0:0:1: scsi_get_device_flags_keyed: key: 5
scsi 1:0:0:1: scsi_get_device_flags_keyed: Post SCSI_DEVINFO_GLOBAL
scsi 1:0:0:1: scsi_get_device_flags_keyed: No sdev_bflags
scsi 1:0:0:1: scsi_get_device_flags_keyed: key: 5
scsi 1:0:0:1: scsi_get_device_flags_keyed: Post SCSI_DEVINFO_GLOBAL
scsi 1:0:0:1: scsi_get_device_flags_keyed: No sdev_bflags
scsi 1:0:0:1: sdev-scsi_level: 0
scsi 1:0:0:1: Direct-Access ADATASSD S510 120GB   5.2. PQ: 0 ANSI: 0
scsi 1:0:0:1: scsi_add_lun: Have BLIST_TRY_VPD_PAGES? No
scsi 1:0:0:1: storvsc_device_configure: Added BLIST_TRY_VPD_PAGES
scsi 1:0:0:3: scsi_get_device_flags_keyed: key: 0
scsi 1:0:0:3: scsi_get_device_flags_keyed: Post SCSI_DEVINFO_GLOBAL
scsi 1:0:0:3: scsi_get_device_flags_keyed: No sdev_bflags
scsi 1:0:0:3: sdev-scsi_level: 5
scsi 1:0:0:3: Direct-Access Msft Virtual Disk 1.0  PQ: 0 ANSI: 4
scsi 1:0:0:3: scsi_add_lun: Have BLIST_TRY_VPD_PAGES? No
scsi 1:0:0:3: storvsc_device_configure: Added BLIST_TRY_VPD_PAGES
sd 1:0:0:0: sd_try_rc16_first: sdp-scsi_level: 5
sd 1:0:0:0: [sdb] 2097152 512-byte logical blocks: (1.07 GB/1.00 GiB)
sd 1:0:0:0: [sdb] sd_revalidate_disk: Extended inquiry check...
sd 1:0:0:0: [sdb] sd_revalidate_disk: Skipped extended inquiries
sd 1:0:0:0: [sdb] Write Protect is off
sd 1:0:0:0: [sdb] Mode Sense: 0f 00 00 00
sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support 
DPO or FUA
sd 0:0:0:0: sd_try_rc16_first: sdp-scsi_level: 5
ata_piix :00:07.1: version 2.13
sd 1:0:0:0: sd_try_rc16_first: sdp-scsi_level: 5
sd 1:0:0:0: [sdb] sd_revalidate_disk: Extended inquiry check...
sd 1:0:0:0: [sdb] sd_revalidate_disk: Skipped extended inquiries
 sdb: unknown partition table
ata_piix :00:07.1: Hyper-V Virtual Machine detected, ATA device ignore set
sd 1:0:0:0: sd_try_rc16_first: sdp-scsi_level: 5
sd 1:0:0:0: [sdb] sd_revalidate_disk: Extended inquiry check...
sd 1:0:0:0: [sdb] sd_revalidate_disk: Skipped extended inquiries
sd 1:0:0:0: [sdb] Attached SCSI disk
sd 1:0:0:0: Attached scsi generic sg1 type 0
sd 0:0:0:0: [sda] 8388608 512-byte logical blocks: (4.29 GB/4.00 GiB)
scsi2 : ata_piix
scsi3 : ata_piix
ata1: PATA max UDMA/33 cmd 0x1f0 ctl 0x3f6 bmdma 0xffa0 irq 14
ata2: PATA max UDMA/33 cmd 0x170 ctl 0x376 bmdma 0xffa8 irq 15
sd 1:0:0:1: Attached scsi generic sg2 type 0
libphy: Fixed MDIO Bus: probed
hv_vmbus: registering driver hv_netvsc
sd 1:0:0:3: Attached scsi generic sg3 type 0
hv_netvsc: hv_netvsc channel opened successfully
sd 0:0:0:0: [sda] sd_revalidate_disk: Extended inquiry check...
sd 0:0:0:0: [sda] sd_revalidate_disk: Skipped extended inquiries
sd 1:0:0:1: sd_try_rc16_first: sdp-scsi_level: 0
sd 1:0:0:3: sd_try_rc16_first: sdp-scsi_level: 5
sd 1:0:0:1: [sdc] 234441648 512-byte logical blocks: (120 GB/111 GiB)
sd 1:0:0:1: [sdc] sd_revalidate_disk: Extended inquiry check...
sd 1:0:0:1: [sdc] sd_revalidate_disk: Skipped extended inquiries
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 0f 00 00 00
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support 
DPO or FUA
sd 0:0:0:0: sd_try_rc16_first: sdp-scsi_level: 5
sd 0:0:0:0: [sda] sd_revalidate_disk: Extended inquiry check...
sd 0:0:0:0: [sda] sd_revalidate_disk: Skipped extended inquiries
 sda: sda1
sd 0:0:0:0: sd_try_rc16_first: 

Re: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags

2014-07-23 Thread Hannes Reinecke

On 07/22/2014 01:06 AM, K. Y. Srinivasan wrote:

Add blist flags to permit the reading of the VPD pages even when
the target may claim SPC-2 compliance. MSFT targets currently
claim SPC-2 compliance while they implement post SPC-2 features.
With this patch we can correctly handle WRITE_SAME_16 issues.

Signed-off-by: K. Y. Srinivasan k...@microsoft.com
---
  drivers/scsi/storvsc_drv.c |   10 ++
  1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 29d0329..15ba695 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -327,6 +327,8 @@ MODULE_PARM_DESC(storvsc_ringbuffer_size, Ring buffer size 
(bytes));
   */
  static int storvsc_timeout = 180;

+static int msft_blist_flags = BLIST_TRY_VPD_PAGES;
+
  #define STORVSC_MAX_IO_REQUESTS   200

  static void storvsc_on_channel_callback(void *context);
@@ -1449,6 +1451,14 @@ static int storvsc_device_configure(struct scsi_device 
*sdevice)

sdevice-no_write_same = 1;

+   /*
+* Add blist flags to permit the reading of the VPD pages even when
+* the target may claim SPC-2 compliance. MSFT targets currently
+* claim SPC-2 compliance while they implement post SPC-2 features.
+* With this patch we can correctly handle WRITE_SAME_16 issues.
+*/
+   sdevice-sdev_bflags |= msft_blist_flags;
+
return 0;
  }



Reviewed-by: Hannes Reinecke h...@suse.de

Cheers,

Hannes
--
Dr. Hannes Reinecke   zSeries  Storage
h...@suse.de  +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/1] Drivers: scsi: storvsc: Add blist flags

2014-07-21 Thread K. Y. Srinivasan
Add blist flags to permit the reading of the VPD pages even when
the target may claim SPC-2 compliance. MSFT targets currently
claim SPC-2 compliance while they implement post SPC-2 features.
With this patch we can correctly handle WRITE_SAME_16 issues.

Signed-off-by: K. Y. Srinivasan 
---
 drivers/scsi/storvsc_drv.c |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 29d0329..15ba695 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -327,6 +327,8 @@ MODULE_PARM_DESC(storvsc_ringbuffer_size, "Ring buffer size 
(bytes)");
  */
 static int storvsc_timeout = 180;
 
+static int msft_blist_flags = BLIST_TRY_VPD_PAGES;
+
 #define STORVSC_MAX_IO_REQUESTS200
 
 static void storvsc_on_channel_callback(void *context);
@@ -1449,6 +1451,14 @@ static int storvsc_device_configure(struct scsi_device 
*sdevice)
 
sdevice->no_write_same = 1;
 
+   /*
+* Add blist flags to permit the reading of the VPD pages even when
+* the target may claim SPC-2 compliance. MSFT targets currently
+* claim SPC-2 compliance while they implement post SPC-2 features.
+* With this patch we can correctly handle WRITE_SAME_16 issues.
+*/
+   sdevice->sdev_bflags |= msft_blist_flags;
+
return 0;
 }
 
-- 
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags

2014-07-21 Thread KY Srinivasan


> -Original Message-
> From: Christoph Hellwig [mailto:h...@infradead.org]
> Sent: Monday, July 21, 2014 4:27 AM
> To: KY Srinivasan
> Cc: gre...@linuxfoundation.org; linux-kernel@vger.kernel.org;
> de...@linuxdriverproject.org; oher...@suse.com; a...@canonical.com;
> jasow...@redhat.com; jbottom...@parallels.com; h...@infradead.org;
> linux-s...@vger.kernel.org
> Subject: Re: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags
> 
> On Sun, Jul 20, 2014 at 08:33:42PM -0700, K. Y. Srinivasan wrote:
> > Add blist flags to permit the reading of the VPD pages even when the
> > target may claim SPC-2 compliance. MSFT targets currently claim SPC-2
> > compliance while they implement post SPC-2 features.
> > With this patch we can correctly handle WRITE_SAME_16 issues.
> >
> > Signed-off-by: K. Y. Srinivasan 
> 
> This looks way to complicated - should be a single line added to your
> slave_configure function, maybe plus a comment stating what you do in your
> commit message:
> 
> 
>   sdev->sdev_bflags |= BLIST_TRY_VPD_PAGES;

Thanks Christoph. We can go with this. I will re-send the patch.


K. Y
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags

2014-07-21 Thread Christoph Hellwig
On Sun, Jul 20, 2014 at 08:33:42PM -0700, K. Y. Srinivasan wrote:
> Add blist flags to permit the reading of the VPD pages even when
> the target may claim SPC-2 compliance. MSFT targets currently
> claim SPC-2 compliance while they implement post SPC-2 features.
> With this patch we can correctly handle WRITE_SAME_16 issues.
> 
> Signed-off-by: K. Y. Srinivasan 

This looks way to complicated - should be a single line added to your
slave_configure function, maybe plus a comment stating what you do
in your commit message:


sdev->sdev_bflags |= BLIST_TRY_VPD_PAGES;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags

2014-07-21 Thread Christoph Hellwig
On Sun, Jul 20, 2014 at 08:33:42PM -0700, K. Y. Srinivasan wrote:
 Add blist flags to permit the reading of the VPD pages even when
 the target may claim SPC-2 compliance. MSFT targets currently
 claim SPC-2 compliance while they implement post SPC-2 features.
 With this patch we can correctly handle WRITE_SAME_16 issues.
 
 Signed-off-by: K. Y. Srinivasan k...@microsoft.com

This looks way to complicated - should be a single line added to your
slave_configure function, maybe plus a comment stating what you do
in your commit message:


sdev-sdev_bflags |= BLIST_TRY_VPD_PAGES;

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags

2014-07-21 Thread KY Srinivasan


 -Original Message-
 From: Christoph Hellwig [mailto:h...@infradead.org]
 Sent: Monday, July 21, 2014 4:27 AM
 To: KY Srinivasan
 Cc: gre...@linuxfoundation.org; linux-kernel@vger.kernel.org;
 de...@linuxdriverproject.org; oher...@suse.com; a...@canonical.com;
 jasow...@redhat.com; jbottom...@parallels.com; h...@infradead.org;
 linux-s...@vger.kernel.org
 Subject: Re: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags
 
 On Sun, Jul 20, 2014 at 08:33:42PM -0700, K. Y. Srinivasan wrote:
  Add blist flags to permit the reading of the VPD pages even when the
  target may claim SPC-2 compliance. MSFT targets currently claim SPC-2
  compliance while they implement post SPC-2 features.
  With this patch we can correctly handle WRITE_SAME_16 issues.
 
  Signed-off-by: K. Y. Srinivasan k...@microsoft.com
 
 This looks way to complicated - should be a single line added to your
 slave_configure function, maybe plus a comment stating what you do in your
 commit message:
 
 
   sdev-sdev_bflags |= BLIST_TRY_VPD_PAGES;

Thanks Christoph. We can go with this. I will re-send the patch.


K. Y
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/1] Drivers: scsi: storvsc: Add blist flags

2014-07-21 Thread K. Y. Srinivasan
Add blist flags to permit the reading of the VPD pages even when
the target may claim SPC-2 compliance. MSFT targets currently
claim SPC-2 compliance while they implement post SPC-2 features.
With this patch we can correctly handle WRITE_SAME_16 issues.

Signed-off-by: K. Y. Srinivasan k...@microsoft.com
---
 drivers/scsi/storvsc_drv.c |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 29d0329..15ba695 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -327,6 +327,8 @@ MODULE_PARM_DESC(storvsc_ringbuffer_size, Ring buffer size 
(bytes));
  */
 static int storvsc_timeout = 180;
 
+static int msft_blist_flags = BLIST_TRY_VPD_PAGES;
+
 #define STORVSC_MAX_IO_REQUESTS200
 
 static void storvsc_on_channel_callback(void *context);
@@ -1449,6 +1451,14 @@ static int storvsc_device_configure(struct scsi_device 
*sdevice)
 
sdevice-no_write_same = 1;
 
+   /*
+* Add blist flags to permit the reading of the VPD pages even when
+* the target may claim SPC-2 compliance. MSFT targets currently
+* claim SPC-2 compliance while they implement post SPC-2 features.
+* With this patch we can correctly handle WRITE_SAME_16 issues.
+*/
+   sdevice-sdev_bflags |= msft_blist_flags;
+
return 0;
 }
 
-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/1] Drivers: scsi: storvsc: Add blist flags

2014-07-20 Thread K. Y. Srinivasan
Add blist flags to permit the reading of the VPD pages even when
the target may claim SPC-2 compliance. MSFT targets currently
claim SPC-2 compliance while they implement post SPC-2 features.
With this patch we can correctly handle WRITE_SAME_16 issues.

Signed-off-by: K. Y. Srinivasan 
---
 drivers/scsi/storvsc_drv.c |   13 +
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 29d0329..2a58dc4 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include "scsi_priv.h"
 
 /*
  * All wire protocol details (storage protocol between the guest and the host)
@@ -327,6 +328,8 @@ MODULE_PARM_DESC(storvsc_ringbuffer_size, "Ring buffer size 
(bytes)");
  */
 static int storvsc_timeout = 180;
 
+static int msft_blist_flags = BLIST_TRY_VPD_PAGES;
+
 #define STORVSC_MAX_IO_REQUESTS200
 
 static void storvsc_on_channel_callback(void *context);
@@ -1438,6 +1441,8 @@ static void storvsc_device_destroy(struct scsi_device 
*sdevice)
 
 static int storvsc_device_configure(struct scsi_device *sdevice)
 {
+   int blist_flags;
+
scsi_adjust_queue_depth(sdevice, MSG_SIMPLE_TAG,
STORVSC_MAX_IO_REQUESTS);
 
@@ -1449,6 +1454,14 @@ static int storvsc_device_configure(struct scsi_device 
*sdevice)
 
sdevice->no_write_same = 1;
 
+   blist_flags = scsi_get_device_flags_keyed(sdevice, "Msft",
+ "Virtual Disk",
+ SCSI_DEVINFO_GLOBAL);
+
+   if (blist_flags != msft_blist_flags)
+   scsi_dev_info_list_add_keyed(1, "Msft", "Virtual Disk", NULL,
+msft_blist_flags,
+SCSI_DEVINFO_GLOBAL);
return 0;
 }
 
-- 
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/1] Drivers: scsi: storvsc: Add blist flags

2014-07-20 Thread K. Y. Srinivasan
Add blist flags to permit the reading of the VPD pages even when
the target may claim SPC-2 compliance. MSFT targets currently
claim SPC-2 compliance while they implement post SPC-2 features.
With this patch we can correctly handle WRITE_SAME_16 issues.

Signed-off-by: K. Y. Srinivasan k...@microsoft.com
---
 drivers/scsi/storvsc_drv.c |   13 +
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 29d0329..2a58dc4 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -42,6 +42,7 @@
 #include scsi/scsi_eh.h
 #include scsi/scsi_devinfo.h
 #include scsi/scsi_dbg.h
+#include scsi_priv.h
 
 /*
  * All wire protocol details (storage protocol between the guest and the host)
@@ -327,6 +328,8 @@ MODULE_PARM_DESC(storvsc_ringbuffer_size, Ring buffer size 
(bytes));
  */
 static int storvsc_timeout = 180;
 
+static int msft_blist_flags = BLIST_TRY_VPD_PAGES;
+
 #define STORVSC_MAX_IO_REQUESTS200
 
 static void storvsc_on_channel_callback(void *context);
@@ -1438,6 +1441,8 @@ static void storvsc_device_destroy(struct scsi_device 
*sdevice)
 
 static int storvsc_device_configure(struct scsi_device *sdevice)
 {
+   int blist_flags;
+
scsi_adjust_queue_depth(sdevice, MSG_SIMPLE_TAG,
STORVSC_MAX_IO_REQUESTS);
 
@@ -1449,6 +1454,14 @@ static int storvsc_device_configure(struct scsi_device 
*sdevice)
 
sdevice-no_write_same = 1;
 
+   blist_flags = scsi_get_device_flags_keyed(sdevice, Msft,
+ Virtual Disk,
+ SCSI_DEVINFO_GLOBAL);
+
+   if (blist_flags != msft_blist_flags)
+   scsi_dev_info_list_add_keyed(1, Msft, Virtual Disk, NULL,
+msft_blist_flags,
+SCSI_DEVINFO_GLOBAL);
return 0;
 }
 
-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/