public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
To: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>,
	linux-scsi@vger.kernel.org,
	"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: Dmitry Fomichev <Dmitry.Fomichev@wdc.com>
Subject: Re: [PATCH 1/2] scsi: sd_zbc: do not enforce READ/WRITE (16) on host-aware devices
Date: Wed, 9 Nov 2022 14:17:07 +0900	[thread overview]
Message-ID: <6c0c6bfc-64d5-b822-e438-57e1e1d8b7f9@opensource.wdc.com> (raw)
In-Reply-To: <20221109025941.1594612-2-shinichiro.kawasaki@wdc.com>

On 11/9/22 11:59, Shin'ichiro Kawasaki wrote:
> ZBC Zoned Block Commands specification mandates READ (16) and WRITE (16)
> commands only for host-managed zoned block devices. It does not mandate
> the commands for host-aware zoned block devices. However, current
> sd_zbc_read_zones() code assumes the commands were mandated for host-
> aware devices also and enforces the commands. If the host-aware drives
> do not support the commands, they may fail.
> 
> To conform to the ZBC specification and to avoid the failure, check
> device type and modify use_16_for_rw and use_10_for_rw flags only for
> host-managed zoned block devices, so that the READ (16) and WRITE (16)
> commands are not enforced on host-aware zoned block devices.
> 
> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
> ---
>  drivers/scsi/sd_zbc.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c
> index bd15624c6322..4717a55dbf35 100644
> --- a/drivers/scsi/sd_zbc.c
> +++ b/drivers/scsi/sd_zbc.c
> @@ -921,9 +921,11 @@ int sd_zbc_read_zones(struct scsi_disk *sdkp, u8 buf[SD_BUF_SIZE])
>  		return 0;
>  	}
>  
> -	/* READ16/WRITE16 is mandatory for ZBC disks */
> -	sdkp->device->use_16_for_rw = 1;
> -	sdkp->device->use_10_for_rw = 0;
> +	/* READ16/WRITE16 is mandatory for host-managed devices */
> +	if (sdkp->device->type == TYPE_ZBC) {
> +		sdkp->device->use_16_for_rw = 1;
> +		sdkp->device->use_10_for_rw = 0;
> +	}
>  
>  	if (!blk_queue_is_zoned(q)) {
>  		/*

Looks good to me.

Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>

-- 
Damien Le Moal
Western Digital Research


  reply	other threads:[~2022-11-09  5:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-09  2:59 [PATCH 0/2] scsi: sd: use READ/WRITE/SYNC (16) commands per ZBC Shin'ichiro Kawasaki
2022-11-09  2:59 ` [PATCH 1/2] scsi: sd_zbc: do not enforce READ/WRITE (16) on host-aware devices Shin'ichiro Kawasaki
2022-11-09  5:17   ` Damien Le Moal [this message]
2022-11-09  2:59 ` [PATCH 2/2] scsi: sd: enforce SYNCHRONIZE CACHE (16) on host-managed devices Shin'ichiro Kawasaki
2022-11-09  5:18   ` Damien Le Moal
2022-11-09 12:36 ` [PATCH 0/2] scsi: sd: use READ/WRITE/SYNC (16) commands per ZBC Christoph Hellwig
2022-11-10  2:20   ` Shinichiro Kawasaki
2022-11-10  8:19     ` hch
2022-11-10  8:31       ` Damien Le Moal
2022-11-14 10:58         ` Shinichiro Kawasaki

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=6c0c6bfc-64d5-b822-e438-57e1e1d8b7f9@opensource.wdc.com \
    --to=damien.lemoal@opensource.wdc.com \
    --cc=Dmitry.Fomichev@wdc.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=shinichiro.kawasaki@wdc.com \
    /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