[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <515A38CB.5030406@huawei.com>
Date: Tue, 2 Apr 2013 09:47:55 +0800
From: Yijing Wang <wangyijing@...wei.com>
To: Alex Williamson <alex.williamson@...hat.com>
CC: Bjorn Helgaas <bhelgaas@...gle.com>, <linux-pci@...r.kernel.org>,
Arnd Bergmann <arnd@...db.de>, <linux-kernel@...r.kernel.org>,
Hanjun Guo <guohanjun@...wei.com>, <jiang.liu@...wei.com>
Subject: Re: [PATCH] PCI/VFIO: use pcie_flags_reg instead of access PCI-E
Capabilities Register
>> @@ -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 ((pdev->pcie_flags_reg & PCI_EXP_FLAGS_VERS) == 1)
>
> It looks like we should be using pcie_caps_reg(pdev) here instead of
> directly accessing pcie_flags_reg. Thanks,
That's right, I forget Myron Stowe introduced the PCIe Cap accessor function pcie_caps_reg().
I will resend the updated patch.
Thanks!
Yijing
>
> Alex
>
>> return PCI_CAP_EXP_ENDPOINT_SIZEOF_V1;
>> else
>> return PCI_CAP_EXP_ENDPOINT_SIZEOF_V2;
>
>
>
>
> .
>
--
Thanks!
Yijing
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists