archive mirror
 help / color / mirror / Atom feed
From: John Garry <>
To: Hannes Reinecke <>,
	Damien Le Moal <>,
	Jack Wang <>
Cc: <>
Subject: About pm8001 NCQ error handling
Date: Fri, 24 Jun 2022 18:14:34 +0100	[thread overview]
Message-ID: <> (raw)

Hi Damien, Hannes,

I want to remove usage of sas_alloc_slow_task() outside libsas as prep 
work for SCSI reserved command handling. The pm8001 driver uses 
sas_alloc_slow_task() for dealing with NCQ error handling, which was 
added in commit c6b9ef5779c3 ("[SCSI] pm80xx: NCQ error handling 
changes"). So it seems a good opportunity to fix that code so that it 
does not send read log ext from the LLDD and we can drop those 
sas_alloc_slow_task() calls.

That NCQ error handling in that driver consists of 2x main steps:

1. send read log ext page 10 to analyze/clear the error
- I do note the crazy code to alloc a domain device there cf. 
2. send special pm8001 SATA_ABORT command to abort any pending IO in the 

I actually have to solve a very similar NCQ disk error problem for 
hisi_sas driver.

As for improving this, an idea is to set link->eh_info>err_mask |= 
AC_ERR_DEV and call ata_std_sched_eh() when 
IO_XFER_ERROR_ABORTED_NCQ_MODE occurs and take advantage of the libata 
fastdrain feature to abort all the outstanding IO. This calls the SCSI 
error handler, in which we could send the SATA_ABORT in the libsas abort 
task or LU reset handler LLDD callback.

The problem here is where to call the read log ext page 10 happens in 
this handling - when we finally get around to it in ata_eh_autopsy() -> 
ata_eh_link_autopsy() -> ata_eh_link_autopsy(), the port is frozen and 
all qc are already mark failed. So we need it earlier. Do you have any 
ideas on this or whether this approach is sensible?


                 reply	other threads:[~2022-06-24 17:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \

* 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;
as well as URLs for NNTP newsgroup(s).