Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3861572pxb; Tue, 17 Nov 2020 05:38:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJw7J0dCpPYPyD63sP1h4MOVQMJFtJWN1AxNCrnV6mKy6L4EIrFq1824GxQpebHJ2Z3RJgBG X-Received: by 2002:a50:9e29:: with SMTP id z38mr21248905ede.220.1605620297739; Tue, 17 Nov 2020 05:38:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605620297; cv=none; d=google.com; s=arc-20160816; b=pR9o+gjOSIxRM0bf/Jco7jX/ZnSey7pyj2Z/to+Kpfh6kYmPK4yvwjN/l9Q6IKMa6g mK6jGSAtUKDBfAT91bc0TsibY00cLnOA/tYHMMhBUDKkD3Ynz/1/60pXS23Tir0WCKuY l2Nx7gyqEijO4IvDs4X0wBxCgF858wfkaIS9mpmWCohdv40f4Vt+0dqbmd0hIDZyFUxJ zmk8O2cfxYmWNbb+KYTGksoIYk3bVpw4Jy8Iwo2yjbvoAAi8DZCa10HNmKwdlQDZ1OX3 i+9f0tDnmMUQnTRtsHOHhx9zOlFfZs5lSQFwT+I6C4kzAsYEVx9P+wMyvSgzjHXnbBaH EasQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rGYhXjXsEq3ETmFy/t7zfiF+Ml5BcucdZrCx0NOMxTE=; b=j1qU72FXZW8EX6zjC+1z7XKViXmaFAmqOlWJvQNrM9ONNq/P4pleqTEpgYIYJY9MA4 NVApdFy7lMBfB+Tk6bCZZjXaThp9Dv5YnDA9MEVF3TysQes70Zm3K7ujqanb0Z57jD27 GkOJnfAvUcBxpoG1MiedsGpZa9KscS63b2hooIkQdxvWuXn45WJj0LsxJ9mLZd5Hwz+e ax5wf869+rgXqJb5CDZRku2OGoXIhqfrLX7HJc/W8BxSD8ZR0yiHdjySVO4QmIkMesf2 iExRfOlue67AMMwgBvY/fA1onnt6LpzREQcricLewyN/ZtdA4XaC1o2liNxjeeCHYSFH 3QeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Bnmuk5wn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v10si13937910ede.131.2020.11.17.05.37.53; Tue, 17 Nov 2020 05:38:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Bnmuk5wn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732463AbgKQNfa (ORCPT + 99 others); Tue, 17 Nov 2020 08:35:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:46150 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732468AbgKQNfZ (ORCPT ); Tue, 17 Nov 2020 08:35:25 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9274C24686; Tue, 17 Nov 2020 13:35:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605620125; bh=ppERrehELOu1hQh6t1jCbm+AqyYz5ABoxm7pF4UNWcY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bnmuk5wnIdS3ad6MsRNn7JV6QVVwfa+POA11ibOar6a+KyL97hYtSFZNUG+6bDowQ ROdXKi2L8glcYLKIHFmsgQb1n7yjf6F/VrEwiCsYYvmwyu8tPMofL252u+l3LTWuLO iFL3qC0hKUNrw9D4hasHuJpN6WAy/g00HXBlBNYo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhenyu Wang , Xiong Zhang , Hang Yuan , Stuart Summers , Fred Gao , Alex Williamson , Sasha Levin Subject: [PATCH 5.9 115/255] vfio/pci: Bypass IGD init in case of -ENODEV Date: Tue, 17 Nov 2020 14:04:15 +0100 Message-Id: <20201117122144.543757070@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122138.925150709@linuxfoundation.org> References: <20201117122138.925150709@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Fred Gao [ Upstream commit e4eccb853664de7bcf9518fb658f35e748bf1f68 ] Bypass the IGD initialization when -ENODEV returns, that should be the case if opregion is not available for IGD or within discrete graphics device's option ROM, or host/lpc bridge is not found. Then use of -ENODEV here means no special device resources found which needs special care for VFIO, but we still allow other normal device resource access. Cc: Zhenyu Wang Cc: Xiong Zhang Cc: Hang Yuan Cc: Stuart Summers Signed-off-by: Fred Gao Signed-off-by: Alex Williamson Signed-off-by: Sasha Levin --- drivers/vfio/pci/vfio_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c index 1ab1f5cda4ac2..bfdc010a6b043 100644 --- a/drivers/vfio/pci/vfio_pci.c +++ b/drivers/vfio/pci/vfio_pci.c @@ -385,7 +385,7 @@ static int vfio_pci_enable(struct vfio_pci_device *vdev) pdev->vendor == PCI_VENDOR_ID_INTEL && IS_ENABLED(CONFIG_VFIO_PCI_IGD)) { ret = vfio_pci_igd_init(vdev); - if (ret) { + if (ret && ret != -ENODEV) { pci_warn(pdev, "Failed to setup Intel IGD regions\n"); goto disable_exit; } -- 2.27.0