intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: "G.R." <firemeteor@users.sourceforge.net>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	intel-gfx@lists.freedesktop.org, "Dong,
	Eddie" <eddie.dong@intel.com>,
	"Xu, Dongxiao" <dongxiao.xu@intel.com>,
	"Zhang, Xiantao" <xiantao.zhang@intel.com>
Subject: Re: [PATCH] Fix intel_detect_pch() to work in xen environment.
Date: Wed, 19 Jun 2013 10:57:49 +0300	[thread overview]
Message-ID: <20130619075749.GG5004@intel.com> (raw)
In-Reply-To: <CAKhsbWZVAVqgzQLkJ0=SZHP-D35acPaahB9yAmNAEc9bpp8wdg@mail.gmail.com>

On Tue, Jun 18, 2013 at 08:54:35PM +0800, G.R. wrote:
> On Sun, Dec 23, 2012 at 2:51 PM, G.R. <firemeteor@users.sourceforge.net> 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 irrelevant
> +        * ISA bridge in the system. To work reliably, we should scan trhough
> +        * all the ISA bridge devices and check for the first match, instead
> +        * of only checking the first one.
>          */
>         pch = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, NULL);
> -       if (pch) {
> +       while (pch) {
> +               struct pci_dev * curr = pch;
                                  ^

No space there. I think checkpatch should catch that.

>                 if (pch->vendor == PCI_VENDOR_ID_INTEL) {
>                         unsigned short id;
> +                       unsigned found = 1;

bool found = true;

Although it would be easy to adjust the patch to not need a 'found'
variable.

>                         id = pch->device & INTEL_PCH_DEVICE_ID_MASK;
>                         dev_priv->pch_id = 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 = 0;
> +                       }
> +                       if (found) {
> +                               BUG_ON(dev_priv->num_pch_pll > I915_NUM_PLLS);
> +                               pci_dev_put(pch);
> +                               break;
>                         }
> -                       BUG_ON(dev_priv->num_pch_pll > I915_NUM_PLLS);
>                 }
> -               pci_dev_put(pch);
> +               pch = 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älä
Intel OTC

  parent reply	other threads:[~2013-06-19  7:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-18 16:49 [PATCH] Fix intel_detect_pch() to work in xen environment G.R.
2012-12-18 16:53 ` Jesse Barnes
2012-12-18 17:43   ` G.R.
2012-12-18 18:20     ` Jesse Barnes
2012-12-19  3:40       ` G.R.
2012-12-20  4:04       ` G.R.
2012-12-20 16:13         ` Jesse Barnes
2012-12-23  6:51           ` G.R.
2013-06-18 12:54             ` G.R.
2013-06-19  6:01               ` Daniel Vetter
2013-06-19 13:10                 ` [PATCH] Fix PCH detect with multiple ISA bridges in VM Rui Guo
2013-06-19 15:29                 ` [PATCH] Fix intel_detect_pch() to work in xen environment G.R.
2013-06-20 12:01                   ` Daniel Vetter
2013-06-19  7:57               ` Ville Syrjälä [this message]
2012-12-18 17:21 ` Ben Widawsky
2012-12-19  4:01   ` G.R.

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=20130619075749.GG5004@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=dongxiao.xu@intel.com \
    --cc=eddie.dong@intel.com \
    --cc=firemeteor@users.sourceforge.net \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xiantao.zhang@intel.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 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).