Re: [PATCH 2/4] libata: Implement ZBC OUT translation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 04/04/2016 03:08 PM, Shaun Tancheff wrote:
> On Mon, Apr 4, 2016 at 4:47 PM, Hannes Reinecke <hare@xxxxxxx> wrote:
>> ZAC drives implement a 'zac management out' command template,
>> which maps onto the ZBC OUT command.
>>
>> Signed-off-by: Hannes Reinecke <hare@xxxxxxx>
>> ---
>>  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@xxxxxxx			               +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)
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux