[AMD Public Use]
From: Keith Busch kbusch@kernel.org Sent: Thursday, April 15, 2021 11:59 AM To: Liang, Prike Prike.Liang@amd.com Cc: linux-nvme@lists.infradead.org; Chaitanya.Kulkarni@wdc.com; gregkh@linuxfoundation.org; hch@infradead.org; stable@vger.kernel.org; S- k, Shyam-sundar Shyam-sundar.S-k@amd.com; Deucher, Alexander Alexander.Deucher@amd.com Subject: Re: [PATCH 2/2] nvme-pci: add AMD PCIe quirk for suspend/resume
On Thu, Apr 15, 2021 at 03:22:52AM +0000, Liang, Prike wrote:
+rdev = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(0, 0));
Instead of assuming '0', shouldn't you use the domain of the NVMe PCI device?
Now we just add the NVMe shutdown quirk by checking the root complex
ID instead of adding more and more variables endpoint NVMe device.
I understand what you are doing. I am just suggesting this quirk use the RC of the device in question rather than assume the RC is in domain 0. I realize a platform will probably align to your assumption. This is just for correctness and should look like:
rdev = pci_get_domain_bus_and_slot(pci_domain_nr(dev->bus), 0, PCI_DEVFN(0, 0));
Thanks, I confirm the device domain also enumerated as 0 by calculating the NVMe controller sys index and will update the patch.