linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Peng Liu <pngliu@hotmail.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: kbusch@kernel.org, linux-nvme@lists.infradead.org,
	Peng Liu <liupeng17@lenovo.com>
Subject: Re: [PATCH] nvme: fix APST error for power latency tolerance
Date: Wed, 24 Mar 2021 10:38:12 +0800	[thread overview]
Message-ID: <OSYP286MB0181DD097BC42806382473BAC6639@OSYP286MB0181.JPNP286.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20210323162321.GA2446196@infradead.org>

On Tue, Mar 23, 2021 at 04:23:21PM +0000, Christoph Hellwig wrote:
> On Tue, Mar 23, 2021 at 03:31:33PM +0800, pngliu@hotmail.com wrote:
> > From: Peng Liu <liupeng17@lenovo.com>
> > 
> > Clear apsta so that nvme_configure_apst() does not execute
> > nvme_set_features(), which will fail because admin_q is either not set up
> > yet or no longer available at the time of nvme_uninit_ctrl() being called,
> > and this leads to the error message "nvme nvme0: failed to set APST feature
> > (-19)".
> > 
> > Fixes: 510a405d945b("nvme: fix memory leak for power latency tolerance")
> 
> How did you get into this situation?  For PCIe nvme_uninit_ctrl is
> only called at the end of ->remove and ->delete_ctrl, so how do we end
> up in nvme_configure_apst after that?

I got into it with nvme surprise and non-surprise hot-removal tests.
Below is the stack ftrace result for nvme_configure_apst under the
surprise hot-removal, and it is similar for the non-surprise hot-removal.

  irq/165-pciehp-939   [039] ....  1529.443824: nvme_configure_apst
                                          <-nvme_set_latency_tolerance
  irq/165-pciehp-939   [039] ....  1529.443836: <stack trace>
 => nvme_configure_apst
 => nvme_set_latency_tolerance
 => apply_constraint
 => __dev_pm_qos_remove_request
 => __dev_pm_qos_drop_user_request.isra.7
 => dev_pm_qos_update_user_latency_tolerance
 => dev_pm_qos_hide_latency_tolerance
 => nvme_uninit_ctrl
 => nvme_remove
 => pci_device_remove
 => device_release_driver_internal
 => device_release_driver
 => pci_stop_bus_device
 => pci_stop_and_remove_bus_device
 => pciehp_unconfigure_device
 => pciehp_disable_slot
 => pciehp_handle_disable_request
 => pciehp_ist
 => irq_thread_fn
 => irq_thread
 => kthread
 => ret_from_fork

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  reply	other threads:[~2021-03-24  2:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-23  7:31 [PATCH] nvme: fix APST error for power latency tolerance pngliu
2021-03-23 16:23 ` Christoph Hellwig
2021-03-24  2:38   ` Peng Liu [this message]
2021-03-24  7:58     ` Christoph Hellwig
2021-04-09  7:19       ` Christoph Hellwig
2021-04-09  8:12         ` Peng Liu

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=OSYP286MB0181DD097BC42806382473BAC6639@OSYP286MB0181.JPNP286.PROD.OUTLOOK.COM \
    --to=pngliu@hotmail.com \
    --cc=hch@infradead.org \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=liupeng17@lenovo.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;
as well as URLs for NNTP newsgroup(s).