* [PATCH 1/6] libata: Do not retry commands with valid autosense
2015-07-31 13:02 [PATCH 0/6] ZAC host-aware device support Hannes Reinecke
@ 2015-07-31 13:02 ` Hannes Reinecke
2015-08-02 15:44 ` Tejun Heo
2015-07-31 13:02 ` [PATCH 2/6] libata-scsi: use ata_scsi_set_sense when generating ATA sense Hannes Reinecke
` (6 subsequent siblings)
7 siblings, 1 reply; 24+ messages in thread
From: Hannes Reinecke @ 2015-07-31 13:02 UTC (permalink / raw)
To: Tejun Heo; +Cc: linux-ide, linux-scsi, James Bottomley, Hannes Reinecke
If a failed command has a valid autosense there is no need to
retry it on the ATA level; at best we're incurring the same
error again. So rather not retry it here, but leave it to
the SCSI layer to decide if a retry is in order.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/libata-eh.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 7465031..1b4e9d1 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2218,6 +2218,8 @@ static inline int ata_eh_worth_retry(struct ata_queued_cmd *qc)
return 1; /* otherwise retry anything from fs stack */
if (qc->err_mask & AC_ERR_INVALID)
return 0; /* don't retry these */
+ if (qc->flags & ATA_QCFLAG_SENSE_VALID)
+ return 0; /* Autosense, no need to retry here */
return qc->err_mask != AC_ERR_DEV; /* retry if not dev error */
}
--
1.8.5.2
^ permalink raw reply related [flat|nested] 24+ messages in thread* Re: [PATCH 1/6] libata: Do not retry commands with valid autosense
2015-07-31 13:02 ` [PATCH 1/6] libata: Do not retry commands with valid autosense Hannes Reinecke
@ 2015-08-02 15:44 ` Tejun Heo
2015-08-03 7:31 ` Hannes Reinecke
0 siblings, 1 reply; 24+ messages in thread
From: Tejun Heo @ 2015-08-02 15:44 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: linux-ide, linux-scsi, James Bottomley
Hello,
On Fri, Jul 31, 2015 at 03:02:03PM +0200, Hannes Reinecke wrote:
> If a failed command has a valid autosense there is no need to
> retry it on the ATA level; at best we're incurring the same
> error again. So rather not retry it here, but leave it to
> the SCSI layer to decide if a retry is in order.
Hmmm... I don't know. So, we change how we handle errors completely
depending on how the device reports it? Doesn't seem like a
particularly good idea to me.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 1/6] libata: Do not retry commands with valid autosense
2015-08-02 15:44 ` Tejun Heo
@ 2015-08-03 7:31 ` Hannes Reinecke
2015-08-03 15:04 ` Tejun Heo
0 siblings, 1 reply; 24+ messages in thread
From: Hannes Reinecke @ 2015-08-03 7:31 UTC (permalink / raw)
To: Tejun Heo; +Cc: linux-ide, linux-scsi, James Bottomley
On 08/02/2015 05:44 PM, Tejun Heo wrote:
> Hello,
>
> On Fri, Jul 31, 2015 at 03:02:03PM +0200, Hannes Reinecke wrote:
>> If a failed command has a valid autosense there is no need to
>> retry it on the ATA level; at best we're incurring the same
>> error again. So rather not retry it here, but leave it to
>> the SCSI layer to decide if a retry is in order.
>
> Hmmm... I don't know. So, we change how we handle errors completely
> depending on how the device reports it? Doesn't seem like a
> particularly good idea to me.
>
The whole point of the autosense feature is that you do _not_
have to fall back to the original trial-and-error libata EH,
but know exactly what the problem is. Plus any retry will be giving
us (in most cases) exactly the same sense code.
_And_ the SCSI layer is actually able to understand the sense code,
allowing him to make a better judgment on what to do with that error.
So any retry in the libata layer will only slow things down,
leading to the same results eventually.
Cheers,
Hannes
--
Dr. Hannes Reinecke zSeries & Storage
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)
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 1/6] libata: Do not retry commands with valid autosense
2015-08-03 7:31 ` Hannes Reinecke
@ 2015-08-03 15:04 ` Tejun Heo
2015-08-03 15:16 ` [PATCH libata/for-4.2-fixes] libata: disable NCQ autosense Tejun Heo
2015-08-03 15:18 ` [PATCH 1/6] libata: Do not retry commands with valid autosense Tejun Heo
0 siblings, 2 replies; 24+ messages in thread
From: Tejun Heo @ 2015-08-03 15:04 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: linux-ide, linux-scsi, James Bottomley
Hello,
On Mon, Aug 03, 2015 at 09:31:57AM +0200, Hannes Reinecke wrote:
> The whole point of the autosense feature is that you do _not_
> have to fall back to the original trial-and-error libata EH,
> but know exactly what the problem is. Plus any retry will be giving
> us (in most cases) exactly the same sense code.
Can you please give some examples? As lacking as ATA error reporting
is, it still can tell whether retry is necessary or not in most cases.
> _And_ the SCSI layer is actually able to understand the sense code,
> allowing him to make a better judgment on what to do with that error.
>
> So any retry in the libata layer will only slow things down,
> leading to the same results eventually.
Have you tested actual error handling? I doubt this would work as you
expect it to. libata EH takes over the entire error handling and when
it determines that the command has failed and retrying won't do any
good, it tells SCSI EH to not retry either.
Ugh... so this is from NCQ autosense thing. Now ATA devices reports
sense data too which trumps AC_ERR_DEV so libata EH decides to retry
even when the device indicates unrecoverable error. Urgh... we
shouldn't be taking completely different error handling paths because
a device chooses to report error conditions slightly differently.
Please map them so that they behave in a consistent manner. I'm gonna
plug autosense for now.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH libata/for-4.2-fixes] libata: disable NCQ autosense
2015-08-03 15:04 ` Tejun Heo
@ 2015-08-03 15:16 ` Tejun Heo
2015-08-03 15:39 ` Tejun Heo
2015-08-03 15:18 ` [PATCH 1/6] libata: Do not retry commands with valid autosense Tejun Heo
1 sibling, 1 reply; 24+ messages in thread
From: Tejun Heo @ 2015-08-03 15:16 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: linux-ide, linux-scsi, James Bottomley
>From 8c0fa3e7ca99b0d6d96cb2cf194a912f643da7c5 Mon Sep 17 00:00:00 2001
From: Tejun Heo <tj@kernel.org>
Date: Mon, 3 Aug 2015 11:10:45 -0400
fe7173c206de ("libata: Implement support for sense data reporting")
and subsequent patches enabled NCQ autosense reporting; unfortunately,
this breaks libata EH behavior for devices which support the feature
because it assumes that only ATAPI devices report sense data and that
sense data trumps explicit device error indication.
For now, disable NCQ autosense.
Cc: stable@vger.kernel.org # v4.1+
Fixes: fe7173c206de ("libata: Implement support for sense data reporting")
---
drivers/ata/libata-core.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index db5d9f7..32451ac 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2151,6 +2151,13 @@ static void ata_dev_config_sense_reporting(struct ata_device *dev)
{
unsigned int err_mask;
+ /*
+ * FIXME: This makes ATA devices report sense data on failure which
+ * in turn makes libata EH ignore AC_ERR_DEV leading to incorrect
+ * error handling behaviors.
+ */
+ return;
+
if (!ata_id_has_sense_reporting(dev->id))
return;
--
2.4.3
^ permalink raw reply related [flat|nested] 24+ messages in thread* Re: [PATCH libata/for-4.2-fixes] libata: disable NCQ autosense
2015-08-03 15:16 ` [PATCH libata/for-4.2-fixes] libata: disable NCQ autosense Tejun Heo
@ 2015-08-03 15:39 ` Tejun Heo
0 siblings, 0 replies; 24+ messages in thread
From: Tejun Heo @ 2015-08-03 15:39 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: linux-ide, linux-scsi, James Bottomley
On Mon, Aug 03, 2015 at 11:16:21AM -0400, Tejun Heo wrote:
> From 8c0fa3e7ca99b0d6d96cb2cf194a912f643da7c5 Mon Sep 17 00:00:00 2001
> From: Tejun Heo <tj@kernel.org>
> Date: Mon, 3 Aug 2015 11:10:45 -0400
>
> fe7173c206de ("libata: Implement support for sense data reporting")
> and subsequent patches enabled NCQ autosense reporting; unfortunately,
> this breaks libata EH behavior for devices which support the feature
> because it assumes that only ATAPI devices report sense data and that
> sense data trumps explicit device error indication.
So, this isn't enough and apparently you're bypassing the entire
device side error analyzing when the device reports sense data. Sorry
that I missed this on the first submission but I can't see how this
would work. Even if you fix the immediate issue in this thread, how
is it gonna handle link error reported by the device? Who's gonna
tell libata EH that the link better be reset and may be sped down if
errors keep occurring? This is a significant regression in EH
behavior.
I'm gonna revert the whole ACS-4 sense thing. ATM, I'm pretty
doubtful that this buys antying substantial for us and even if so we
need to figure out a better way to integrate this.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 1/6] libata: Do not retry commands with valid autosense
2015-08-03 15:04 ` Tejun Heo
2015-08-03 15:16 ` [PATCH libata/for-4.2-fixes] libata: disable NCQ autosense Tejun Heo
@ 2015-08-03 15:18 ` Tejun Heo
2015-08-03 15:42 ` James Bottomley
1 sibling, 1 reply; 24+ messages in thread
From: Tejun Heo @ 2015-08-03 15:18 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: linux-ide, linux-scsi, James Bottomley
Adding a bit.
On Mon, Aug 03, 2015 at 11:04:28AM -0400, Tejun Heo wrote:
> Ugh... so this is from NCQ autosense thing. Now ATA devices reports
> sense data too which trumps AC_ERR_DEV so libata EH decides to retry
> even when the device indicates unrecoverable error. Urgh... we
> shouldn't be taking completely different error handling paths because
> a device chooses to report error conditions slightly differently.
> Please map them so that they behave in a consistent manner. I'm gonna
> plug autosense for now.
Also, is there anything substantial we gain from NCQ autosense? Why
do we want this in the first place? ATA error reporting is
rudimentary but it more or less works and I'm not sure whether we'd
want to overhaul its basic behaviors at this stage.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 1/6] libata: Do not retry commands with valid autosense
2015-08-03 15:18 ` [PATCH 1/6] libata: Do not retry commands with valid autosense Tejun Heo
@ 2015-08-03 15:42 ` James Bottomley
2015-08-03 15:55 ` Tejun Heo
0 siblings, 1 reply; 24+ messages in thread
From: James Bottomley @ 2015-08-03 15:42 UTC (permalink / raw)
To: Tejun Heo; +Cc: Hannes Reinecke, linux-ide, linux-scsi
On Mon, 2015-08-03 at 11:18 -0400, Tejun Heo wrote:
> Adding a bit.
>
> On Mon, Aug 03, 2015 at 11:04:28AM -0400, Tejun Heo wrote:
> > Ugh... so this is from NCQ autosense thing. Now ATA devices reports
> > sense data too which trumps AC_ERR_DEV so libata EH decides to retry
> > even when the device indicates unrecoverable error. Urgh... we
> > shouldn't be taking completely different error handling paths because
> > a device chooses to report error conditions slightly differently.
> > Please map them so that they behave in a consistent manner. I'm gonna
> > plug autosense for now.
>
> Also, is there anything substantial we gain from NCQ autosense? Why
> do we want this in the first place? ATA error reporting is
> rudimentary but it more or less works and I'm not sure whether we'd
> want to overhaul its basic behaviors at this stage.
I'd think it would be the same reason as all modern transports: it's
faster and allows processing of sense data in-band. Under the old
regime, the device is effectively frozen until you collect the data.
Under autosense, the data is collected as part of the in-band command
processing, so it doesn't stall the device.
Modern drives (and protocols) are moving towards being somewhat more
chatty with sense data. It doesn't just signal an error, mostly it's
just reporting about drive characteristics or other advisory stuff.
This means that if you handle it the old way, you'll get more drive
stalls and a corresponding reduction in throughput.
James
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 1/6] libata: Do not retry commands with valid autosense
2015-08-03 15:42 ` James Bottomley
@ 2015-08-03 15:55 ` Tejun Heo
2015-08-03 16:44 ` James Bottomley
2015-08-03 16:47 ` Hannes Reinecke
0 siblings, 2 replies; 24+ messages in thread
From: Tejun Heo @ 2015-08-03 15:55 UTC (permalink / raw)
To: James Bottomley; +Cc: Hannes Reinecke, linux-ide, linux-scsi
Hello, James.
On Mon, Aug 03, 2015 at 08:42:43AM -0700, James Bottomley wrote:
> I'd think it would be the same reason as all modern transports: it's
> faster and allows processing of sense data in-band. Under the old
> regime, the device is effectively frozen until you collect the data.
> Under autosense, the data is collected as part of the in-band command
> processing, so it doesn't stall the device.
>
> Modern drives (and protocols) are moving towards being somewhat more
> chatty with sense data. It doesn't just signal an error, mostly it's
> just reporting about drive characteristics or other advisory stuff.
> This means that if you handle it the old way, you'll get more drive
> stalls and a corresponding reduction in throughput.
The problem is not the "auto" part but the "sense" part, I guess. ATA
devices (the harddisks) never reported sense data and instead had a
more rudimentary error bits and for newer devices NCQ log pages, so
libata EH decodes those error information and takes appropriate
actions for the indicated error condition.
Hannes's patchset makes ATA devices mostly bypass libata EH when sense
data is present. For, say, unrecoverable read errors, it'd be
possible to make this scheme work (broken currently tho); however,
libata and SCSI aren't that closely tied and there currently is no way
for SCSI to tell libata that, e.g., link error was detected on the
device side, so libata will fail to take link recovery actions on
those cases.
This *can* be made to work in a couple different ways but what's
implemented now is pretty broken and making it work properly in any
other way than integrating sense decoding into libata EH would require
major restructuring of the whole thing which I'm not sure would be
worthwhile at this point.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 1/6] libata: Do not retry commands with valid autosense
2015-08-03 15:55 ` Tejun Heo
@ 2015-08-03 16:44 ` James Bottomley
2015-08-03 16:50 ` Tejun Heo
2015-08-03 16:47 ` Hannes Reinecke
1 sibling, 1 reply; 24+ messages in thread
From: James Bottomley @ 2015-08-03 16:44 UTC (permalink / raw)
To: Tejun Heo; +Cc: Hannes Reinecke, linux-ide, linux-scsi
On Mon, 2015-08-03 at 11:55 -0400, Tejun Heo wrote:
> Hello, James.
>
> On Mon, Aug 03, 2015 at 08:42:43AM -0700, James Bottomley wrote:
> > I'd think it would be the same reason as all modern transports: it's
> > faster and allows processing of sense data in-band. Under the old
> > regime, the device is effectively frozen until you collect the data.
> > Under autosense, the data is collected as part of the in-band command
> > processing, so it doesn't stall the device.
> >
> > Modern drives (and protocols) are moving towards being somewhat more
> > chatty with sense data. It doesn't just signal an error, mostly it's
> > just reporting about drive characteristics or other advisory stuff.
> > This means that if you handle it the old way, you'll get more drive
> > stalls and a corresponding reduction in throughput.
>
> The problem is not the "auto" part but the "sense" part, I guess. ATA
> devices (the harddisks) never reported sense data and instead had a
> more rudimentary error bits and for newer devices NCQ log pages, so
> libata EH decodes those error information and takes appropriate
> actions for the indicated error condition.
>
> Hannes's patchset makes ATA devices mostly bypass libata EH when sense
> data is present. For, say, unrecoverable read errors, it'd be
> possible to make this scheme work (broken currently tho); however,
> libata and SCSI aren't that closely tied and there currently is no way
> for SCSI to tell libata that, e.g., link error was detected on the
> device side, so libata will fail to take link recovery actions on
> those cases.
>
> This *can* be made to work in a couple different ways but what's
> implemented now is pretty broken and making it work properly in any
> other way than integrating sense decoding into libata EH would require
> major restructuring of the whole thing which I'm not sure would be
> worthwhile at this point.
I'm not arguing that *this* patch is the best way to do it. You asked
*why* autosense and that's what I answered. I think there's time to
work out the implementation details to get them to be correct and well
structured.
James
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 1/6] libata: Do not retry commands with valid autosense
2015-08-03 16:44 ` James Bottomley
@ 2015-08-03 16:50 ` Tejun Heo
0 siblings, 0 replies; 24+ messages in thread
From: Tejun Heo @ 2015-08-03 16:50 UTC (permalink / raw)
To: James Bottomley; +Cc: Hannes Reinecke, linux-ide, linux-scsi
Hello, James.
On Mon, Aug 03, 2015 at 09:44:06AM -0700, James Bottomley wrote:
> I'm not arguing that *this* patch is the best way to do it. You asked
> *why* autosense and that's what I answered. I think there's time to
Heh, that was mostly me being confused. I was thinking NCQ autosense
was the only way ATA devices would report sense data.
> work out the implementation details to get them to be correct and well
> structured.
Yeah, definitely.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 1/6] libata: Do not retry commands with valid autosense
2015-08-03 15:55 ` Tejun Heo
2015-08-03 16:44 ` James Bottomley
@ 2015-08-03 16:47 ` Hannes Reinecke
2015-08-03 17:01 ` Tejun Heo
1 sibling, 1 reply; 24+ messages in thread
From: Hannes Reinecke @ 2015-08-03 16:47 UTC (permalink / raw)
To: Tejun Heo, James Bottomley; +Cc: linux-ide, linux-scsi
On 08/03/2015 05:55 PM, Tejun Heo wrote:
> Hello, James.
>
> On Mon, Aug 03, 2015 at 08:42:43AM -0700, James Bottomley wrote:
>> I'd think it would be the same reason as all modern transports: it's
>> faster and allows processing of sense data in-band. Under the old
>> regime, the device is effectively frozen until you collect the data.
>> Under autosense, the data is collected as part of the in-band command
>> processing, so it doesn't stall the device.
>>
>> Modern drives (and protocols) are moving towards being somewhat more
>> chatty with sense data. It doesn't just signal an error, mostly it's
>> just reporting about drive characteristics or other advisory stuff.
>> This means that if you handle it the old way, you'll get more drive
>> stalls and a corresponding reduction in throughput.
>
> The problem is not the "auto" part but the "sense" part, I guess. ATA
> devices (the harddisks) never reported sense data and instead had a
> more rudimentary error bits and for newer devices NCQ log pages, so
> libata EH decodes those error information and takes appropriate
> actions for the indicated error condition.
>
> Hannes's patchset makes ATA devices mostly bypass libata EH when sense
> data is present. For, say, unrecoverable read errors, it'd be
> possible to make this scheme work (broken currently tho); however,
> libata and SCSI aren't that closely tied and there currently is no way
> for SCSI to tell libata that, e.g., link error was detected on the
> device side, so libata will fail to take link recovery actions on
> those cases.
>
> This *can* be made to work in a couple different ways but what's
> implemented now is pretty broken and making it work properly in any
> other way than integrating sense decoding into libata EH would require
> major restructuring of the whole thing which I'm not sure would be
> worthwhile at this point.
>
At the moment NCQ autosense is mostly used to provide the host with more
details for a failed I/O. The typical case here is (no small surprise)
ZAC disks, which use autosense to inform the host about
a malformed I/O.
It is _not_ being used as a replacement for existing error behaviour,
(ie link errors are not being signalled with that; how could they
if there is no link?); in fact, during testing I"ve seen both, autosense
I/O failures and normal I/O failures for which autosense is
not set, and the normal error handling kicks in.
It's not that I've disable the original error handler completely,
it's only bypassed for I/O failure where a sense code is provided.
And the drive surely knows which error occurs, so we'd be daft not be
using that.
So I think disabling autosense completely is a bit extreme...
Cheers,
Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@suse.de +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 1/6] libata: Do not retry commands with valid autosense
2015-08-03 16:47 ` Hannes Reinecke
@ 2015-08-03 17:01 ` Tejun Heo
2015-08-03 18:21 ` Hannes Reinecke
0 siblings, 1 reply; 24+ messages in thread
From: Tejun Heo @ 2015-08-03 17:01 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: James Bottomley, linux-ide, linux-scsi
Hello, Hannes.
On Mon, Aug 03, 2015 at 06:47:46PM +0200, Hannes Reinecke wrote:
> At the moment NCQ autosense is mostly used to provide the host with more
> details for a failed I/O. The typical case here is (no small surprise)
> ZAC disks, which use autosense to inform the host about
> a malformed I/O.
>
> It is _not_ being used as a replacement for existing error behaviour,
> (ie link errors are not being signalled with that; how could they
> if there is no link?); in fact, during testing I"ve seen both, autosense
Hmmm? Devices can report link error via TF bits and you're bypassing
TF analysis completley if sense data is present.
> I/O failures and normal I/O failures for which autosense is
> not set, and the normal error handling kicks in.
>
> It's not that I've disable the original error handler completely,
> it's only bypassed for I/O failure where a sense code is provided.
> And the drive surely knows which error occurs, so we'd be daft not be
> using that.
The patches are altering EH actions in a very subtle way depending on
*how* an error is reported, not *what* is reported, which is a pretty
silly thing to do. It makes things a lot more confusing to follow and
predict. I really don't think this is an acceptable behavior.
> So I think disabling autosense completely is a bit extreme...
Please restructure the feature so that it doesn't interfere with the
usual EH behavior. e.g. leave the EH actions alone unless explicitly
necessary but report detailed error information upwards. If the extra
error information can be helpful in determining what EH actions to
take, factoring in that information can be helpful too but I'm not too
convinced that'd make a huge difference.
Also, please consider that ATA_QCFLAG_SENSE_VALID handling assumes
that the reporting device is an ATAPI device and the command in
question is not a regular IO one. That's why EH ignores AC_ERR_DEV or
AC_ERR_OTHER if ATA_QCFLAG_SENSE_VALID is set. This doesn't work out
for the new ATA usage at all.
For now, I've reverted the changes as this is actively detrimental.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 1/6] libata: Do not retry commands with valid autosense
2015-08-03 17:01 ` Tejun Heo
@ 2015-08-03 18:21 ` Hannes Reinecke
0 siblings, 0 replies; 24+ messages in thread
From: Hannes Reinecke @ 2015-08-03 18:21 UTC (permalink / raw)
To: Tejun Heo; +Cc: James Bottomley, linux-ide, linux-scsi
On 08/03/2015 07:01 PM, Tejun Heo wrote:
> Hello, Hannes.
>
> On Mon, Aug 03, 2015 at 06:47:46PM +0200, Hannes Reinecke wrote:
>> At the moment NCQ autosense is mostly used to provide the host with more
>> details for a failed I/O. The typical case here is (no small surprise)
>> ZAC disks, which use autosense to inform the host about
>> a malformed I/O.
>>
>> It is _not_ being used as a replacement for existing error behaviour,
>> (ie link errors are not being signalled with that; how could they
>> if there is no link?); in fact, during testing I"ve seen both, autosense
>
> Hmmm? Devices can report link error via TF bits and you're bypassing
> TF analysis completley if sense data is present.
>
But sense data will never be present for a link error ... and I'm not
disabling that.
>> I/O failures and normal I/O failures for which autosense is
>> not set, and the normal error handling kicks in.
>>
>> It's not that I've disable the original error handler completely,
>> it's only bypassed for I/O failure where a sense code is provided.
>> And the drive surely knows which error occurs, so we'd be daft not be
>> using that.
>
> The patches are altering EH actions in a very subtle way depending on
> *how* an error is reported, not *what* is reported, which is a pretty
> silly thing to do. It makes things a lot more confusing to follow and
> predict. I really don't think this is an acceptable behavior.
>
But if we were judging on _what_ is being reported we would have to know
which sense code the drive will be reporting, in effect carrying
a massive table of possible sense codes, and map this to the actions.
Do you really want to go that way?
>> So I think disabling autosense completely is a bit extreme...
>
> Please restructure the feature so that it doesn't interfere with the
> usual EH behavior. e.g. leave the EH actions alone unless explicitly
> necessary but report detailed error information upwards. If the extra
> error information can be helpful in determining what EH actions to
> take, factoring in that information can be helpful too but I'm not too
> convinced that'd make a huge difference.
>
It does if we can avoid the retry on the libata layer.
> Also, please consider that ATA_QCFLAG_SENSE_VALID handling assumes
> that the reporting device is an ATAPI device and the command in
> question is not a regular IO one. That's why EH ignores AC_ERR_DEV or
> AC_ERR_OTHER if ATA_QCFLAG_SENSE_VALID is set. This doesn't work out
> for the new ATA usage at all.
>
I've just mapped onto ATA_QCFLAGS_SENSE_VALID as I've found this to
reasonably close to what I've been needing.
If that's the wrong choice of course I can modify this.
> For now, I've reverted the changes as this is actively detrimental.
>
Oh. So you've tested this on a device with autosense enabled?
I haven't seen any negative effects with this patchset, autosense
enabled or not.
Cheers,
Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@suse.de +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH 2/6] libata-scsi: use ata_scsi_set_sense when generating ATA sense
2015-07-31 13:02 [PATCH 0/6] ZAC host-aware device support Hannes Reinecke
2015-07-31 13:02 ` [PATCH 1/6] libata: Do not retry commands with valid autosense Hannes Reinecke
@ 2015-07-31 13:02 ` Hannes Reinecke
2015-07-31 13:02 ` [PATCH 3/6] libata: implement ZBC IN translation Hannes Reinecke
` (5 subsequent siblings)
7 siblings, 0 replies; 24+ messages in thread
From: Hannes Reinecke @ 2015-07-31 13:02 UTC (permalink / raw)
To: Tejun Heo; +Cc: linux-ide, linux-scsi, James Bottomley, Hannes Reinecke
When generating ATA sense we should be using 'ata_scsi_set_sense'
and avoid the hand-crafted functions.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/libata-scsi.c | 41 ++++++++---------------------------------
1 file changed, 8 insertions(+), 33 deletions(-)
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 641a61a..7fc1bb4 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -1064,45 +1064,26 @@ static void ata_gen_passthru_sense(struct ata_queued_cmd *qc)
*/
static void ata_gen_ata_sense(struct ata_queued_cmd *qc)
{
- struct ata_device *dev = qc->dev;
struct scsi_cmnd *cmd = qc->scsicmd;
struct ata_taskfile *tf = &qc->result_tf;
- unsigned char *sb = cmd->sense_buffer;
- unsigned char *desc = sb + 8;
int verbose = qc->ap->ops->error_handler == NULL;
- u64 block;
- memset(sb, 0, SCSI_SENSE_BUFFERSIZE);
-
- cmd->result = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION;
-
- /* sense data is current and format is descriptor */
- sb[0] = 0x72;
+ set_driver_byte(cmd, DRIVER_SENSE);
/* Use ata_to_sense_error() to map status register bits
* onto sense key, asc & ascq.
*/
if (qc->err_mask ||
tf->command & (ATA_BUSY | ATA_DF | ATA_ERR | ATA_DRQ)) {
- ata_to_sense_error(qc->ap->print_id, tf->command, tf->feature,
- &sb[1], &sb[2], &sb[3], verbose);
- sb[1] &= 0x0f;
- }
+ u8 sense_key, asc, ascq;
- block = ata_tf_read_block(&qc->result_tf, dev);
-
- /* information sense data descriptor */
- sb[7] = 12;
- desc[0] = 0x00;
- desc[1] = 10;
+ ata_to_sense_error(qc->ap->print_id, tf->command, tf->feature,
+ &sense_key, &asc, &ascq, verbose);
- desc[2] |= 0x80; /* valid */
- desc[6] = block >> 40;
- desc[7] = block >> 32;
- desc[8] = block >> 24;
- desc[9] = block >> 16;
- desc[10] = block >> 8;
- desc[11] = block;
+ ata_scsi_set_sense(cmd, sense_key, asc, ascq);
+ ata_scsi_set_sense_information(cmd, &qc->result_tf);
+ } else
+ ata_scsi_set_sense(cmd, ABORTED_COMMAND, 0, 0);
}
static void ata_scsi_sdev_config(struct scsi_device *sdev)
@@ -1797,12 +1778,6 @@ static void ata_scsi_qc_complete(struct ata_queued_cmd *qc)
} else if (!need_sense) {
cmd->result = SAM_STAT_GOOD;
} else {
- /* TODO: decide which descriptor format to use
- * for 48b LBA devices and call that here
- * instead of the fixed desc, which is only
- * good for smaller LBA (and maybe CHS?)
- * devices.
- */
ata_gen_ata_sense(qc);
}
}
--
1.8.5.2
^ permalink raw reply related [flat|nested] 24+ messages in thread* [PATCH 3/6] libata: implement ZBC IN translation
2015-07-31 13:02 [PATCH 0/6] ZAC host-aware device support Hannes Reinecke
2015-07-31 13:02 ` [PATCH 1/6] libata: Do not retry commands with valid autosense Hannes Reinecke
2015-07-31 13:02 ` [PATCH 2/6] libata-scsi: use ata_scsi_set_sense when generating ATA sense Hannes Reinecke
@ 2015-07-31 13:02 ` Hannes Reinecke
2015-07-31 13:02 ` [PATCH 4/6] libata: Implement ZBC OUT translation Hannes Reinecke
` (4 subsequent siblings)
7 siblings, 0 replies; 24+ messages in thread
From: Hannes Reinecke @ 2015-07-31 13:02 UTC (permalink / raw)
To: Tejun Heo; +Cc: linux-ide, linux-scsi, James Bottomley, Hannes Reinecke
ZAC drives implement 'zac management in' command template,
which maps onto the ZBC IN command.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/libata-eh.c | 1 +
drivers/ata/libata-scsi.c | 141 ++++++++++++++++++++++++++++++++++++++++++
include/linux/ata.h | 4 ++
include/scsi/scsi_proto.h | 3 +
include/trace/events/libata.h | 1 +
5 files changed, 150 insertions(+)
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 1b4e9d1..55a0abf 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2492,6 +2492,7 @@ const char *ata_get_cmd_descript(u8 command)
{ ATA_CMD_CFA_WRITE_MULT_NE, "CFA WRITE MULTIPLE WITHOUT ERASE" },
{ 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_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 7fc1bb4..90f8d9e 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -3178,6 +3178,144 @@ static unsigned int ata_scsi_write_same_xlat(struct ata_queued_cmd *qc)
return 1;
}
+/*
+ * ata_scsi_report_zones_complete
+ *
+ * Convert T-13 little-endian field representation into
+ * T-10 big-endian field representation.
+ */
+static void ata_scsi_report_zones_complete(struct ata_queued_cmd *qc)
+{
+ struct scsi_cmnd *scmd = qc->scsicmd;
+ struct sg_mapping_iter miter;
+ unsigned long flags;
+ unsigned int bytes = 0;
+
+ sg_miter_start(&miter, scsi_sglist(scmd), scsi_sg_count(scmd),
+ SG_MITER_TO_SG | SG_MITER_ATOMIC);
+
+ local_irq_save(flags);
+ while (sg_miter_next(&miter)) {
+ unsigned int offset = 0;
+
+ if (bytes == 0) {
+ char *hdr;
+ u32 list_length;
+ u64 max_lba, opt_lba;
+ u16 same;
+
+ /* Swizzle header */
+ hdr = miter.addr;
+ list_length = get_unaligned_le32(&hdr[0]);
+ same = get_unaligned_le16(&hdr[4]);
+ max_lba = get_unaligned_le64(&hdr[8]);
+ opt_lba = get_unaligned_le64(&hdr[16]);
+ put_unaligned_be32(list_length, &hdr[0]);
+ hdr[4] = same & 0xf;
+ put_unaligned_be64(max_lba, &hdr[8]);
+ put_unaligned_be64(opt_lba, &hdr[16]);
+ offset += 64;
+ bytes += 64;
+ }
+ while (offset < miter.length) {
+ char *rec;
+ u8 cond, type, non_seq, reset;
+ u64 size, start, wp;
+
+ /* Swizzle zone descriptor */
+ rec = miter.addr + offset;
+ type = rec[0] & 0xf;
+ cond = (rec[1] >> 4) & 0xf;
+ non_seq = (rec[1] & 2);
+ reset = (rec[1] & 1);
+ size = get_unaligned_le64(&rec[8]);
+ start = get_unaligned_le64(&rec[16]);
+ wp = get_unaligned_le64(&rec[24]);
+ rec[0] = type;
+ rec[1] = (cond << 4) | non_seq | reset;
+ put_unaligned_be64(size, &rec[8]);
+ put_unaligned_be64(start, &rec[16]);
+ put_unaligned_be64(wp, &rec[24]);
+ WARN_ON(offset + 64 > miter.length);
+ offset += 64;
+ bytes += 64;
+ }
+ }
+ sg_miter_stop(&miter);
+ local_irq_restore(flags);
+
+ ata_scsi_qc_complete(qc);
+}
+
+static unsigned int ata_scsi_zbc_in_xlat(struct ata_queued_cmd *qc)
+{
+ struct ata_taskfile *tf = &qc->tf;
+ struct scsi_cmnd *scmd = qc->scsicmd;
+ const u8 *cdb = scmd->cmnd;
+ u16 sect;
+ u8 sa, options;
+ u64 block;
+ u32 n_block;
+
+ if (unlikely(scmd->cmd_len < 16)) {
+ ata_dev_warn(qc->dev, "invalid cdb length %d\n",
+ scmd->cmd_len);
+ goto invalid_fld;
+ }
+ scsi_16_lba_len(cdb, &block, &n_block);
+ if (n_block != scsi_bufflen(scmd)) {
+ ata_dev_warn(qc->dev, "non-matching transfer count (%d/%d)\n",
+ n_block, scsi_bufflen(scmd));
+ goto invalid_fld;
+ }
+ sa = cdb[1] & 0x1f;
+ if (sa != ZI_REPORT_ZONES) {
+ ata_dev_warn(qc->dev, "invalid service action %d\n", sa);
+ goto invalid_fld;
+ }
+ /*
+ * ZAC allows only for transfers in 512 byte blocks,
+ * and uses a 16 bit value for the transfer count.
+ */
+ if ((n_block / 512) > 0xffff || n_block < 512 || (n_block % 512)) {
+ ata_dev_warn(qc->dev, "invalid transfer count %d\n", n_block);
+ goto invalid_fld;
+ }
+ sect = n_block / 512;
+ options = cdb[14];
+
+ tf->command = ATA_CMD_ZAC_MGMT_IN;
+ tf->feature = ATA_SUBCMD_ZAC_MGMT_IN_REPORT_ZONES;
+ if (qc->dev->dma_mode)
+ tf->protocol = ATA_PROT_DMA;
+ else
+ tf->protocol = ATA_PROT_PIO;
+ tf->hob_feature = options & 0x3f;
+ tf->hob_nsect = (sect >> 8) & 0xff;
+ tf->nsect = sect & 0xff;
+ tf->device |= (1 << 6);
+ tf->lbah = (block >> 16) & 0xff;
+ tf->lbam = (block >> 8) & 0xff;
+ tf->lbal = block & 0xff;
+ tf->hob_lbah = (block >> 40) & 0xff;
+ tf->hob_lbam = (block >> 32) & 0xff;
+ tf->hob_lbal = (block >> 24) & 0xff;
+
+ tf->flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE | ATA_TFLAG_LBA48;
+ qc->flags |= ATA_QCFLAG_RESULT_TF;
+
+ ata_qc_set_pc_nbytes(qc);
+
+ qc->complete_fn = ata_scsi_report_zones_complete;
+
+ return 0;
+
+ invalid_fld:
+ ata_scsi_set_sense(scmd, ILLEGAL_REQUEST, 0x24, 0x00);
+ /* "Invalid field in cdb" */
+ return 1;
+}
+
/**
* ata_mselect_caching - Simulate MODE SELECT for caching info page
* @qc: Storage for translated ATA taskfile
@@ -3405,6 +3543,9 @@ static inline ata_xlat_func_t ata_get_xlat_func(struct ata_device *dev, u8 cmd)
return ata_scsi_mode_select_xlat;
break;
+ case ZBC_IN:
+ return ata_scsi_zbc_in_xlat;
+
case START_STOP:
return ata_scsi_start_stop_xlat;
}
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 6c78956..3521afc 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -301,6 +301,7 @@ enum {
ATA_CMD_CFA_WRITE_MULT_NE = 0xCD,
ATA_CMD_REQ_SENSE_DATA = 0x0B,
ATA_CMD_SANITIZE_DEVICE = 0xB4,
+ ATA_CMD_ZAC_MGMT_IN = 0x4A,
/* marked obsolete in the ATA/ATAPI-7 spec */
ATA_CMD_RESTORE = 0x10,
@@ -309,6 +310,9 @@ enum {
ATA_SUBCMD_FPDMA_SEND_DSM = 0x00,
ATA_SUBCMD_FPDMA_SEND_WR_LOG_DMA_EXT = 0x02,
+ /* Subcmds for ATA_CMD_ZAC_MGMT_IN */
+ ATA_SUBCMD_ZAC_MGMT_IN_REPORT_ZONES = 0x00,
+
/* READ_LOG_EXT pages */
ATA_LOG_SATA_NCQ = 0x10,
ATA_LOG_NCQ_SEND_RECV = 0x13,
diff --git a/include/scsi/scsi_proto.h b/include/scsi/scsi_proto.h
index a9fbf1b..de14d19 100644
--- a/include/scsi/scsi_proto.h
+++ b/include/scsi/scsi_proto.h
@@ -115,6 +115,7 @@
#define VERIFY_16 0x8f
#define SYNCHRONIZE_CACHE_16 0x91
#define WRITE_SAME_16 0x93
+#define ZBC_IN 0x95
#define SERVICE_ACTION_BIDIRECTIONAL 0x9d
#define SERVICE_ACTION_IN_16 0x9e
#define SERVICE_ACTION_OUT_16 0x9f
@@ -143,6 +144,8 @@
#define MO_SET_PRIORITY 0x0e
#define MO_SET_TIMESTAMP 0x0f
#define MO_MANAGEMENT_PROTOCOL_OUT 0x10
+/* values for ZBC_IN */
+#define ZI_REPORT_ZONES 0x00
/* values for variable length command */
#define XDREAD_32 0x03
#define XDWRITE_32 0x04
diff --git a/include/trace/events/libata.h b/include/trace/events/libata.h
index 8b0fbd9..02ec4e5 100644
--- a/include/trace/events/libata.h
+++ b/include/trace/events/libata.h
@@ -97,6 +97,7 @@
ata_opcode_name(ATA_CMD_CFA_WRITE_MULT_NE), \
ata_opcode_name(ATA_CMD_REQ_SENSE_DATA), \
ata_opcode_name(ATA_CMD_SANITIZE_DEVICE), \
+ ata_opcode_name(ATA_CMD_ZAC_MGMT_IN), \
ata_opcode_name(ATA_CMD_RESTORE), \
ata_opcode_name(ATA_CMD_READ_LONG), \
ata_opcode_name(ATA_CMD_READ_LONG_ONCE), \
--
1.8.5.2
^ permalink raw reply related [flat|nested] 24+ messages in thread* [PATCH 4/6] libata: Implement ZBC OUT translation
2015-07-31 13:02 [PATCH 0/6] ZAC host-aware device support Hannes Reinecke
` (2 preceding siblings ...)
2015-07-31 13:02 ` [PATCH 3/6] libata: implement ZBC IN translation Hannes Reinecke
@ 2015-07-31 13:02 ` Hannes Reinecke
2015-07-31 13:02 ` [PATCH 5/6] libata: support device-managed ZAC devices Hannes Reinecke
` (3 subsequent siblings)
7 siblings, 0 replies; 24+ messages in thread
From: Hannes Reinecke @ 2015-07-31 13:02 UTC (permalink / raw)
To: Tejun Heo; +Cc: linux-ide, linux-scsi, James Bottomley, Hannes Reinecke
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 | 65 +++++++++++++++++++++++++++++++++++++++++++
include/linux/ata.h | 7 +++++
include/scsi/scsi_proto.h | 6 ++++
include/trace/events/libata.h | 1 +
5 files changed, 80 insertions(+)
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 55a0abf..e596436 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2493,6 +2493,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 90f8d9e..e0dede3 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -3316,6 +3316,68 @@ static unsigned int ata_scsi_zbc_in_xlat(struct ata_queued_cmd *qc)
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;
+
+ if (unlikely(scmd->cmd_len < 16))
+ 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;
+ if (sa != ZO_RESET_WRITE_POINTER)
+ goto invalid_fld;
+
+ scsi_16_lba_len(cdb, &block, &n_block);
+ if (n_block) {
+ /*
+ * ZAC MANAGEMENT OUT doesn't define any length
+ */
+ goto invalid_fld;
+ }
+ if (block > dev->n_sectors)
+ goto out_of_range;
+
+ reset_all = cdb[14] & 0x1;
+
+ tf->protocol = ATA_PROT_NODATA;
+ tf->command = ATA_CMD_ZAC_MGMT_OUT;
+ tf->feature = sa;
+ tf->hob_feature = reset_all & 0x1;
+
+ tf->lbah = (block >> 16) & 0xff;
+ tf->lbam = (block >> 8) & 0xff;
+ tf->lbal = block & 0xff;
+ tf->hob_lbah = (block >> 40) & 0xff;
+ tf->hob_lbam = (block >> 32) & 0xff;
+ tf->hob_lbal = (block >> 24) & 0xff;
+ tf->device |= ATA_LBA;
+ tf->flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE | ATA_TFLAG_LBA48;
+
+ return 0;
+
+ invalid_fld:
+ ata_scsi_set_sense(scmd, ILLEGAL_REQUEST, 0x24, 0x00);
+ /* "Invalid field in cdb" */
+ return 1;
+ out_of_range:
+ ata_scsi_set_sense(scmd, ILLEGAL_REQUEST, 0x21, 0x00);
+ /* "Logical Block Address out of range" */
+ return 1;
+}
+
/**
* ata_mselect_caching - Simulate MODE SELECT for caching info page
* @qc: Storage for translated ATA taskfile
@@ -3546,6 +3608,9 @@ static inline ata_xlat_func_t ata_get_xlat_func(struct ata_device *dev, u8 cmd)
case ZBC_IN:
return ata_scsi_zbc_in_xlat;
+ case ZBC_OUT:
+ return ata_scsi_zbc_out_xlat;
+
case START_STOP:
return ata_scsi_start_stop_xlat;
}
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 3521afc..ef7b14a 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -302,6 +302,7 @@ enum {
ATA_CMD_REQ_SENSE_DATA = 0x0B,
ATA_CMD_SANITIZE_DEVICE = 0xB4,
ATA_CMD_ZAC_MGMT_IN = 0x4A,
+ ATA_CMD_ZAC_MGMT_OUT = 0x9F,
/* marked obsolete in the ATA/ATAPI-7 spec */
ATA_CMD_RESTORE = 0x10,
@@ -313,6 +314,12 @@ enum {
/* Subcmds for ATA_CMD_ZAC_MGMT_IN */
ATA_SUBCMD_ZAC_MGMT_IN_REPORT_ZONES = 0x00,
+ /* Subcmds for ATA_CMD_ZAC_MGMT_OUT */
+ ATA_SUBCMD_ZAC_MGMT_OUT_CLOSE_ZONE = 0x01,
+ ATA_SUBCMD_ZAC_MGMT_OUT_FINISH_ZONE = 0x02,
+ ATA_SUBCMD_ZAC_MGMT_OUT_OPEN_ZONE = 0x03,
+ ATA_SUBCMD_ZAC_MGMT_OUT_RESET_WRITE_POINTER = 0x04,
+
/* READ_LOG_EXT pages */
ATA_LOG_SATA_NCQ = 0x10,
ATA_LOG_NCQ_SEND_RECV = 0x13,
diff --git a/include/scsi/scsi_proto.h b/include/scsi/scsi_proto.h
index de14d19..dd9d973 100644
--- a/include/scsi/scsi_proto.h
+++ b/include/scsi/scsi_proto.h
@@ -115,6 +115,7 @@
#define VERIFY_16 0x8f
#define SYNCHRONIZE_CACHE_16 0x91
#define WRITE_SAME_16 0x93
+#define ZBC_OUT 0x94
#define ZBC_IN 0x95
#define SERVICE_ACTION_BIDIRECTIONAL 0x9d
#define SERVICE_ACTION_IN_16 0x9e
@@ -146,6 +147,11 @@
#define MO_MANAGEMENT_PROTOCOL_OUT 0x10
/* values for ZBC_IN */
#define ZI_REPORT_ZONES 0x00
+/* values for ZBC_OUT */
+#define ZO_CLOSE_ZONE 0x01
+#define ZO_OPEN_ZONE 0x02
+#define ZO_FINISH_ZONE 0x03
+#define ZO_RESET_WRITE_POINTER 0x04
/* values for variable length command */
#define XDREAD_32 0x03
#define XDWRITE_32 0x04
diff --git a/include/trace/events/libata.h b/include/trace/events/libata.h
index 02ec4e5..24dcd43 100644
--- a/include/trace/events/libata.h
+++ b/include/trace/events/libata.h
@@ -98,6 +98,7 @@
ata_opcode_name(ATA_CMD_REQ_SENSE_DATA), \
ata_opcode_name(ATA_CMD_SANITIZE_DEVICE), \
ata_opcode_name(ATA_CMD_ZAC_MGMT_IN), \
+ ata_opcode_name(ATA_CMD_ZAC_MGMT_OUT), \
ata_opcode_name(ATA_CMD_RESTORE), \
ata_opcode_name(ATA_CMD_READ_LONG), \
ata_opcode_name(ATA_CMD_READ_LONG_ONCE), \
--
1.8.5.2
^ permalink raw reply related [flat|nested] 24+ messages in thread* [PATCH 5/6] libata: support device-managed ZAC devices
2015-07-31 13:02 [PATCH 0/6] ZAC host-aware device support Hannes Reinecke
` (3 preceding siblings ...)
2015-07-31 13:02 ` [PATCH 4/6] libata: Implement ZBC OUT translation Hannes Reinecke
@ 2015-07-31 13:02 ` Hannes Reinecke
2015-07-31 13:02 ` [PATCH 6/6] libata: support host-aware " Hannes Reinecke
` (2 subsequent siblings)
7 siblings, 0 replies; 24+ messages in thread
From: Hannes Reinecke @ 2015-07-31 13:02 UTC (permalink / raw)
To: Tejun Heo; +Cc: linux-ide, linux-scsi, James Bottomley, Hannes Reinecke
Device-managed ZAC devices just set the zoned capabilities field
in INQUIRY byte 69 (cf ACS-4). This corresponds to the 'zoned'
field in the block device characteristics VPD page.
As this is only defined in SPC-5/SBC-4 we also need to update
the supported SCSI version descriptor.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/libata-scsi.c | 19 ++++++++++---------
include/linux/ata.h | 5 +++++
2 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index e0dede3..a5d1e74 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -1987,14 +1987,14 @@ static unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf)
0x00,
0xA0, /* SAM-5 (no version claimed) */
- 0x04,
- 0xC0, /* SBC-3 (no version claimed) */
+ 0x06,
+ 0x00, /* SBC-4 (no version claimed) */
- 0x04,
- 0x60, /* SPC-4 (no version claimed) */
+ 0x05,
+ 0xC0, /* SPC-5 (no version claimed) */
0x60,
- 0x20, /* ZBC (no version claimed) */
+ 0x22, /* ZBC r02 */
};
u8 hdr[] = {
@@ -2011,10 +2011,8 @@ static unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf)
if (ata_id_removable(args->id))
hdr[1] |= (1 << 7);
- if (args->dev->class == ATA_DEV_ZAC) {
+ if (args->dev->class == ATA_DEV_ZAC)
hdr[0] = TYPE_ZBC;
- hdr[2] = 0x6; /* ZBC is defined in SPC-4 */
- }
memcpy(rbuf, hdr, sizeof(hdr));
memcpy(&rbuf[8], "ATA ", 8);
@@ -2028,7 +2026,7 @@ static unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf)
if (rbuf[32] == 0 || rbuf[32] == ' ')
memcpy(&rbuf[32], "n/a ", 4);
- if (args->dev->class == ATA_DEV_ZAC)
+ if (ata_id_zoned_cap(args->id) || args->dev->class == ATA_DEV_ZAC)
memcpy(rbuf + 58, versions_zbc, sizeof(versions_zbc));
else
memcpy(rbuf + 58, versions, sizeof(versions));
@@ -2224,12 +2222,15 @@ static unsigned int ata_scsiop_inq_b1(struct ata_scsi_args *args, u8 *rbuf)
{
int form_factor = ata_id_form_factor(args->id);
int media_rotation_rate = ata_id_rotation_rate(args->id);
+ u8 zoned = ata_id_zoned_cap(args->id);
rbuf[1] = 0xb1;
rbuf[3] = 0x3c;
rbuf[4] = media_rotation_rate >> 8;
rbuf[5] = media_rotation_rate;
rbuf[7] = form_factor;
+ if (zoned)
+ rbuf[8] = (zoned << 4);
return 0;
}
diff --git a/include/linux/ata.h b/include/linux/ata.h
index ef7b14a..2d604ca 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -900,6 +900,11 @@ static inline bool ata_id_is_ssd(const u16 *id)
return id[ATA_ID_ROT_SPEED] == 0x01;
}
+static inline u8 ata_id_zoned_cap(const u16 *id)
+{
+ return (id[ATA_ID_ADDITIONAL_SUPP] & 0x3);
+}
+
static inline bool ata_id_pio_need_iordy(const u16 *id, const u8 pio)
{
/* CF spec. r4.1 Table 22 says no IORDY on PIO5 and PIO6. */
--
1.8.5.2
^ permalink raw reply related [flat|nested] 24+ messages in thread* [PATCH 6/6] libata: support host-aware ZAC devices
2015-07-31 13:02 [PATCH 0/6] ZAC host-aware device support Hannes Reinecke
` (4 preceding siblings ...)
2015-07-31 13:02 ` [PATCH 5/6] libata: support device-managed ZAC devices Hannes Reinecke
@ 2015-07-31 13:02 ` Hannes Reinecke
2015-08-02 15:47 ` [PATCH 0/6] ZAC host-aware device support Tejun Heo
2015-08-02 16:11 ` James Bottomley
7 siblings, 0 replies; 24+ messages in thread
From: Hannes Reinecke @ 2015-07-31 13:02 UTC (permalink / raw)
To: Tejun Heo; +Cc: linux-ide, linux-scsi, James Bottomley, Hannes Reinecke
Byte 69 bits 0:1 in the IDENTIFY DEVICE data indicate a
host-aware ZAC device.
And whenever we detect a ZAC-compatible device we should
be displaying the zoned block characteristics VPD page.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/libata-core.c | 50 +++++++++++++++++++++++++++++++++++++++++++++++
drivers/ata/libata-scsi.c | 33 +++++++++++++++++++++++++++++--
include/linux/ata.h | 1 +
include/linux/libata.h | 7 +++++++
4 files changed, 89 insertions(+), 2 deletions(-)
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index db5d9f7..d8c7bbc 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -65,6 +65,7 @@
#include <scsi/scsi_host.h>
#include <linux/libata.h>
#include <asm/byteorder.h>
+#include <asm/unaligned.h>
#include <linux/cdrom.h>
#include <linux/ratelimit.h>
#include <linux/pm_runtime.h>
@@ -2165,6 +2166,54 @@ static void ata_dev_config_sense_reporting(struct ata_device *dev)
}
}
+static void ata_dev_config_zac(struct ata_device *dev)
+{
+ struct ata_port *ap = dev->link->ap;
+ unsigned int err_mask;
+ u8 *identify_buf = ap->sector_buf;
+
+ dev->zac_zones_optimal_open = (u32)-1;
+ dev->zac_zones_optimal_nonseq = (u32)-1;
+ dev->zac_zones_max_open = (u32)-1;
+
+ /*
+ * Always set the 'ZAC' flag for Host-managed devices.
+ */
+ if (dev->class == ATA_DEV_ZAC)
+ dev->flags |= ATA_DFLAG_ZAC;
+ else if (ata_id_zoned_cap(dev->id) == 0x01)
+ /*
+ * Check for host-aware devices.
+ */
+ dev->flags |= ATA_DFLAG_ZAC;
+
+ if (!(dev->flags & ATA_DFLAG_ZAC))
+ return;
+
+ /*
+ * Read IDENTIFY DEVICE data log, page 9 (Zoned-device information)
+ */
+ err_mask = ata_read_log_page(dev, ATA_LOG_SATA_ID_DEV_DATA,
+ ATA_LOG_ZONED_INFORMATION,
+ identify_buf, 1);
+ if (!err_mask) {
+ u64 zoned_cap, opt_open, opt_nonseq, max_open;
+
+ zoned_cap = get_unaligned_le64(&identify_buf[8]);
+ if ((zoned_cap >> 63))
+ dev->zac_zoned_cap = (zoned_cap & 1);
+ opt_open = get_unaligned_le64(&identify_buf[24]);
+ if ((opt_open >> 63))
+ dev->zac_zones_optimal_open = (u32)opt_open;
+ opt_nonseq = get_unaligned_le64(&identify_buf[32]);
+ if ((opt_nonseq >> 63))
+ dev->zac_zones_optimal_nonseq = (u32)opt_nonseq;
+ max_open = get_unaligned_le64(&identify_buf[40]);
+ if ((max_open >> 63))
+ dev->zac_zones_max_open = (u32)max_open;
+ }
+}
+
/**
* ata_dev_configure - Configure the specified ATA/ATAPI device
* @dev: Target device to configure
@@ -2388,6 +2437,7 @@ int ata_dev_configure(struct ata_device *dev)
}
}
ata_dev_config_sense_reporting(dev);
+ ata_dev_config_zac(dev);
dev->cdb_len = 16;
}
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index a5d1e74..984cef1 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -2046,6 +2046,7 @@ static unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf)
*/
static unsigned int ata_scsiop_inq_00(struct ata_scsi_args *args, u8 *rbuf)
{
+ int num_pages;
const u8 pages[] = {
0x00, /* page 0x00, this page */
0x80, /* page 0x80, unit serial no page */
@@ -2054,10 +2055,14 @@ static unsigned int ata_scsiop_inq_00(struct ata_scsi_args *args, u8 *rbuf)
0xb0, /* page 0xb0, block limits page */
0xb1, /* page 0xb1, block device characteristics page */
0xb2, /* page 0xb2, thin provisioning page */
+ 0xb6, /* page 0xb6, zoned block device characteristics */
};
- rbuf[3] = sizeof(pages); /* number of supported VPD pages */
- memcpy(rbuf + 4, pages, sizeof(pages));
+ num_pages = sizeof(pages);
+ if (!(args->dev->flags & ATA_DFLAG_ZAC))
+ num_pages--;
+ rbuf[3] = num_pages; /* number of supported VPD pages */
+ memcpy(rbuf + 4, pages, num_pages);
return 0;
}
@@ -2245,6 +2250,24 @@ static unsigned int ata_scsiop_inq_b2(struct ata_scsi_args *args, u8 *rbuf)
return 0;
}
+static unsigned int ata_scsiop_inq_b6(struct ata_scsi_args *args, u8 *rbuf)
+{
+ /*
+ * SCSI Zoned Block device characteristics VPD page:
+ * ZBC rev 02 or later.
+ */
+ rbuf[1] = 0xb6;
+ rbuf[3] = 0x3C;
+
+ if (args->dev->zac_zoned_cap & 1)
+ rbuf[4] |= 1;
+ put_unaligned_be32(args->dev->zac_zones_optimal_open, &rbuf[8]);
+ put_unaligned_be32(args->dev->zac_zones_optimal_nonseq, &rbuf[12]);
+ put_unaligned_be32(args->dev->zac_zones_max_open, &rbuf[16]);
+
+ return 0;
+}
+
/**
* ata_scsiop_noop - Command handler that simply returns success.
* @args: device IDENTIFY data / SCSI command of interest.
@@ -3793,6 +3816,12 @@ void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd)
case 0xb2:
ata_scsi_rbuf_fill(&args, ata_scsiop_inq_b2);
break;
+ case 0xb6:
+ if (dev->flags & ATA_DFLAG_ZAC) {
+ ata_scsi_rbuf_fill(&args, ata_scsiop_inq_b6);
+ break;
+ }
+ /* Fallthrough */
default:
ata_scsi_invalid_field(cmd);
break;
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 2d604ca..f607bf14 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -325,6 +325,7 @@ enum {
ATA_LOG_NCQ_SEND_RECV = 0x13,
ATA_LOG_SATA_ID_DEV_DATA = 0x30,
ATA_LOG_SATA_SETTINGS = 0x08,
+ ATA_LOG_ZONED_INFORMATION = 0x09,
ATA_LOG_DEVSLP_OFFSET = 0x30,
ATA_LOG_DEVSLP_SIZE = 0x08,
ATA_LOG_DEVSLP_MDAT = 0x00,
diff --git a/include/linux/libata.h b/include/linux/libata.h
index c9cfbcd..d508cce 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -180,6 +180,7 @@ enum {
ATA_DFLAG_DA = (1 << 26), /* device supports Device Attention */
ATA_DFLAG_DEVSLP = (1 << 27), /* device supports Device Sleep */
ATA_DFLAG_ACPI_DISABLED = (1 << 28), /* ACPI for the device is disabled */
+ ATA_DFLAG_ZAC = (1 << 29), /* ZAC device */
ATA_DEV_UNKNOWN = 0, /* unknown device */
ATA_DEV_ATA = 1, /* ATA device */
@@ -724,6 +725,12 @@ struct ata_device {
/* NCQ send and receive log subcommand support */
u8 ncq_send_recv_cmds[ATA_LOG_NCQ_SEND_RECV_SIZE];
+ /* ZAC zone configuration */
+ u32 zac_zoned_cap;
+ u32 zac_zones_optimal_open;
+ u32 zac_zones_optimal_nonseq;
+ u32 zac_zones_max_open;
+
/* error history */
int spdn_cnt;
/* ering is CLEAR_END, read comment above CLEAR_END */
--
1.8.5.2
^ permalink raw reply related [flat|nested] 24+ messages in thread* Re: [PATCH 0/6] ZAC host-aware device support
2015-07-31 13:02 [PATCH 0/6] ZAC host-aware device support Hannes Reinecke
` (5 preceding siblings ...)
2015-07-31 13:02 ` [PATCH 6/6] libata: support host-aware " Hannes Reinecke
@ 2015-08-02 15:47 ` Tejun Heo
2015-08-02 16:11 ` James Bottomley
7 siblings, 0 replies; 24+ messages in thread
From: Tejun Heo @ 2015-08-02 15:47 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: linux-ide, linux-scsi, James Bottomley
On Fri, Jul 31, 2015 at 03:02:02PM +0200, Hannes Reinecke wrote:
> Hi all,
>
> here is a patchset for adding ZAC host-aware device support to libata.
> Main bits are translations for ZBC IN and ZBC OUT; others are the
> required plumbing like generating the correct VPD pages.
> James, do you require a separate patch for adding ZBC IN and ZBC OUT
> or is it okay to have it queued here?
>
> As usual, reviews and comments are welcome.
Can you please give an overview of why we would want this?
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 24+ messages in thread* Re: [PATCH 0/6] ZAC host-aware device support
2015-07-31 13:02 [PATCH 0/6] ZAC host-aware device support Hannes Reinecke
` (6 preceding siblings ...)
2015-08-02 15:47 ` [PATCH 0/6] ZAC host-aware device support Tejun Heo
@ 2015-08-02 16:11 ` James Bottomley
2015-08-03 7:24 ` Hannes Reinecke
7 siblings, 1 reply; 24+ messages in thread
From: James Bottomley @ 2015-08-02 16:11 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Tejun Heo, linux-ide, linux-scsi
On Fri, 2015-07-31 at 15:02 +0200, Hannes Reinecke wrote:
> Hi all,
>
> here is a patchset for adding ZAC host-aware device support to libata.
> Main bits are translations for ZBC IN and ZBC OUT; others are the
> required plumbing like generating the correct VPD pages.
> James, do you require a separate patch for adding ZBC IN and ZBC OUT
> or is it okay to have it queued here?
This really belongs in the ZBC patch set, doesn't it? Why isn't it
there. You can't avoid the dependency. If it goes with the ZAC patch
set, then the ZBC one depends on ZAC. If it goes properly with ZBC then
you need an additional patch adding the ATA translations after the ZBC
one. On the whole, I'd prefer the latter so we always have the required
consumers of the API.
In fact, if I read the dependencies correctly, you need the ZBC patches
first, don't you ... otherwise there's nothing to drive host aware ZAC?
James
James
> As usual, reviews and comments are welcome.
>
> Hannes Reinecke (6):
> libata: Do not retry commands with valid autosense
> libata-scsi: use ata_scsi_set_sense when generating ATA sense
> libata: implement ZBC IN translation
> libata: Implement ZBC OUT translation
> libata: support device-managed ZAC devices
> libata: support host-aware ZAC devices
>
> drivers/ata/libata-core.c | 50 +++++++
> drivers/ata/libata-eh.c | 4 +
> drivers/ata/libata-scsi.c | 299 +++++++++++++++++++++++++++++++++++-------
> include/linux/ata.h | 17 +++
> include/linux/libata.h | 7 +
> include/scsi/scsi_proto.h | 9 ++
> include/trace/events/libata.h | 2 +
> 7 files changed, 344 insertions(+), 44 deletions(-)
>
^ permalink raw reply [flat|nested] 24+ messages in thread* Re: [PATCH 0/6] ZAC host-aware device support
2015-08-02 16:11 ` James Bottomley
@ 2015-08-03 7:24 ` Hannes Reinecke
2015-08-03 15:31 ` James Bottomley
0 siblings, 1 reply; 24+ messages in thread
From: Hannes Reinecke @ 2015-08-03 7:24 UTC (permalink / raw)
To: James Bottomley; +Cc: Tejun Heo, linux-ide, linux-scsi
On 08/02/2015 06:11 PM, James Bottomley wrote:
> On Fri, 2015-07-31 at 15:02 +0200, Hannes Reinecke wrote:
>> Hi all,
>>
>> here is a patchset for adding ZAC host-aware device support to libata.
>> Main bits are translations for ZBC IN and ZBC OUT; others are the
>> required plumbing like generating the correct VPD pages.
>> James, do you require a separate patch for adding ZBC IN and ZBC OUT
>> or is it okay to have it queued here?
>
> This really belongs in the ZBC patch set, doesn't it? Why isn't it
> there. You can't avoid the dependency. If it goes with the ZAC patch
> set, then the ZBC one depends on ZAC. If it goes properly with ZBC then
> you need an additional patch adding the ATA translations after the ZBC
> one. On the whole, I'd prefer the latter so we always have the required
> consumers of the API.
>
> In fact, if I read the dependencies correctly, you need the ZBC patches
> first, don't you ... otherwise there's nothing to drive host aware ZAC?
>
No. These patches just implement a proper SATL for ZAC drives.
So in effect they just bring libata support on par with 'real' ZBC
drives, allowing things like 'sg_rep_zones' to work properly there.
As such I've considered those patches to be a precursor for ZBC support.
But then, I don't mind how it's being handled.
I surely can turn things around, ZBC support first, and ZAC as an
add-on to that.
Just say the word.
Cheers,
Hannes
--
Dr. Hannes Reinecke zSeries & Storage
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)
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 0/6] ZAC host-aware device support
2015-08-03 7:24 ` Hannes Reinecke
@ 2015-08-03 15:31 ` James Bottomley
0 siblings, 0 replies; 24+ messages in thread
From: James Bottomley @ 2015-08-03 15:31 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Tejun Heo, linux-ide, linux-scsi
On Mon, 2015-08-03 at 09:24 +0200, Hannes Reinecke wrote:
> On 08/02/2015 06:11 PM, James Bottomley wrote:
> > On Fri, 2015-07-31 at 15:02 +0200, Hannes Reinecke wrote:
> >> Hi all,
> >>
> >> here is a patchset for adding ZAC host-aware device support to libata.
> >> Main bits are translations for ZBC IN and ZBC OUT; others are the
> >> required plumbing like generating the correct VPD pages.
> >> James, do you require a separate patch for adding ZBC IN and ZBC OUT
> >> or is it okay to have it queued here?
> >
> > This really belongs in the ZBC patch set, doesn't it? Why isn't it
> > there. You can't avoid the dependency. If it goes with the ZAC patch
> > set, then the ZBC one depends on ZAC. If it goes properly with ZBC then
> > you need an additional patch adding the ATA translations after the ZBC
> > one. On the whole, I'd prefer the latter so we always have the required
> > consumers of the API.
> >
> > In fact, if I read the dependencies correctly, you need the ZBC patches
> > first, don't you ... otherwise there's nothing to drive host aware ZAC?
> >
> No. These patches just implement a proper SATL for ZAC drives.
> So in effect they just bring libata support on par with 'real' ZBC
> drives, allowing things like 'sg_rep_zones' to work properly there.
But that was my point: the Linux SATL exists to support our ULDs on ATA
devices. Until that support exists within SCSI, we don't really need
the SATL to support it. You can argue it's for SG_IO, but really, if
you're doing user level control of ZAC devices, you'd use ATA commands.
> As such I've considered those patches to be a precursor for ZBC support.
>
> But then, I don't mind how it's being handled.
> I surely can turn things around, ZBC support first, and ZAC as an
> add-on to that.
> Just say the word.
Well, um, since there's no ATA ULD, there is no real kernel handling of
ZAC devices, so doesn't that mean we have to at least have the reporting
done via block and sd before the ATA bits will do anything meaningful?
So to me, this looks very like supporting 512e: agree what parameters
block exposes and how userspace uses them, then plumb into block, then
SCSI then ATA (i.e. work down the stack, not up).
James
^ permalink raw reply [flat|nested] 24+ messages in thread