[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220311161738.GE3120@nvidia.com>
Date: Fri, 11 Mar 2022 12:17:38 -0400
From: Jason Gunthorpe <jgg@...dia.com>
To: Alex Williamson <alex.williamson@...hat.com>
Cc: Abhishek Sahu <abhsahu@...dia.com>, kvm@...r.kernel.org,
Cornelia Huck <cohuck@...hat.com>,
Max Gurtovoy <mgurtovoy@...dia.com>,
Yishai Hadas <yishaih@...dia.com>,
Zhen Lei <thunder.leizhen@...wei.com>,
linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH v2 5/5] vfio/pci: add the support for PCI D3cold state
On Wed, Mar 09, 2022 at 10:26:42AM -0700, Alex Williamson wrote:
> > diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
> > index c8695baf3b54..4ac3338c8fc7 100644
> > +++ b/drivers/vfio/pci/vfio_pci.c
> > @@ -153,7 +153,6 @@ static int vfio_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
> > ret = vfio_pci_core_register_device(vdev);
> > if (ret)
> > goto out_free;
> > - dev_set_drvdata(&pdev->dev, vdev);
>
> Relocating the setting of drvdata should be proposed separately rather
> than buried in this patch. The driver owns drvdata, the driver is the
> only consumer of drvdata, so pushing this into the core to impose a
> standard for drvdata across all vfio-pci variants doesn't seem like a
> good idea to me.
I've been wanting to do this for another reason - there is a few
places in the core vfio-pci that converts a struct device to a
vfio_device the slow way when the drvdata is the right way to do it.
So either have the core code set it or require drivers to set it to the
vfio_pci_core_device pointer seems necessary.
But yes, it should be a seperated patch
Jason
Powered by blists - more mailing lists