All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Tejun Heo <tj@kernel.org>, Scott Bauer <scott.bauer@intel.com>,
	Jonathan Derrick <jonathan.derrick@intel.com>,
	Rafael Antognolli <rafael.antognolli@intel.com>,
	Robert Elliott <elliott@hpe.com>,
	linux-ide@vger.kernel.org, linux-block@vger.kernel.org,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH 6/6] sd: add support for TCG OPAL self encrypting disks
Date: Mon, 05 Jun 2017 20:48:00 -0400	[thread overview]
Message-ID: <yq1lgp6djr3.fsf@oracle.com> (raw)
In-Reply-To: <20170604124225.27032-7-hch@lst.de> (Christoph Hellwig's message of "Sun, 4 Jun 2017 14:42:25 +0200")


Christoph,

> +static void sd_read_security(struct scsi_disk *sdkp, unsigned char *buffer)
> +{
> +	struct scsi_device *sdev = sdkp->device;
> +
> +	if (scsi_report_opcode(sdev, buffer, SD_BUF_SIZE,
> +			SECURITY_PROTOCOL_IN) == 1 &&
> +	    scsi_report_opcode(sdev, buffer, SD_BUF_SIZE,
> +			SECURITY_PROTOCOL_OUT) == 1)
> +		sdkp->security = 1;
> +}
> +
>  /**
>   *	sd_revalidate_disk - called the first time a new disk is seen,
>   *	performs disk spin up, read_capacity, etc.
> @@ -3067,6 +3102,7 @@ static int sd_revalidate_disk(struct gendisk *disk)
>  		sd_read_cache_type(sdkp, buffer);
>  		sd_read_app_tag_own(sdkp, buffer);
>  		sd_read_write_same(sdkp, buffer);
> +		sd_read_security(sdkp, buffer);
>  	}

For WRITE SAME, scsi_report_opcode() is gated not only by
sdev->no_report_opcodes but by sdev->no_write_same.

I'm concerned about firing off REPORT OPCODES to random devices without
a sufficiently good heuristic. Doesn't look like SAT has anything to
offer in this department, though. Maybe it's time to consider a
vendor-specific Linux VPD page...

-- 
Martin K. Petersen	Oracle Linux Engineering

  parent reply	other threads:[~2017-06-06  0:48 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-04 12:42 TCG Opal support for libata Christoph Hellwig
2017-06-04 12:42 ` [PATCH 1/6] libata: move ata_read_log_page to libata-core.c Christoph Hellwig
2017-06-06  6:27   ` Hannes Reinecke
2017-06-04 12:42 ` [PATCH 2/6] libata: factor out a ata_log_supported helper Christoph Hellwig
2017-06-06  6:28   ` Hannes Reinecke
2017-06-04 12:42 ` [PATCH 3/6] libata: clarify log page naming / grouping Christoph Hellwig
2017-06-06  6:29   ` Hannes Reinecke
2017-06-04 12:42 ` [PATCH 4/6] libata: factor out a ata_identify_page_supported helper Christoph Hellwig
2017-06-05 12:46   ` Sergei Shtylyov
2017-06-06  6:29   ` Hannes Reinecke
2017-06-04 12:42 ` [PATCH 5/6] libata: implement SECURITY PROTOCOL IN/OUT Christoph Hellwig
2017-06-06  6:30   ` Hannes Reinecke
2017-06-04 12:42 ` [PATCH 6/6] sd: add support for TCG OPAL self encrypting disks Christoph Hellwig
2017-06-05 21:15   ` Scott Bauer
2017-06-06  9:59     ` Christoph Hellwig
2017-06-06 21:40       ` Scott Bauer
2017-06-06  0:48   ` Martin K. Petersen [this message]
2017-06-06  9:58     ` Christoph Hellwig
2017-06-13  6:40       ` Christoph Hellwig
2017-06-13 15:19         ` Martin K. Petersen
2017-06-06  6:31   ` Hannes Reinecke
2017-06-05 19:30 ` TCG Opal support for libata 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=yq1lgp6djr3.fsf@oracle.com \
    --to=martin.petersen@oracle.com \
    --cc=elliott@hpe.com \
    --cc=hch@lst.de \
    --cc=jonathan.derrick@intel.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=rafael.antognolli@intel.com \
    --cc=scott.bauer@intel.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 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.