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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA819C54EED for ; Mon, 30 Jan 2023 15:21:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235917AbjA3PVc (ORCPT ); Mon, 30 Jan 2023 10:21:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238006AbjA3PVR (ORCPT ); Mon, 30 Jan 2023 10:21:17 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC7623C2A8 for ; Mon, 30 Jan 2023 07:21:15 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 94FA8B811DD for ; Mon, 30 Jan 2023 15:21:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C528C433EF; Mon, 30 Jan 2023 15:21:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675092073; bh=dqeaUxrfJ+mcQITtQN4PuLnm7Acxsx/f4rPkJwjLVwU=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=a1g6i4H4tu2NIhKGSo6CamIiAfY1LYX7fh+23WGEE7jh/8NuF1B505ACEkP2M3BOw kz0giIx8k9serZ1z46o5Jd3hcNhonbQrb11GSI+rVSsWOTbBvbN/3TQxZcfSxDk3gG XWAlCxwBEV93npYYNaJpK0vv+d/1mRhW5D+xxa6uVKZgcmEoMMAT4aquMwU+oVIT3b lTh/ssoeGad4/EnhNxa2IgyI9V+Xk67j3gbSoRKMUYBE5cePtEmthPJJdwLLnorKYD qcGQuCeooeBUVyGtBHoRoNU9OZAVSZU6eLp5tfaE3XFZcS7JkIRKX78HkIkUiJdtDi KumIjzcvthQ3g== Date: Mon, 30 Jan 2023 09:21:11 -0600 From: Bjorn Helgaas To: Damien Le Moal Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, Niklas Cassel , Mario Limonciello , Shyam Sundar S K , Brijesh Singh Subject: Re: [PATCH] pci: Avoid FLR for AMD FCH AHCI adapters Message-ID: <20230130152111.GA1673431@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230128013951.523247-1-damien.lemoal@opensource.wdc.com> Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org [+cc Mario, Shyam, Brijesh] On Sat, Jan 28, 2023 at 10:39:51AM +0900, Damien Le Moal wrote: > PCI passthrough to VMs does not work with AMD FCH AHCI adapters: the > guest OS fails to correctly probe devices attached to the controller due > to FIS communication failures. What does a FIS communication failure look like? Can we include a line or two of dmesg output here to help users find this fix? AMD folks: Can you confirm/deny that this is a hardware erratum in this device? Do you know of any other devices that need a similar workaround? > Forcing the "bus" reset method before > unbinding & binding the adapter to the vfio-pci driver solves this > issue. I.e.: > > echo "bus" > /sys/bus/pci/devices//reset_method > > gives a working guest OS, thus indicating that the default flr reset > method is defective, resulting in the adapter not being reset correctly. > > This patch applies the no_flr quirk to AMD FCH AHCI devices to > permanently solve this issue. > > Reported-by: Niklas Cassel > Cc: stable@vger.kernel.org > Signed-off-by: Damien Le Moal > --- > drivers/pci/quirks.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c > index 285acc4aaccc..20ac67d59034 100644 > --- a/drivers/pci/quirks.c > +++ b/drivers/pci/quirks.c > @@ -5340,6 +5340,7 @@ static void quirk_no_flr(struct pci_dev *dev) > DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AMD, 0x1487, quirk_no_flr); > DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AMD, 0x148c, quirk_no_flr); > DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AMD, 0x149c, quirk_no_flr); > +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AMD, 0x7901, quirk_no_flr); > DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x1502, quirk_no_flr); > DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x1503, quirk_no_flr); > > -- > 2.39.1 >