From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Subject: Re: [PATCH] Fix intel_detect_pch() to work in xen environment. Date: Wed, 19 Jun 2013 10:57:49 +0300 Message-ID: <20130619075749.GG5004@intel.com> References: <20121218085341.03d9cab3@jbarnes-desktop> <20121218102012.1866ea85@jbarnes-desktop> <20121220081330.19f30c3e@jbarnes-desktop> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by gabe.freedesktop.org (Postfix) with ESMTP id EFA1CE60A6 for ; Wed, 19 Jun 2013 00:57:53 -0700 (PDT) Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: "G.R." Cc: Stefano Stabellini , intel-gfx@lists.freedesktop.org, "Dong, Eddie" , "Xu, Dongxiao" , "Zhang, Xiantao" List-Id: intel-gfx@lists.freedesktop.org On Tue, Jun 18, 2013 at 08:54:35PM +0800, G.R. wrote: > On Sun, Dec 23, 2012 at 2:51 PM, G.R. = wrote: > >>> Hi Jesse, I think I need to resend the patch with proper comment to > >>> have it formally accepted. > >>> Any guide line for formal patch submission? Do I need to start a > >>> separate thread? > >> > >> No, just cc Daniel Vetter. > >> > >> -- > >> Jesse Barnes, Intel Open Source Technology Center > > > > Thanks, > > Resend with updated patch && Daniel involved. > > Also include the background info for easy reading. > > > > In XEN HVM guest, there is always an emulated PIIX3 ISA bridge on slot = 01.0. > > This shadows the PCH ISA bridge on 1f.0 with the current > > intel_detect_pch() implementation. > > The issue can be easily solved by looping through all the ISA bridges > > until the first match is found, instead of just check against the > > first one. > > > = > This seems to have lost in the list. Retry it again with latest > torvalds' kernel: > = > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_= drv.c > index a2e4953..e38fa86 100644 > --- a/drivers/gpu/drm/i915/i915_drv.c > +++ b/drivers/gpu/drm/i915/i915_drv.c > @@ -454,11 +454,18 @@ void intel_detect_pch(struct drm_device *dev) > * make graphics device passthrough work easy for VMM, that only > * need to expose ISA bridge to let driver know the real hardware > * underneath. This is a requirement from virtualization team. > + * > + * In some virtualized environments (e.g. XEN), there is irreleva= nt > + * ISA bridge in the system. To work reliably, we should scan trh= ough > + * all the ISA bridge devices and check for the first match, inst= ead > + * of only checking the first one. > */ > pch =3D pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, NULL); > - if (pch) { > + while (pch) { > + struct pci_dev * curr =3D pch; ^ No space there. I think checkpatch should catch that. > if (pch->vendor =3D=3D PCI_VENDOR_ID_INTEL) { > unsigned short id; > + unsigned found =3D 1; bool found =3D true; Although it would be easy to adjust the patch to not need a 'found' variable. > id =3D pch->device & INTEL_PCH_DEVICE_ID_MASK; > dev_priv->pch_id =3D id; > = > @@ -490,10 +497,20 @@ void intel_detect_pch(struct drm_device *dev) > DRM_DEBUG_KMS("Found LynxPoint LP PCH\n"); > WARN_ON(!IS_HASWELL(dev)); > WARN_ON(!IS_ULT(dev)); > + } else { > + found =3D 0; > + } > + if (found) { > + BUG_ON(dev_priv->num_pch_pll > I915_NUM_P= LLS); > + pci_dev_put(pch); > + break; > } > - BUG_ON(dev_priv->num_pch_pll > I915_NUM_PLLS); > } > - pci_dev_put(pch); > + pch =3D pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, curr); > + pci_dev_put(curr); > + } > + if (!pch) { > + DRM_DEBUG_KMS("No PCH found?\n"); > } > } > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- = Ville Syrj=E4l=E4 Intel OTC