From: Kevin O'Connor <kevin@koconnor.net>
To: Aleksandr Bezzubikov <zuban32s@gmail.com>
Cc: seabios@seabios.org, marcel@redhat.com, kraxel@redhat.com,
lersek@redhat.com, qemu-devel@nongnu.org, konrad.wilk@oracle.com,
mst@redhat.com
Subject: Re: [Qemu-devel] [RFC PATCH v2 1/4] pci: refactor pci_find_capapibilty to get bdf as the first argument instead of the whole pci_device
Date: Sun, 23 Jul 2017 12:24:47 -0400 [thread overview]
Message-ID: <20170723162447.GA28883@morn.lan> (raw)
In-Reply-To: <1500761510-1556-2-git-send-email-zuban32s@gmail.com>
On Sun, Jul 23, 2017 at 01:11:47AM +0300, Aleksandr Bezzubikov wrote:
> Refactor pci_find_capability function to get bdf instead of
> a whole pci_device* as the only necessary field for this function
> is still bdf.
> It greatly helps when we have bdf but not pci_device.
>
> Signed-off-by: Aleksandr Bezzubikov <zuban32s@gmail.com>
> ---
> src/fw/pciinit.c | 4 ++--
> src/hw/pcidevice.c | 12 ++++++------
> src/hw/pcidevice.h | 2 +-
> src/hw/virtio-pci.c | 4 ++--
> 4 files changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c
> index 08221e6..864954f 100644
> --- a/src/fw/pciinit.c
> +++ b/src/fw/pciinit.c
> @@ -762,7 +762,7 @@ static int pci_bus_hotplug_support(struct pci_bus *bus, u8 pcie_cap)
> return downstream_port && slot_implemented;
> }
>
> - shpc_cap = pci_find_capability(bus->bus_dev, PCI_CAP_ID_SHPC, 0);
> + shpc_cap = pci_find_capability(bus->bus_dev->bdf, PCI_CAP_ID_SHPC, 0);
> return !!shpc_cap;
> }
>
> @@ -844,7 +844,7 @@ static int pci_bios_check_devices(struct pci_bus *busses)
> */
> parent = &busses[0];
> int type;
> - u8 pcie_cap = pci_find_capability(s->bus_dev, PCI_CAP_ID_EXP, 0);
> + u8 pcie_cap = pci_find_capability(s->bus_dev->bdf, PCI_CAP_ID_EXP, 0);
> int hotplug_support = pci_bus_hotplug_support(s, pcie_cap);
> for (type = 0; type < PCI_REGION_TYPE_COUNT; type++) {
> u64 align = (type == PCI_REGION_TYPE_IO) ?
> diff --git a/src/hw/pcidevice.c b/src/hw/pcidevice.c
> index cfebf66..d01e27b 100644
> --- a/src/hw/pcidevice.c
> +++ b/src/hw/pcidevice.c
> @@ -134,25 +134,25 @@ pci_find_init_device(const struct pci_device_id *ids, void *arg)
> return NULL;
> }
>
> -u8 pci_find_capability(struct pci_device *pci, u8 cap_id, u8 cap)
> +u8 pci_find_capability(u16 bdf, u8 cap_id, u8 cap)
Thanks. If you respin this series, please also move
pci_find_capability() function from pcidevice.c to pci.c. (If the
function no longer takes a pci_device, it should be moved out of
pcidevice.c.)
-Kevin
next prev parent reply other threads:[~2017-07-23 16:24 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-22 22:11 [Qemu-devel] [RFC PATCH v2 0/4] Allow RedHat PCI bridges reserve more buses than necessary during init Aleksandr Bezzubikov
2017-07-22 22:11 ` [Qemu-devel] [RFC PATCH v2 1/4] pci: refactor pci_find_capapibilty to get bdf as the first argument instead of the whole pci_device Aleksandr Bezzubikov
2017-07-23 16:04 ` Marcel Apfelbaum
2017-07-23 16:24 ` Kevin O'Connor [this message]
2017-07-22 22:11 ` [Qemu-devel] [RFC PATCH v2 2/4] pci: add RedHat vendor ID Aleksandr Bezzubikov
2017-07-23 16:05 ` Marcel Apfelbaum
2017-07-22 22:11 ` [Qemu-devel] [RFC PATCH v2 3/4] pci: add QEMU-specific PCI capability structure Aleksandr Bezzubikov
2017-07-23 2:44 ` Michael S. Tsirkin
2017-07-23 16:12 ` Alexander Bezzubikov
2017-07-23 16:30 ` Kevin O'Connor
2017-07-23 16:47 ` Alexander Bezzubikov
2017-07-22 22:11 ` [Qemu-devel] [RFC PATCH v2 4/4] pci: enable RedHat PCI bridges to reserve additional buses on PCI init Aleksandr Bezzubikov
2017-07-23 2:49 ` Michael S. Tsirkin
2017-07-23 16:43 ` Alexander Bezzubikov
2017-07-23 19:44 ` Alexander Bezzubikov
2017-07-24 9:42 ` Gerd Hoffmann
2017-07-24 14:39 ` Alexander Bezzubikov
2017-07-24 14:55 ` Marcel Apfelbaum
2017-07-25 15:46 ` [Qemu-devel] [RFC PATCH v2 0/4] Allow RedHat PCI bridges reserve more buses than necessary during init Laszlo Ersek
2017-07-26 6:48 ` Marcel Apfelbaum
2017-07-26 15:20 ` Laszlo Ersek
2017-07-26 16:22 ` Marcel Apfelbaum
2017-07-26 18:31 ` Laszlo Ersek
2017-07-27 18:18 ` Marcel Apfelbaum
2017-07-26 18:49 ` Michael S. Tsirkin
2017-07-27 18:24 ` Marcel Apfelbaum
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=20170723162447.GA28883@morn.lan \
--to=kevin@koconnor.net \
--cc=konrad.wilk@oracle.com \
--cc=kraxel@redhat.com \
--cc=lersek@redhat.com \
--cc=marcel@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=seabios@seabios.org \
--cc=zuban32s@gmail.com \
/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.