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=-8.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 6AF66C3A589 for ; Thu, 15 Aug 2019 22:16:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2C5C82086C for ; Thu, 15 Aug 2019 22:16:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565907363; bh=S+HnNRjzevYqF/1E7oN2K3HGRc81RDrKMX1OcXkblsE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=0qJK1VVTGrRkAKeNqJc5n0Rm23O1FVSbX82nmTuj4IH3bMakzszJQ5jJbP4MpwJZe 5pwFGdnp9aohxlF5+b0umINJ/w2WfKOcFI0JpdNxv5xCKnsOU10Qx58tVhObBXU1K6 wGL22iWWos9oFFhXfUOexj8NiTkT9yt5Xv4IBDRA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730908AbfHOWQC (ORCPT ); Thu, 15 Aug 2019 18:16:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:60166 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728685AbfHOWQC (ORCPT ); Thu, 15 Aug 2019 18:16:02 -0400 Received: from localhost (unknown [69.71.4.100]) (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 D48F020644; Thu, 15 Aug 2019 22:15:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565907361; bh=S+HnNRjzevYqF/1E7oN2K3HGRc81RDrKMX1OcXkblsE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lYQLvuvDfrxb/sksuseUW5V/MAsUIo57vN82VjPUZoB43787ziWQ/gk17qDlFECb9 /StBjikx3IpFkZaYIg9csIL0ploUtgbOl/vRod8B6rjjtzSTHzQaUp+tdM+Pv9vS+x qoLD9/VFRBxoJzRR1BUxN81EUSuS20ZNckCuQtvE= Date: Thu, 15 Aug 2019 17:15:22 -0500 From: Bjorn Helgaas To: Lyude Paul Cc: nouveau@lists.freedesktop.org, linux-pci@vger.kernel.org, Lukas Wunner , Daniel Drake , Aaron Plattner , Peter Wu , Ilia Mirkin , Karol Herbst , Maik Freudenberg , linux-kernel@vger.kernel.org Subject: Re: [PATCH] PCI: Use pci_reset_bus() in quirk_reset_lenovo_thinkpad_50_nvgpu() Message-ID: <20190815221522.GH253360@google.com> References: <20190801220117.14952-1-lyude@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190801220117.14952-1-lyude@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Thu, Aug 01, 2019 at 06:01:17PM -0400, 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 We merged b516ea586d71 for v5.3, so I applied this with Ben's ack to for-linus for v5.3, thanks! > --- > 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 >