linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Abhishek Sahu <abhsahu@nvidia.com>
To: <kvm@vger.kernel.org>,
	Alex Williamson <alex.williamson@redhat.com>,
	Cornelia Huck <cohuck@redhat.com>
Cc: Max Gurtovoy <mgurtovoy@nvidia.com>,
	Yishai Hadas <yishaih@nvidia.com>,
	Zhen Lei <thunder.leizhen@huawei.com>,
	Jason Gunthorpe <jgg@nvidia.com>, <linux-kernel@vger.kernel.org>,
	Abhishek Sahu <abhsahu@nvidia.com>
Subject: [PATCH v3 0/2] vfio/pci: fixes related with power management
Date: Thu, 17 Feb 2022 17:51:05 +0530	[thread overview]
Message-ID: <20220217122107.22434-1-abhsahu@nvidia.com> (raw)

The commit 51ef3a004b1e ("vfio/pci: Restore device state on PM
transition") added a wrapper function vfio_pci_probe_power_state().
For the devices which do not have No_Soft_Reset bit set in its
PMCSR config register, inside this function, the current PCI state
will be saved locally in 'vfio_pci_core_device::pm_save' during
D0->D3hot transition and same will be restored back during D3hot->D0
transition. We have few IOCTLs and internal functions in vfio-pci
driver which can be invoked when the device power state is non-D0.
This patch series fixes issues around reset-related API's if reset
is invoked in the D3hot state.

* Changes in v3

- Split the changes into 2 patches.
- Updated comments and commit message according to updated changes.
- Added code to wakeup devices for vfio_pci_dev_set_try_reset().

* Changes in v2

- Add the Fixes tag and sent this patch independently.
- Invoke vfio_pci_set_power_state() before invoking reset related API's.
- Removed saving of power state locally.
- Removed warning before 'kfree(vdev->pm_save)'.
- Updated comments and commit message according to updated changes.

* v1 of this patch was sent in
https://lore.kernel.org/lkml/20220124181726.19174-4-abhsahu@nvidia.com/

Abhishek Sahu (2):
  vfio/pci: fix memory leak during D3hot to D0 transition
  vfio/pci: wake-up devices around reset functions

 drivers/vfio/pci/vfio_pci_core.c | 61 ++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

-- 
2.17.1


             reply	other threads:[~2022-02-17 12:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-17 12:21 Abhishek Sahu [this message]
2022-02-17 12:21 ` [PATCH v3 1/2] vfio/pci: fix memory leak during D3hot to D0 transition Abhishek Sahu
2022-02-17 12:21 ` [PATCH v3 2/2] vfio/pci: wake-up devices around reset functions Abhishek Sahu

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=20220217122107.22434-1-abhsahu@nvidia.com \
    --to=abhsahu@nvidia.com \
    --cc=alex.williamson@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=jgg@nvidia.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgurtovoy@nvidia.com \
    --cc=thunder.leizhen@huawei.com \
    --cc=yishaih@nvidia.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).