From patchwork Tue Jun 18 12:54:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "G.R." X-Patchwork-Id: 2742261 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 65687C0AB1 for ; Tue, 18 Jun 2013 12:54:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 37FD420381 for ; Tue, 18 Jun 2013 12:54:46 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id D0D0420378 for ; Tue, 18 Jun 2013 12:54:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9B363E61DB for ; Tue, 18 Jun 2013 05:54:44 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-oa0-f43.google.com (mail-oa0-f43.google.com [209.85.219.43]) by gabe.freedesktop.org (Postfix) with ESMTP id BD0D0E5C72 for ; Tue, 18 Jun 2013 05:54:35 -0700 (PDT) Received: by mail-oa0-f43.google.com with SMTP id i7so4940080oag.2 for ; Tue, 18 Jun 2013 05:54:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=VYu4HDNrDX+zrFXj9pBU43PWB0zil/k7yTMcGeqyXqU=; b=xTqXHv7Ax9mnE5WYABLc56sxQVGuOgHZp0HQtcGzR/O0UMRzSTpXejhX9xqw/CfMMr 4bPk6RmlgctzsM7IICYEudthQQKT1EJ3AczVfvS4qsRoi/Gdyw1e/mutdO5pTt+IbiTN IlCL6pXciingX/bBwOA+/2SvkT6TgrUn/iXwJJJwI8+eLR2c/IpGcLUDfVdBq6NxHK9h L5qh3QQkKu93najKYGFu8uX8PLUFK/seaumU5JFM4yp06EmOhN9ZbcI1Oq4daopZqNfa XbM66voQG/xwDMiE4tWjHD6htKkkhaYTMRFzMNs1ziFb9OdvdsRpNAKm+YMgh0uKMvWI ECkA== MIME-Version: 1.0 X-Received: by 10.60.47.108 with SMTP id c12mr11798738oen.126.1371560075398; Tue, 18 Jun 2013 05:54:35 -0700 (PDT) Received: by 10.60.8.195 with HTTP; Tue, 18 Jun 2013 05:54:35 -0700 (PDT) In-Reply-To: References: <20121218085341.03d9cab3@jbarnes-desktop> <20121218102012.1866ea85@jbarnes-desktop> <20121220081330.19f30c3e@jbarnes-desktop> Date: Tue, 18 Jun 2013 20:54:35 +0800 X-Google-Sender-Auth: QI4w47H6Y_B9W_RtEfcHU75459Y Message-ID: From: "G.R." To: Jesse Barnes , Daniel Vetter Cc: Stefano Stabellini , intel-gfx@lists.freedesktop.org, "Dong, Eddie" , "Xu, Dongxiao" , "Zhang, Xiantao" Subject: Re: [Intel-gfx] [PATCH] Fix intel_detect_pch() to work in xen environment. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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: Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx 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; if (pch->vendor == PCI_VENDOR_ID_INTEL) { unsigned short id; + unsigned found = 1; 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"); } } _______________________________________________