public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: Yihang Li <liyihang9@huawei.com>
Cc: cassel@kernel.org, James.Bottomley@HansenPartnership.com,
	martin.petersen@oracle.com, john.g.garry@oracle.com,
	yanaijie@huawei.com, linux-kernel@vger.kernel.org,
	linux-scsi@vger.kernel.org, linuxarm@huawei.com,
	chenxiang66@hisilicon.com, prime.zeng@huawei.com
Subject: Re: [bug report] scsi: SATA devices missing after FLR is triggered during HBA suspended
Date: Wed, 19 Jun 2024 08:11:40 +0900	[thread overview]
Message-ID: <0c5e14eb-5560-48cb-9086-6ad9c3970427@kernel.org> (raw)
In-Reply-To: <20240618132900.2731301-1-liyihang9@huawei.com>

On 6/18/24 22:29, Yihang Li wrote:
> Hi Damien,
> 
> I found out that two issues is caused by commit 0c76106cb975 ("scsi: sd:
> Fix TCG OPAL unlock on system resume") and 626b13f015e0 ("scsi: Do not
> rescan devices with a suspended queue").
> 
> The two issues as follows for the situation that there are ATA disks
> connected with SAS controller:

Which controller ? What is the driver ?

> (1) FLR is triggered after all disks and controller are suspended. As a
> result, the number of disks is abnormal.

I am assuming here that FLR means PCI "Function Level Reset" ?
FLR and disk/controller suspend execution timing are unrelated. FLR can be
triggered at any time through sysfs. So please give details here. Why is FLR
done when the system is being suspended ?

> (2) After all disks and controller are suspended, and resuming all disks
> again, the driver reference counting is not 0 (The value of "Used" in the
> lsmod command output is not 0).

Resuming all disks again ? So you mean system resume ?
Are we talking about system suspend to ram ? Hybernation ? or something else ?
(e.g. a controller reset through PCI FLR ?)

Please clarify exactly what your adapter is and the full procedure you do to
trigger the issue so that we can try to recreate it.

> For the issue 1, After all disks and controller are suspended, FLR command
> will resuming the controller and all sas ports. libsas layer will call
> ata_sas_port_resume() to resume ata port and schedule EH to recover it.
> In libata standard error handler ata_std_error_handler(), it will call ata
> reset function, revalidate ATA devices and issue ATA device command
> ATA_CMD_READ_NATIVE_MAX_EXT to read native max address. This command will
> failed due to the controller enter suspend state again and libata disable
> the device finally. The controller enter suspend state again because FLR
> command completes and the runtime PM usage counter is 0.
> 
> In commit 0c76106cb975 ("scsi: sd: Fix TCG OPAL unlock on system resume")
> and 626b13f015e0 ("scsi: Do not rescan devices with a suspended queue"),
> use blk_queue_pm_only() to check the device request queue state, if the
> device request queue is not running, the device will not be rescanned.
> Therefore, the runtime PM usage counter of the controller will not
> increase so that the controller enters the suspended state again.
> 
> For the issue 2, the cause is unknown.
> 
> How to solve these two issues?
> 
> regards,
> Yihang
> 

-- 
Damien Le Moal
Western Digital Research


  reply	other threads:[~2024-06-18 23:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-18 13:29 [bug report] scsi: SATA devices missing after FLR is triggered during HBA suspended Yihang Li
2024-06-18 23:11 ` Damien Le Moal [this message]
2024-06-22  3:31   ` Yihang Li
2024-06-22 11:25     ` Niklas Cassel
2024-06-24  0:10     ` Damien Le Moal
2024-06-24 12:10       ` Yihang Li
2024-07-01  3:03         ` Damien Le Moal
2024-07-02 11:20           ` Yihang Li
2024-06-26 15:15       ` Bjorn Helgaas
2024-06-27  0:56         ` Damien Le Moal
2024-06-27  8:19           ` Yihang Li
2024-07-01 20:39           ` Bjorn Helgaas
2024-07-02  2:38             ` 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=0c5e14eb-5560-48cb-9086-6ad9c3970427@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=cassel@kernel.org \
    --cc=chenxiang66@hisilicon.com \
    --cc=john.g.garry@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=liyihang9@huawei.com \
    --cc=martin.petersen@oracle.com \
    --cc=prime.zeng@huawei.com \
    --cc=yanaijie@huawei.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