From patchwork Tue Feb 9 15:41:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kelly Zytaruk X-Patchwork-Id: 8263011 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C56ED9F1C1 for ; Tue, 9 Feb 2016 15:41:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 01F5E20220 for ; Tue, 9 Feb 2016 15:41:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8F6B620251 for ; Tue, 9 Feb 2016 15:41:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756922AbcBIPlw (ORCPT ); Tue, 9 Feb 2016 10:41:52 -0500 Received: from [165.204.55.251] ([165.204.55.251]:38544 "EHLO KellyTonga.amd.com" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1756904AbcBIPlv (ORCPT ); Tue, 9 Feb 2016 10:41:51 -0500 Received: from KellyTonga.amd.com (localhost [127.0.0.1]) by KellyTonga.amd.com (8.14.4/8.14.4/Debian-4) with ESMTP id u19FfmXx005854; Tue, 9 Feb 2016 10:41:48 -0500 Received: (from root@localhost) by KellyTonga.amd.com (8.14.4/8.14.4/Submit) id u19Ffl8b005853; Tue, 9 Feb 2016 10:41:47 -0500 From: Kelly Zytaruk To: bhelgaas@google.com, linux-pci@vger.kernel.org Cc: Kelly Zytaruk Subject: [PATCH] [PATCH] PCI: Support SRIOV on Legacy EndPoint device Date: Tue, 9 Feb 2016 10:41:36 -0500 Message-Id: <1455032496-1538-1-git-send-email-kelly.zytaruk@amd.com> X-Mailer: git-send-email 1.7.10.4 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_WEB, RP_MATCHES_RCVD, 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 It is not neccessary to check for PCI_EXP_TYPE in sriov_init(). There appears to be no reason for the check. Some AMD GPUs have hardware support for grapics SRIOV. If the GPU has a display output then the GPU needs to support Legacy VGA operation. If CLASS_CODE = VGA then the device should have a Port Type = Legacy EndPoint. Therefore in order to enable SRIOV on a GPU with a display output, LEGACY_END_POINT is supported as a valid Port Type by removing the check for Port Type. Patch is also logged in Bugzilla #112221 Signed-off-by: Kelly Zytaruk --- drivers/pci/iov.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index 31f31d4..fe4bd0a 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c @@ -387,10 +387,6 @@ static int sriov_init(struct pci_dev *dev, int pos) struct resource *res; struct pci_dev *pdev; - if (pci_pcie_type(dev) != PCI_EXP_TYPE_RC_END && - pci_pcie_type(dev) != PCI_EXP_TYPE_ENDPOINT) - return -ENODEV; - pci_read_config_word(dev, pos + PCI_SRIOV_CTRL, &ctrl); if (ctrl & PCI_SRIOV_CTRL_VFE) { pci_write_config_word(dev, pos + PCI_SRIOV_CTRL, 0);