All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yijing Wang <wangyijing@huawei.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: Yijing Wang <wangyijing@huawei.com>,
	Bjorn Helgaas <bhelgaas@google.com>, <linux-pci@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, Hanjun Guo <guohanjun@huawei.com>,
	<jiang.liu@huawei.com>
Subject: Re: [PATCH -v2] PCI/VFIO: use pcie_flags_reg instead of access PCI-E Capabilities Register
Date: Thu, 11 Apr 2013 19:54:47 +0800	[thread overview]
Message-ID: <5166A487.8060704@huawei.com> (raw)
In-Reply-To: <1364867547-15300-1-git-send-email-wangyijing@huawei.com>

ping?

On 2013/4/2 9:52, Yijing Wang wrote:
> Currently, we use pcie_flags_reg to cache PCI-E Capabilities Register,
> because PCI-E Capabilities Register bits are almost read-only. This patch
> use pcie_caps_reg() instead of another access PCI-E Capabilities Register.
> 
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
> ---
>  drivers/vfio/pci/vfio_pci_config.c |    6 +-----
>  1 files changed, 1 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/vfio/pci/vfio_pci_config.c b/drivers/vfio/pci/vfio_pci_config.c
> index aeb00fc..12a81f7 100644
> --- a/drivers/vfio/pci/vfio_pci_config.c
> +++ b/drivers/vfio/pci/vfio_pci_config.c
> @@ -1017,13 +1017,9 @@ static int vfio_cap_len(struct vfio_pci_device *vdev, u8 cap, u8 pos)
>  		return byte;
>  	case PCI_CAP_ID_EXP:
>  		/* length based on version */
> -		ret = pci_read_config_word(pdev, pos + PCI_EXP_FLAGS, &word);
> -		if (ret)
> -			return pcibios_err_to_errno(ret);
> -
>  		vdev->extended_caps = true;
>  
> -		if ((word & PCI_EXP_FLAGS_VERS) == 1)
> +		if ((pcie_caps_reg(pdev) & PCI_EXP_FLAGS_VERS) == 1)
>  			return PCI_CAP_EXP_ENDPOINT_SIZEOF_V1;
>  		else
>  			return PCI_CAP_EXP_ENDPOINT_SIZEOF_V2;
> 


-- 
Thanks!
Yijing


  reply	other threads:[~2013-04-11 11:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-02  1:52 [PATCH -v2] PCI/VFIO: use pcie_flags_reg instead of access PCI-E Capabilities Register Yijing Wang
2013-04-11 11:54 ` Yijing Wang [this message]
2013-04-15 15:11 ` Alex Williamson

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=5166A487.8060704@huawei.com \
    --to=wangyijing@huawei.com \
    --cc=alex.williamson@redhat.com \
    --cc=bhelgaas@google.com \
    --cc=guohanjun@huawei.com \
    --cc=jiang.liu@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.