Re: [Intel-wired-lan] [PATCH V2 1/2] pci: Add dev_flags bit to access VPD through function 0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On Jun 2, 2015, at 7:28 PM, Alexander Duyck <alexander.duyck@xxxxxxxxx> 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

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail


[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux