[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4033DF50-0126-4F69-88FA-C6AABC0CADCE@intel.com>
Date: Wed, 3 Jun 2015 16:16:43 +0000
From: "Rustad, Mark D" <mark.d.rustad@...el.com>
To: Alexander Duyck <alexander.duyck@...il.com>
CC: "bhelgaas@...gle.com" <bhelgaas@...gle.com>,
"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
"intel-wired-lan@...ts.osuosl.org" <intel-wired-lan@...ts.osuosl.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [Intel-wired-lan] [PATCH V2 1/2] pci: Add dev_flags bit to
access VPD through function 0
> On Jun 2, 2015, at 7:28 PM, Alexander Duyck <alexander.duyck@...il.com> wrote:
>
> You can probably combine the dev->multifunction check with the dev_flags check. After all you don't need this workaround if the device is not multifunction. It might even make more sense to move the multifunction check to the quirk in patch 2/2.
Yes. I also realized that I really should check that tdev->vpd is not NULL. There is no point in referencing it if, for whatever reason, it has no VPD.
> I also believe this leaks a reference to the device.
Yes, and I was thinking that when I wrote the line, but forgot to do anything about it. Good catch!
> You should be calling pci_dev_put(tdev) if tdev is not NULL. As such you probably need to split up the !tdev and the rest of the checks.
Yup. I will have a V3 coming. I still don't have anything to handle PFs assigned to guests, but I think that would be best in a separate patch set if there is need to fix that. It looks to me like that would involve trapping on all config space accesses to such devices and then emulating the behavior of the VPD Address/F and Data registers. It may be worth seeing if anyone cares before doing anything about it. I haven't seen any reports related to such a setup.
Again, thank you for your comments.
--
Mark Rustad, Networking Division, Intel Corporation
Download attachment "signature.asc" of type "application/pgp-signature" (842 bytes)
Powered by blists - more mailing lists