Skip to content

Improve ata_scsi_report_supported_opcodes()

Damien Le Moal linux-ide 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest5 patches 1 replyIn review
  2. v35 patches 4 repliesSuperseded
  3. v25 patches 13 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v16 patches2 repliesSuperseded

Changes from v2 from the cover letter

- Patch 2: cleaned up the switch-case in ata_scsi_cmd_is_supported()

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5ata: libata: rename ata_dev_is_zac()drivers/ata/libata-core.c drivers/ata/libata-scsi.c drivers/ata/libata.h+9 -100 replies
2/5ata: libata-scsi: refactor ata_scsi_report_supported_opcodes()drivers/ata/libata-scsi.c+145 -521 reply
3/5ata: libata-scsi: improve service action support in ata_scsi_report_supported_opcodes()drivers/ata/libata-scsi.c+34 -70 replies
4/5ata: libata-scsi: support reporting options 2 in REPORT SUPPORTED OPERATION CODESdrivers/ata/libata-scsi.c+7 -00 replies
5/5ata: libata-scsi: support the all command format for reporting supported commandsdrivers/ata/libata-scsi.c+39 -00 replies

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchHannes Reinecke
1/5R-b
2/5R-b
3/5R-b
4/5R-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/5] Improve ata_scsi_report_supported_opcodes()

The implementation of ata_scsi_report_supported_opcodes() mostly satisfies the internal use when an ATA device is probed from the SCSI layer, but it is very incomplete. The code is also not very flexible for extending support for new commands.

This patch series address these issues, cleaning up the implementation and making REPORT SUPPORTED OPERATION CODES fully functional. E.g., with these changes, sg_opcodes can be used for listing all SCSI commands that are supported by libata-scsi and a device.

Example:

  # sg_opcodes /dev/sda
    ATA       WDC  WUH722626AL  WZ41
    Peripheral device type: disk
  Opcode  Service    CDB  RWCDLP,  Name
  (hex)   action(h)  size   CDLP
  -----------------------------------------------
   00                  6    0,0    Test Unit Ready
   01                  6    0,0    Rezero Unit
   03                  6    0,0    Request Sense
   08                  6    0,0    Read(6)
   0a                  6    0,0    Write(6)
   0b                  6    0,0    Seek(6)
   12                  6    0,0    Inquiry
   15                  6    0,0    Mode select(6)
   1a                  6    0,0    Mode sense(6)
   1b                  6    0,0    Start stop unit
   1d                  6    0,0    Send diagnostic
   25                 10    0,0    Read capacity(10)
   28                 10    0,0    Read(10)
   2a                 10    0,0    Write(10)
   2b                 10    0,0    Seek(10)
   2f                 10    0,0    Verify(10)
   35                 10    0,0    Synchronize cache(10)
   55                 10    0,0    Mode select(10)
   5a                 10    0,0    Mode sense(10)
   7f     1ff0        32    0,0    ATA pass-through(32)
   85                 16    0,0    ATA pass-through(16)
   88                 16    1,1    Read(16)
   8a                 16    1,2    Write(16)
   8f                 16    0,0    Verify(16)
   91                 16    0,0    Synchronize cache(16)
   9e       10        16    0,0    Read capacity(16)
   a0                 12    0,0    Report luns
   a1                 12    0,0    ATA pass-through(12)
   a3        c        12    0,0    Report supported operation codes

Changes from v2:
- Patch 2: cleaned up the switch-case in ata_scsi_cmd_is_supported()

Changes from v2:
- Patch 2: reformatted the array of supported commands and removed WRITE_SAME_16 command from it.
- Applied review tags.

Changes from v1:
- Patch 2: Added an sa_valid field to the array of supported command to correctly handle sa == 0 being a valid service action (report zones) in patch 3
- Dropped v1 patch 4
- Patch 5: correctly set the servact field based on the sa_valid field of the array of supported commands.

Damien Le Moal (5):
ata: libata: rename ata_dev_is_zac()
ata: libata-scsi: refactor ata_scsi_report_supported_opcodes()
ata: libata-scsi: improve service action support in
ata_scsi_report_supported_opcodes()
ata: libata-scsi: support reporting options 2 in REPORT SUPPORTED
OPERATION CODES
ata: libata-scsi: support the all command format for reporting
supported commands

 drivers/ata/libata-core.c |   6 +-
 drivers/ata/libata-scsi.c | 279 ++++++++++++++++++++++++++++++--------
 drivers/ata/libata.h      |   2 +-
 3 files changed, 226 insertions(+), 61 deletions(-)
Signature · 1 line
2.54.0