mbox series

[v2,0/2] Returning FIS on success for CDL

Message ID 20230819213040.1101044-1-ipylypiv@google.com (mailing list archive)
Headers show
Series Returning FIS on success for CDL | expand

Message

Igor Pylypiv Aug. 19, 2023, 9:30 p.m. UTC
This patch series plumbs libata's request for a result taskfile
(ATA_QCFLAG_RESULT_TF) through libsas to pm80xx LLDD. Other libsas LLDDs
can start using the newly added return_fis_on_success as well, if needed.

For Command Duration Limits policy 0xD (command completes without
an error) libata needs FIS in order to detect the ATA_SENSE bit and read
the Sense Data for Successful NCQ Commands log (0Fh). pm80xx HBAs do not
return FIS on success by default, hence, the driver is updated to set
the RETFIS bit (Return FIS on good completion) when requested by libsas.

Changes since v1:
- Dropped the ata_qc_has_cdl() helper
- Changed the condition when return_fis_on_success is getting set from
  "qc->flags & ATA_QCFLAG_HAS_CDL" to "qc->flags & ATA_QCFLAG_RESULT_TF".
  The latter is more generic solution that works for non-CDL use cases
  as well.
- Updated the retfis setting code in pm80xx to avoid potential compiler
  issues with single bit fields.

Igor Pylypiv (2):
  scsi: libsas: Add return_fis_on_success to sas_ata_task
  scsi: pm80xx: Set RETFIS when requested by libsas

 drivers/scsi/libsas/sas_ata.c    |  3 +++
 drivers/scsi/pm8001/pm8001_hwi.c | 11 ++++++++---
 drivers/scsi/pm8001/pm8001_hwi.h |  2 +-
 drivers/scsi/pm8001/pm80xx_hwi.c | 17 ++++++++++-------
 drivers/scsi/pm8001/pm80xx_hwi.h |  2 +-
 include/scsi/libsas.h            |  1 +
 6 files changed, 24 insertions(+), 12 deletions(-)

Comments

Damien Le Moal Aug. 21, 2023, 9:04 a.m. UTC | #1
On 8/20/23 06:30, Igor Pylypiv wrote:
> This patch series plumbs libata's request for a result taskfile
> (ATA_QCFLAG_RESULT_TF) through libsas to pm80xx LLDD. Other libsas LLDDs
> can start using the newly added return_fis_on_success as well, if needed.
> 
> For Command Duration Limits policy 0xD (command completes without
> an error) libata needs FIS in order to detect the ATA_SENSE bit and read
> the Sense Data for Successful NCQ Commands log (0Fh). pm80xx HBAs do not
> return FIS on success by default, hence, the driver is updated to set
> the RETFIS bit (Return FIS on good completion) when requested by libsas.

For both patches:

Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Martin K. Petersen Aug. 21, 2023, 10:10 p.m. UTC | #2
Igor,

> This patch series plumbs libata's request for a result taskfile
> (ATA_QCFLAG_RESULT_TF) through libsas to pm80xx LLDD. Other libsas
> LLDDs can start using the newly added return_fis_on_success as well,
> if needed.
>
> For Command Duration Limits policy 0xD (command completes without an
> error) libata needs FIS in order to detect the ATA_SENSE bit and read
> the Sense Data for Successful NCQ Commands log (0Fh). pm80xx HBAs do
> not return FIS on success by default, hence, the driver is updated to
> set the RETFIS bit (Return FIS on good completion) when requested by
> libsas.

Applied to 6.6/scsi-staging, thanks!
Martin K. Petersen Aug. 25, 2023, 1:12 a.m. UTC | #3
On Sat, 19 Aug 2023 14:30:38 -0700, Igor Pylypiv wrote:

> This patch series plumbs libata's request for a result taskfile
> (ATA_QCFLAG_RESULT_TF) through libsas to pm80xx LLDD. Other libsas LLDDs
> can start using the newly added return_fis_on_success as well, if needed.
> 
> For Command Duration Limits policy 0xD (command completes without
> an error) libata needs FIS in order to detect the ATA_SENSE bit and read
> the Sense Data for Successful NCQ Commands log (0Fh). pm80xx HBAs do not
> return FIS on success by default, hence, the driver is updated to set
> the RETFIS bit (Return FIS on good completion) when requested by libsas.
> 
> [...]

Applied to 6.6/scsi-queue, thanks!

[1/2] scsi: libsas: Add return_fis_on_success to sas_ata_task
      https://git.kernel.org/mkp/scsi/c/72875018f638
[2/2] scsi: pm80xx: Set RETFIS when requested by libsas
      https://git.kernel.org/mkp/scsi/c/545432959551