From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2DCF0C49EB7 for ; Mon, 28 Jun 2021 15:20:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 064D36138C for ; Mon, 28 Jun 2021 15:20:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236964AbhF1PWf (ORCPT ); Mon, 28 Jun 2021 11:22:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:36572 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235353AbhF1O6g (ORCPT ); Mon, 28 Jun 2021 10:58:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3993861D57; Mon, 28 Jun 2021 14:40:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624891240; bh=8hWUjLSsCuGfyAAp5KYKpJkbFgKTkR48o+/VI15TRNI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gz11x98oFRI73BtU5PuWvFw9QcRNqreH8uadbupCMQokRX0cKvUmM0pFHebBDK1oG AJM2j1kjzVaiW1GZkHha2XZ5E/isXlrstuvEZYWQ8JExlz6NcT5s6+6jvlLE+z/v9p 9SHTfwNmh6DhMDT3d8sxxFvDHk85V50DNUp7sk/oYfT6Ha792T5sMOwU3YmD2E2/2Q 3yYhQfqFsw+khsRfWzkwcCkc9lQaOpaVZHYfrO/Tpi07Gz/Sk9dp7uZktj3TpKC25g 96Vi5miopCpkPsUl4m/LygpeXfosvyJAxBedf0PcmabvV4r/7kZmBCby8A3pRgKqxQ Z1CMpZ/pFnM+w== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Shanker Donthineni , Bjorn Helgaas , Sinan Kaya , Greg Kroah-Hartman Subject: [PATCH 4.9 41/71] PCI: Mark some NVIDIA GPUs to avoid bus reset Date: Mon, 28 Jun 2021 10:39:33 -0400 Message-Id: <20210628144003.34260-42-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210628144003.34260-1-sashal@kernel.org> References: <20210628144003.34260-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.274-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-4.9.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 4.9.274-rc1 X-KernelTest-Deadline: 2021-06-30T14:39+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shanker Donthineni commit 4c207e7121fa92b66bf1896bf8ccb9edfb0f9731 upstream. Some NVIDIA GPU devices do not work with SBR. Triggering SBR leaves the device inoperable for the current system boot. It requires a system hard-reboot to get the GPU device back to normal operating condition post-SBR. For the affected devices, enable NO_BUS_RESET quirk to avoid the issue. This issue will be fixed in the next generation of hardware. Link: https://lore.kernel.org/r/20210608054857.18963-8-ameynarkhede03@gmail.com Signed-off-by: Shanker Donthineni Signed-off-by: Bjorn Helgaas Reviewed-by: Sinan Kaya Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/pci/quirks.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 77874187f5b3..096ba11ac105 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -3345,6 +3345,18 @@ static void quirk_no_bus_reset(struct pci_dev *dev) dev->dev_flags |= PCI_DEV_FLAGS_NO_BUS_RESET; } +/* + * Some NVIDIA GPU devices do not work with bus reset, SBR needs to be + * prevented for those affected devices. + */ +static void quirk_nvidia_no_bus_reset(struct pci_dev *dev) +{ + if ((dev->device & 0xffc0) == 0x2340) + quirk_no_bus_reset(dev); +} +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID, + quirk_nvidia_no_bus_reset); + /* * Some Atheros AR9xxx and QCA988x chips do not behave after a bus reset. * The device will throw a Link Down error on AER-capable systems and -- 2.30.2