public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Yijing Wang <wangyijing@huawei.com>
To: Xudong Hao <xudong.hao@intel.com>
Cc: <bhelgaas@google.com>, <yinghai@kernel.org>,
	<linux-pci@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Jiang Liu <liuj97@gmail.com>
Subject: Re: [PATCH] PCI: set correct value for iov device before device
Date: Thu, 30 May 2013 14:03:42 +0800	[thread overview]
Message-ID: <51A6EBBE.6020805@huawei.com> (raw)
In-Reply-To: <1369892734-26244-1-git-send-email-xudong.hao@intel.com>

Hi Xudong,
   This bug has been fixed by Jiang Liu in patch
https://patchwork.kernel.org/patch/2613481/


On 2013/5/30 13:45, Xudong Hao 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);
> 


-- 
Thanks!
Yijing


  reply	other threads:[~2013-05-30  6:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-30  5:45 [PATCH] PCI: set correct value for iov device before device Xudong Hao
2013-05-30  6:03 ` Yijing Wang [this message]
2013-05-30  6:04 ` Yinghai Lu
2013-05-30  6:26   ` Hao, Xudong
2013-05-30 20:27   ` Yinghai Lu
2013-05-30 23:22     ` Bjorn Helgaas
2013-05-31  0:54       ` Yinghai Lu
2013-05-31  1:29         ` Jiang Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51A6EBBE.6020805@huawei.com \
    --to=wangyijing@huawei.com \
    --cc=bhelgaas@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=liuj97@gmail.com \
    --cc=xudong.hao@intel.com \
    --cc=yinghai@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox