All of lore.kernel.org
 help / color / mirror / Atom feed
From: tom.ty89@gmail.com
To: linux-scsi@vger.kernel.org
Cc: Tom Yan <tom.ty89@gmail.com>
Subject: [PATCH 1/1] sd: do not let LBPME bit stop the VPDs speak
Date: Wed,  9 Mar 2016 11:26:16 +0800	[thread overview]
Message-ID: <56df97e0.d08d420a.58e8f.3162@mx.google.com> (raw)

From: Tom Yan <tom.ty89@gmail.com>

Some devices have details of their support on unmapping on the
Block Limits and/or Logical Block Provisioning VPDs while they
do not set the LBPME bit to 1. Though this is required by the
SCSI standards, the VPDs are giving even more concrete details
about the support, so they should be used even when the bit
is set to 0.

Signed-off-by: Tom Yan <tom.ty89@gmail.com>

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index d749da7..a0d7c73 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2670,9 +2670,6 @@ static void sd_read_block_limits(struct scsi_disk *sdkp)
 
 		sdkp->max_ws_blocks = (u32)get_unaligned_be64(&buffer[36]);
 
-		if (!sdkp->lbpme)
-			goto out;
-
 		lba_count = get_unaligned_be32(&buffer[20]);
 		desc_count = get_unaligned_be32(&buffer[24]);
 
@@ -2747,9 +2744,6 @@ static void sd_read_block_provisioning(struct scsi_disk *sdkp)
 	unsigned char *buffer;
 	const int vpd_len = 8;
 
-	if (sdkp->lbpme == 0)
-		return;
-
 	buffer = kmalloc(vpd_len, GFP_KERNEL);
 
 	if (!buffer || scsi_get_vpd_page(sdkp->device, 0xb2, buffer, vpd_len))
-- 
2.7.2


             reply	other threads:[~2016-03-09  3:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-09  3:26 tom.ty89 [this message]
2016-03-09  3:30 ` [PATCH 1/1] sd: do not let LBPME bit stop the VPDs speak Tom Yan
2016-03-09  3:38   ` Tom Yan
2016-03-10  2:32     ` Martin K. Petersen
     [not found]       ` <CAGnHSEng46jz66wkhiA73vvgfFzNx+3R4WeBLbyBrhD5UR6NBw@mail.gmail.com>
2016-03-10  8:15         ` Fwd: " Tom Yan
2016-03-11  2:08           ` Martin K. Petersen
2016-03-10  2:24 ` Martin K. Petersen
     [not found]   ` <CAGnHSEnHG5i3EvwmcGZU5BXobUCQa7P+j+KKNrUyoS86s7d8Gg@mail.gmail.com>
2016-03-10  8:15     ` Fwd: " Tom Yan
2016-03-11  2:02       ` Martin K. Petersen
2016-03-10 10:33     ` Tom Yan
     [not found]       ` <CAGnHSEkLo7sp5PUqzk74aZi6r30hVDaj2fD-i_cCHWdezZNPwA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-03-11  3:26         ` Tom Yan

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=56df97e0.d08d420a.58e8f.3162@mx.google.com \
    --to=tom.ty89@gmail.com \
    --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.