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=-6.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 AEFEAC19759 for ; Thu, 1 Aug 2019 23:45:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 82A57206A3 for ; Thu, 1 Aug 2019 23:45:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="uTv0KihH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733115AbfHAXpw (ORCPT ); Thu, 1 Aug 2019 19:45:52 -0400 Received: from mail-vs1-f67.google.com ([209.85.217.67]:33194 "EHLO mail-vs1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390427AbfHAXpt (ORCPT ); Thu, 1 Aug 2019 19:45:49 -0400 Received: by mail-vs1-f67.google.com with SMTP id m8so50205075vsj.0; Thu, 01 Aug 2019 16:45:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EX8X4lO7aSaVB1FpMoDQxncs8FMEtYzW491XME/gSYQ=; b=uTv0KihHzXdFtzn+LjPKqpsUXs5DAkUGjm8wB/wmTC2piN3+7ufjR8Gkc2bMAmuhEI Cfx9ohunWZK6FdjhCn5oMZdAn8IvFR0ngPfc9C56hc4J/sBdN2+Z/eb/iVB3u4+FYP++ YZ0+8RE6Yij1Ht1M96t+C0aZmGOrrttpUJXmGZy19FeYx8UbMgHxSP2DV6dJf6N+WJ7Z hTo0z0PRLdZon5magUgEiwBnhaqI8d/vqLa0UNKFOlQlB4A5ZG8TH25VKQLfVXYIPoh5 n+GVUoIfKxa6cvwwL4jiGFJNjvgehcO+pqA6bGwtSZrSNeRxy99oUKMOWvARbKnRGuNl glQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EX8X4lO7aSaVB1FpMoDQxncs8FMEtYzW491XME/gSYQ=; b=eMIRxZ7qBb/WaQWXgTA8jDhbF22kAohEnMsmkGE1s6Mo2oacECpbHx3M2Jx5vKb6tQ pcowMEilY9JRslicvdR050Pud7tCoWFC34FzV8tTV1qMG/UJYYaHHeenL/xejSZZtEw3 drgqVps4xs7VSs19HhNfMFf/z7F2TYsfI5z2IlwDuS3nQwN8jNDI434OaJWViGpq5VAE AblrRdk6pniMGtvoXNKADsxA6zryA1cOmjEWOYIIzzz8LIqd2HrAMpHyRA3w3Kt2dXni ADsciyHhKsoezkbwuBL9mmoqxdiZ5LtenkDZQtU3upQYJW/c/9X51P7t6Y+xpERsUKPd 1ETA== X-Gm-Message-State: APjAAAWOj68pHqP2oxNY8LhfT3Hi/I1fbZo1A+bvd1xLlGf4aDNrxVKS FDJVuhEk9wSDEgi5+tTlWqGP93UqAV4hsA+RCpg= X-Google-Smtp-Source: APXvYqwMxagfEomHjxLC2RbiQGAR+rGQzLMmlo5MUf4VwLIYt05EApA1Z5u6c0EjAR5+WcC4BnDGCEACOcfzlLG2eVM= X-Received: by 2002:a67:fd91:: with SMTP id k17mr84874201vsq.121.1564703147897; Thu, 01 Aug 2019 16:45:47 -0700 (PDT) MIME-Version: 1.0 References: <20190801220117.14952-1-lyude@redhat.com> In-Reply-To: <20190801220117.14952-1-lyude@redhat.com> From: Ben Skeggs Date: Fri, 2 Aug 2019 09:45:36 +1000 Message-ID: Subject: Re: [Nouveau] [PATCH] PCI: Use pci_reset_bus() in quirk_reset_lenovo_thinkpad_50_nvgpu() To: Lyude Paul Cc: ML nouveau , linux-pci@vger.kernel.org, Lukas Wunner , Aaron Plattner , Maik Freudenberg , linux-kernel@vger.kernel.org, Daniel Drake , Bjorn Helgaas Content-Type: text/plain; charset="UTF-8" Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Fri, 2 Aug 2019 at 08:01, Lyude Paul wrote: > > Since quirk_nvidia_hda() was added there's now two nvidia device > functions on any laptops with nvidia GPUs: the HDA controller, and the > GPU itself. Unfortunately this has the sideaffect of breaking > quirk_reset_lenovo_thinkpad_50_nvgpu() since pci_reset_function() was > using pci_parent_bus_reset() to reset the GPU's respective PCI bus, and > pci_parent_bus_reset() does not work on busses which have more then a > single device function present. > > So, fix this by simply calling pci_reset_bus() instead which properly > resets the GPU bus and all device functions under it, including both the > GPU and the HDA controller. > > Fixes: b516ea586d71 ("PCI: Enable NVIDIA HDA controllers") > Cc: Lukas Wunner > Cc: Daniel Drake > Cc: Bjorn Helgaas > Cc: Aaron Plattner > Cc: Peter Wu > Cc: Ilia Mirkin > Cc: Karol Herbst > Cc: Maik Freudenberg > Cc: linux-pci@vger.kernel.org > Signed-off-by: Lyude Paul Acked-by: Ben Skeggs > --- > drivers/pci/quirks.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c > index 208aacf39329..44c4ae1abd00 100644 > --- a/drivers/pci/quirks.c > +++ b/drivers/pci/quirks.c > @@ -5256,7 +5256,7 @@ static void quirk_reset_lenovo_thinkpad_p50_nvgpu(struct pci_dev *pdev) > */ > if (ioread32(map + 0x2240c) & 0x2) { > pci_info(pdev, FW_BUG "GPU left initialized by EFI, resetting\n"); > - ret = pci_reset_function(pdev); > + ret = pci_reset_bus(pdev); > if (ret < 0) > pci_err(pdev, "Failed to reset GPU: %d\n", ret); > } > -- > 2.21.0 > > _______________________________________________ > Nouveau mailing list > Nouveau@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/nouveau