From: Damien Le Moal <dlemoal@kernel.org>
To: linux-ide@vger.kernel.org, Niklas Cassel <cassel@kernel.org>
Subject: [PATCH v1 4/6] ata: libata-scsi: improves checks for ZBC_IN and ZBC_OUT commands support
Date: Thu, 2 Jul 2026 10:56:44 +0900 [thread overview]
Message-ID: <20260702015646.1702539-5-dlemoal@kernel.org> (raw)
In-Reply-To: <20260702015646.1702539-1-dlemoal@kernel.org>
Improve ata_scsi_cmd_is_supported() to check the service action for the
ZBC_IN and ZBC_OUT opcodes, to correctly report supported zone management
commands for zoned disks.
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
---
drivers/ata/libata-scsi.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index e432e521ad31..f9e6bda6833e 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -3708,8 +3708,17 @@ static bool ata_scsi_cmd_is_supported(struct ata_device *dev, u8 op, u16 sa,
}
return true;
case ZBC_IN:
+ return sa == ZI_REPORT_ZONES && ata_dev_is_zoned(dev);
case ZBC_OUT:
- return ata_id_zoned_cap(dev->id) || dev->class == ATA_DEV_ZAC;
+ switch (sa) {
+ case ZO_CLOSE_ZONE:
+ case ZO_FINISH_ZONE:
+ case ZO_OPEN_ZONE:
+ case ZO_RESET_WRITE_POINTER:
+ return ata_dev_is_zoned(dev);
+ default:
+ return false;
+ }
case SERVICE_ACTION_IN_16:
return sa == SAI_READ_CAPACITY_16;
case SECURITY_PROTOCOL_IN:
--
2.54.0
next prev parent reply other threads:[~2026-07-02 1:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-02 1:56 [PATCH v1 0/6] Improve ata_scsi_report_supported_opcodes() Damien Le Moal
2026-07-02 1:56 ` [PATCH v1 1/6] ata: libata: rename ata_dev_is_zac() Damien Le Moal
2026-07-02 1:56 ` [PATCH v1 2/6] ata: libata-scsi: refactor ata_scsi_report_supported_opcodes() Damien Le Moal
2026-07-02 1:56 ` [PATCH v1 3/6] ata: libata-scsi: improve service action support in ata_scsi_report_supported_opcodes() Damien Le Moal
2026-07-02 2:11 ` sashiko-bot
2026-07-02 1:56 ` Damien Le Moal [this message]
2026-07-02 2:07 ` [PATCH v1 4/6] ata: libata-scsi: improves checks for ZBC_IN and ZBC_OUT commands support sashiko-bot
2026-07-02 2:19 ` Damien Le Moal
2026-07-02 1:56 ` [PATCH v1 5/6] ata: libata-scsi: support reporting options 2 in REPORT SUPPORTED OPERATION CODES Damien Le Moal
2026-07-02 2:13 ` sashiko-bot
2026-07-02 1:56 ` [PATCH v1 6/6] ata: libata-scsi: support the all command format for reporting supported commands Damien Le Moal
2026-07-02 2:11 ` sashiko-bot
2026-07-02 2:27 ` Damien Le Moal
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=20260702015646.1702539-5-dlemoal@kernel.org \
--to=dlemoal@kernel.org \
--cc=cassel@kernel.org \
--cc=linux-ide@vger.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.