From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52449) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ypcb3-0000V0-9X for qemu-devel@nongnu.org; Tue, 05 May 2015 09:09:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ypcb1-0001Af-J1 for qemu-devel@nongnu.org; Tue, 05 May 2015 09:09:13 -0400 Date: Tue, 5 May 2015 22:55:00 +1000 From: David Gibson Message-ID: <20150505125500.GU14090@voom.redhat.com> References: <1430816036-26408-1-git-send-email-nikunj@linux.vnet.ibm.com> <1430816036-26408-4-git-send-email-nikunj@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0kAGJ5Hb5f/LtdyK" Content-Disposition: inline In-Reply-To: <1430816036-26408-4-git-send-email-nikunj@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH v3 3/6] spapr_pci: encode class code including Prog IF register List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nikunj A Dadhania Cc: aik@ozlabs.ru, mdroth@linux.vnet.ibm.com, qemu-ppc@nongnu.org, qemu-devel@nongnu.org, agraf@suse.de --0kAGJ5Hb5f/LtdyK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > For example: USB controllers use the PROG IF for denoting: USB > FullSpeed, HighSpeed or SuperSpeed. >=20 > Signed-off-by: Nikunj A Dadhania 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. > --- > hw/ppc/spapr_pci.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) >=20 > 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))); --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --0kAGJ5Hb5f/LtdyK Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVSL2kAAoJEGw4ysog2bOSTbMQAOGofV2LM3wQFRuBOR/swWhj EcYia/hNJDoY+2/6CK6rWw+V40/YxLBho+amujYZOqnTlorGQ2nGaPYtmX/A3ooZ CSwuWTr0OMKEorfN/fNIQcFxI0u+Nsud8ceghg+nfubgn7qPN+jQrJA17sSDvRvX yEGRCX+IMcnFr9SNThc4FqlK8Ph8NnsI5gJ/HKkgNkJeKEZy3mjV9GV9VaqRecTw 77Brp0a21ZNLBCZuz0/ttbbPVNAfOJqS1nqcHACaamarU3EoIG7XanZx3qP07e+e BKvYHa/9PVQVaptJdphO59hNYS8KMRN102IpMdF5RQ4NDodkqe6cPBCqgzmYIcJc tOscTQW/s1GwlHqogpAmW26gaVBfxjCWSDoa8QIk8pO3MYybeXUxvbam2fsF3wik GgKwg/bwJYazyrB3ViFen3HMcBPDgwlJkfSdtzz5Iko1paS9VWWR4fB2OlBwEvTg 94O5H03LdnUaddAUDhbhu6i8zkwJTML1sNgEe/admshIk4p7BO2hXtCKdsCwU9jh GCtKXL9NqxPUB9NeI7cBoaeHVaZV/JSuBZvtdZ4RIWAUG5iaA779qMAymbdPMnf4 pvDiMehkyJZ7r479kE/cgkeJNxEUy6DgXazLsSCeR5zcX4qqJNj7Z4lf5GoqoSrr D5bEiqoiUGWb+037qk5e =Go6b -----END PGP SIGNATURE----- --0kAGJ5Hb5f/LtdyK--