linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Shaun Tancheff <shaun.tancheff@seagate.com>
Cc: Tejun Heo <tj@kernel.org>,
	linux-ide@vger.kernel.org,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Christoph Hellwig <hch@lst.de>,
	Damien Le Moal <damien.lemoal@hgst.com>,
	linux-scsi@vger.kernel.org,
	Sathya Prakash <sathya.prakash@broadcom.com>
Subject: Re: [PATCH 2/4] libata: Implement ZBC OUT translation
Date: Mon, 4 Apr 2016 15:18:30 +0200	[thread overview]
Message-ID: <570269A6.7090908@suse.de> (raw)
In-Reply-To: <CAJVOszABD3+qX-D5q1N74kZB4XODDFdhc56=Ktao4hV7PopCww@mail.gmail.com>

On 04/04/2016 03:08 PM, Shaun Tancheff wrote:
> On Mon, Apr 4, 2016 at 4:47 PM, Hannes Reinecke <hare@suse.de> wrote:
>> ZAC drives implement a 'zac management out' command template,
>> which maps onto the ZBC OUT command.
>>
>> Signed-off-by: Hannes Reinecke <hare@suse.de>
>> ---
>>  drivers/ata/libata-eh.c       |  1 +
>>  drivers/ata/libata-scsi.c     | 73 +++++++++++++++++++++++++++++++++++++++++++
>>  include/linux/ata.h           |  7 +++++
>>  include/trace/events/libata.h |  1 +
>>  4 files changed, 82 insertions(+)
>>
>> diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
>> index e947bd5..ee984f9 100644
>> --- a/drivers/ata/libata-eh.c
>> +++ b/drivers/ata/libata-eh.c
>> @@ -2481,6 +2481,7 @@ const char *ata_get_cmd_descript(u8 command)
>>                 { ATA_CMD_REQ_SENSE_DATA,       "REQUEST SENSE DATA EXT" },
>>                 { ATA_CMD_SANITIZE_DEVICE,      "SANITIZE DEVICE" },
>>                 { ATA_CMD_ZAC_MGMT_IN,          "ZAC MANAGEMENT IN" },
>> +               { ATA_CMD_ZAC_MGMT_OUT,         "ZAC MANAGEMENT OUT" },
>>                 { ATA_CMD_READ_LONG,            "READ LONG (with retries)" },
>>                 { ATA_CMD_READ_LONG_ONCE,       "READ LONG (without retries)" },
>>                 { ATA_CMD_WRITE_LONG,           "WRITE LONG (with retries)" },
>> diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
>> index 21c2b40..6db2aaf 100644
>> --- a/drivers/ata/libata-scsi.c
>> +++ b/drivers/ata/libata-scsi.c
>> @@ -3451,6 +3451,76 @@ invalid_param_len:
>>         return 1;
>>  }
>>
>> +static unsigned int ata_scsi_zbc_out_xlat(struct ata_queued_cmd *qc)
>> +{
>> +       struct ata_taskfile *tf = &qc->tf;
>> +       struct scsi_cmnd *scmd = qc->scsicmd;
>> +       struct ata_device *dev = qc->dev;
>> +       const u8 *cdb = scmd->cmnd;
>> +       u8 reset_all, sa;
>> +       u64 block;
>> +       u32 n_block;
>> +       u16 fp = (u16)-1;
>> +
>> +       if (unlikely(scmd->cmd_len < 16)) {
>> +               fp = 15;
>> +               goto invalid_fld;
>> +       }
>> +
>> +       /*
>> +        * The service action definition got moved from
>> +        * 0x00 to 0x04 with zbc-r02, so accept both.
>> +        */
>> +       sa = cdb[1] & 0x1f;
>> +       /* Compatibility with ZBC r01 */
>> +       if (!sa)
>> +               sa = ZO_RESET_WRITE_POINTER;
> 
> I think we can support the remaining zone commands here:
> 
> if (!(sa == ZO_CLOSE_ZONE || sa == ZO_FINISH_ZONE ||
>      sa == ZO_OPEN_ZONE || sa == ZO_RESET_WRITE_POINTER)) {
> ...
> 
Sure, I just didn't do it for now as none of the drives I have
actually supports this.
But yes, will be fixing it up for the next round of submissions.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

  reply	other threads:[~2016-04-04 13:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-04  9:47 [PATCH 0/4] libata: ZAC support Hannes Reinecke
2016-04-04  9:47 ` [PATCH 1/4] libata: implement ZBC IN translation Hannes Reinecke
2016-04-04 15:49   ` Tejun Heo
2016-04-06  7:51     ` Hannes Reinecke
2016-04-04 16:26   ` Shaun Tancheff
2016-04-04  9:47 ` [PATCH 2/4] libata: Implement ZBC OUT translation Hannes Reinecke
2016-04-04 13:08   ` Shaun Tancheff
2016-04-04 13:18     ` Hannes Reinecke [this message]
2016-04-04  9:47 ` [PATCH 3/4] libata: support device-managed ZAC devices Hannes Reinecke
2016-04-04 11:13   ` Sergei Shtylyov
2016-04-04 14:15     ` Hannes Reinecke
2016-04-04  9:47 ` [PATCH 4/4] libata: support host-aware and host-managed " Hannes Reinecke
2016-04-04 15:50 ` [PATCH 0/4] libata: ZAC support Tejun Heo

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=570269A6.7090908@suse.de \
    --to=hare@suse.de \
    --cc=damien.lemoal@hgst.com \
    --cc=hch@lst.de \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=sathya.prakash@broadcom.com \
    --cc=shaun.tancheff@seagate.com \
    --cc=tj@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).