From: Damien Le Moal <dlemoal@kernel.org>
To: Hannes Reinecke <hare@suse.de>,
linux-ide@vger.kernel.org, Niklas Cassel <cassel@kernel.org>,
linux-scsi@vger.kernel.org,
"Martin K . Petersen" <martin.petersen@oracle.com>
Subject: Re: [PATCH v1 1/9] scsi: scsi_debug: move ASC and ASCQ definitions to scsi_proto.h
Date: Mon, 6 Jul 2026 18:00:45 +0900 [thread overview]
Message-ID: <cfc34288-244e-417a-9586-36fc2b2642c3@kernel.org> (raw)
In-Reply-To: <78b0142a-23a6-4959-8535-fef18d62bb46@suse.de>
On 7/6/26 5:44 PM, Hannes Reinecke wrote:
> Weelll ... _technically_ the ASC/ASCQ codes have to be evaluated
> together, and the individual definitions only make sense for a
> combination of ASC/ASCQ codes.
Yes, I am well aware.
> EG SPC-5 defines the ASC/ASCQ 0x20/0x00 as 'Invalid command opcode',
> but with this we would deocde it as 'INVALID_OPCODE'/'POWER_ON_RESET_ASCQ',
> but 'POWER ON RESET OCCURRED' is ASC/ASCQ 0x29/0x00.
> So if we were to define ASCQ codes we would need to define the
> ASCQ codes for each ASC to avoid these issues.
Yes, this is messy. But re-check the specs. There are plenty of places that say
"with additional sense code XXX" without actually specifying the exact
combination of ASC/ASCQ as they are defined on the T10 site
(https://www.t10.org/lists/asc-num.htm).
> Makes me wonder if we shouldn't introduce u16 for sense code
> handling ...
Maybe, but that will be more work as we have many functions and code that
handle asc and ascq separatly. Which I kind of like.
The main benefit of having the macros and using them is code readability: the
values used/tested for ASC & ASCQ become self explanatory, making it far easier
to match code and specs.
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2026-07-06 9:01 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-06 6:56 [PATCH v1 0/9] ATA support for storage element management commands Damien Le Moal
2026-07-06 6:56 ` [PATCH v1 1/9] scsi: scsi_debug: move ASC and ASCQ definitions to scsi_proto.h Damien Le Moal
2026-07-06 8:29 ` Hannes Reinecke
2026-07-06 8:55 ` Damien Le Moal
2026-07-06 8:44 ` Hannes Reinecke
2026-07-06 9:00 ` Damien Le Moal [this message]
2026-07-06 6:56 ` [PATCH v1 2/9] scsi: define depopulation capabilities related service actions Damien Le Moal
2026-07-06 6:56 ` [PATCH v1 3/9] ata: libata: improve the definition of device flags Damien Le Moal
2026-07-06 6:56 ` [PATCH v1 4/9] ata: libata-scsi: improve ata_get_xlat_func Damien Le Moal
2026-07-06 6:56 ` [PATCH v1 5/9] ata: libata-core: detect support for depopulation capabilities Damien Le Moal
2026-07-06 6:56 ` [PATCH v1 6/9] ata: libata-scsi: add support for the GET PHYSICAL ELEMENT STATUS command Damien Le Moal
2026-07-06 6:56 ` [PATCH v1 7/9] ata: libata-scsi: add support for the REMOVE ELEMENT AND TRUNCATE command Damien Le Moal
2026-07-06 6:56 ` [PATCH v1 8/9] ata: libata-scsi: add support for the RESTORE ELEMENTS AND REBUILD command Damien Le Moal
2026-07-06 6:56 ` [PATCH v1 9/9] ata: libata-scsi: add support for the REMOVE ELEMENT AND MODIFY ZONES command 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=cfc34288-244e-417a-9586-36fc2b2642c3@kernel.org \
--to=dlemoal@kernel.org \
--cc=cassel@kernel.org \
--cc=hare@suse.de \
--cc=linux-ide@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/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