From: Thomas Huth <thuth@redhat.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: qemu-devel@nongnu.org,
Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>,
aik@ozlabs.ru, agraf@suse.de, mdroth@linux.vnet.ibm.com,
qemu-ppc@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v3 3/6] spapr_pci: encode class code including Prog IF register
Date: Tue, 5 May 2015 16:50:58 +0200 [thread overview]
Message-ID: <20150505165058.6d1256ce@thh440s> (raw)
In-Reply-To: <20150505125500.GU14090@voom.redhat.com>
On Tue, 5 May 2015 22:55:00 +1000
David Gibson <david@gibson.dropbear.id.au> wrote:
> On Tue, May 05, 2015 at 02:23:53PM +0530, Nikunj A Dadhania wrote:
> > Current code missed the Prog IF register. All Class Code, Subclass,
> > and Prog IF registers are needed to identify the accurate device type.
> >
> > For example: USB controllers use the PROG IF for denoting: USB
> > FullSpeed, HighSpeed or SuperSpeed.
> >
> > Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
>
> Um.. I'm guessing the CLASS_PROG register essentially includes the
> CLASS_DEVICE value? Otherwise it looks like you're losing the
> CLASS_DEVICE value.
>
> For the benefit of those who don't remember the PCI spec from memory,
> can you explain in more detail what the situation is with the several
> class registers and how they overlap / interact.
In the PCI local bus spec, the "Class Code" is a 3-bytes field starting
at offset 9 in the config space. The QEMU defines seem to split this up
into PCI_CLASS_PROG (9) and PCI_CLASS_DEVICE (10), but originally they
belong together.
> > ---
> > hw/ppc/spapr_pci.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
> > index ea1a092..8b02a3e 100644
> > --- a/hw/ppc/spapr_pci.c
> > +++ b/hw/ppc/spapr_pci.c
> > @@ -899,8 +899,7 @@ static int spapr_populate_pci_child_dt(PCIDevice *dev, void *fdt, int offset,
> > _FDT(fdt_setprop_cell(fdt, offset, "revision-id",
> > pci_default_read_config(dev, PCI_REVISION_ID, 1)));
> > _FDT(fdt_setprop_cell(fdt, offset, "class-code",
> > - pci_default_read_config(dev, PCI_CLASS_DEVICE, 2)
> > - << 8));
> > + pci_default_read_config(dev, PCI_CLASS_PROG, 3)));
> > if (pci_default_read_config(dev, PCI_INTERRUPT_PIN, 1)) {
> > _FDT(fdt_setprop_cell(fdt, offset, "interrupts",
> > pci_default_read_config(dev, PCI_INTERRUPT_PIN, 1)));
>
Patch looks fine to me.
Reviewed-by: Thomas Huth <thuth@redhat.com>
next prev parent reply other threads:[~2015-05-05 14:51 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-05 8:53 [Qemu-devel] [PATCH v3 0/6] spapr_pci: DT field fixes and PCI DT node creation in QEMU Nikunj A Dadhania
2015-05-05 8:53 ` [Qemu-devel] [PATCH v3 1/6] spapr_pci: remove duplicate macros Nikunj A Dadhania
2015-05-05 13:53 ` Thomas Huth
2015-05-06 5:41 ` Nikunj A Dadhania
2015-05-07 0:55 ` David Gibson
2015-05-07 4:55 ` Nikunj A Dadhania
2015-05-05 8:53 ` [Qemu-devel] [PATCH v3 2/6] spapr_pci: encode missing 64-bit memory address space Nikunj A Dadhania
2015-05-05 14:28 ` Thomas Huth
2015-05-06 5:44 ` Nikunj A Dadhania
2015-05-06 7:01 ` Thomas Huth
2015-05-06 8:23 ` Nikunj A Dadhania
2015-05-05 8:53 ` [Qemu-devel] [PATCH v3 3/6] spapr_pci: encode class code including Prog IF register Nikunj A Dadhania
2015-05-05 12:55 ` David Gibson
2015-05-05 14:50 ` Thomas Huth [this message]
2015-05-05 8:53 ` [Qemu-devel] [PATCH v3 4/6] spapr_pci: enumerate and add PCI device tree Nikunj A Dadhania
2015-05-05 15:32 ` Thomas Huth
2015-05-06 5:56 ` Nikunj A Dadhania
2015-05-05 8:53 ` [Qemu-devel] [PATCH v3 5/6] spapr_pci: fix boot-time device tree fields for pci hotplug Nikunj A Dadhania
2015-05-05 13:09 ` David Gibson
2015-05-06 5:57 ` Nikunj A Dadhania
2015-05-05 8:53 ` [Qemu-devel] [PATCH v3 6/6] spapr_pci: populate ibm,loc-code Nikunj A Dadhania
2015-05-05 16:03 ` Thomas Huth
2015-05-06 6:14 ` Nikunj A Dadhania
2015-05-07 0:32 ` David Gibson
2015-05-07 4:56 ` Nikunj A Dadhania
-- strict thread matches above, loose matches on Subject: below --
2015-05-05 8:43 [Qemu-devel] [PATCH v3 0/6] spapr_pci: DT field fixes and PCI DT node creation in QEMU Nikunj A Dadhania
2015-05-05 8:43 ` [Qemu-devel] [PATCH v3 3/6] spapr_pci: encode class code including Prog IF register Nikunj A Dadhania
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=20150505165058.6d1256ce@thh440s \
--to=thuth@redhat.com \
--cc=agraf@suse.de \
--cc=aik@ozlabs.ru \
--cc=david@gibson.dropbear.id.au \
--cc=mdroth@linux.vnet.ibm.com \
--cc=nikunj@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.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;
as well as URLs for NNTP newsgroup(s).