lkml.org 
[lkml]   [2013]   [May]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] PCI: set correct value for iov device before device
From
On Wed, May 29, 2013 at 11:04 PM, Yinghai Lu <yinghai@kernel.org> wrote:
> On Wed, May 29, 2013 at 10:45 PM, Xudong Hao <xudong.hao@intel.com> wrote:
>> Since device registering is put into pci_device_add(), it must set value of
>> Virtual Function device's member before the pci_dev is put to device tree. Or
>> some relevant subsystem of driver model such as xen will report a incorrect
>> IOV device to Xen hypervior.
>>
>> Signed-off-by: Xudong Hao <xudong.hao@intel.com>
>> ---
>> drivers/pci/iov.c | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
>> index c93071d..43d3de9 100644
>> --- a/drivers/pci/iov.c
>> +++ b/drivers/pci/iov.c
>> @@ -110,12 +110,12 @@ static int virtfn_add(struct pci_dev *dev, int id, int reset)
>> if (reset)
>> __pci_reset_function(virtfn);
>>
>> - pci_device_add(virtfn, virtfn->bus);
>> - mutex_unlock(&iov->dev->sriov->lock);
>> -
>> virtfn->physfn = pci_dev_get(dev);
>> virtfn->is_virtfn = 1;
>>
>> + pci_device_add(virtfn, virtfn->bus);
>> + mutex_unlock(&iov->dev->sriov->lock);
>> +
>> rc = pci_bus_add_device(virtfn);
>> sprintf(buf, "virtfn%u", id);
>> rc = sysfs_create_link(&dev->dev.kobj, &virtfn->dev.kobj, buf);
>
> I have similar patch at
> https://patchwork.kernel.org/patch/2562551/
> [5/7] PCI, ACPI: Don't glue ACPI dev with pci VFs
>
> and Jiang has another one
> https://patchwork.kernel.org/patch/2613481/
> [v3,part1,10/10] PCI, IOV: hide remove and rescan sysfs interfaces
> for SR-IOV virtual functions

Bjorn,

I double check this one, we should split the patch from me or Jiang.
and the one about set virtfn=1 should be -stable material.

That will address another problem that is caused by
moving device_add from pci_bus_add_device to pci_device_add.

Yinghai


\
 
 \ /
  Last update: 2013-05-30 23:01    [W:0.082 / U:1.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site