Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1549891rbb; Mon, 26 Feb 2024 13:02:39 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUS2RqWCKA9agqLIiW/eWH2Yslml9cdoo3tnH5GWAFqRDeZnUoW6YQltz3UI9jy5Tio7tW8kZ9AFZJitQQ5ebGq93e6OP7t+d6Cv1EALQ== X-Google-Smtp-Source: AGHT+IFaCQF5L0qF7vetONKvgkAYLTnaXp2D2WjGOAzeFkO3DbeySIgdjypMVV8Hi/8nAoEeIR5+ X-Received: by 2002:a0c:e1ca:0:b0:68f:b710:511 with SMTP id v10-20020a0ce1ca000000b0068fb7100511mr253436qvl.39.1708981358980; Mon, 26 Feb 2024 13:02:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708981358; cv=pass; d=google.com; s=arc-20160816; b=rmGq1uLcfPQKVHbAycOFfc5jv1toCRvvt4tf4zgaQtScSJocdPDt2apUNcRuHHWL0p 3kjajTQ/GdTKYpMX9HsMiDiJiAc0UogZeAMKXw3AJTpYLg2nltzWVY5B17T0uVK0pHK8 DTUMmv20B1QQxz0UL3qAZS44W2SvgakxKL4EKptz2LdQExmRWL5xJwYoLk9OD47a5LJX eNwdbaZzQdd3UjEm0X0rkhINHl8Hrvd+Ldh5yl97mCIDkVIaoCrhGXTO0OSQmCkmCaXP WqLrsQUcaz8W63u5tYwMsdtsxE6MoIqMhRCU7lMpb28c1tWqgv5ecvQyeZ6VCzbRrum1 Nblg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:subject:cc:to:from :date:dkim-signature; bh=Pn+mhcT5Zu6s8Btv7X0qX5P4DTH8mjUGDx+83p2IO2g=; fh=P/xHzT6VlmS2hNid3SeRRUlXaxYbFtRiCuueY+pk65s=; b=Yn/32lDq+fOb8PDmhnLEyjQhbBVsgzYuczu+/Ib5axFouiORZGCzj6PxKPW1+GfSqp rEbtmPre3XjZ1qegTkEjKFCghmgD4qLFEw93q87TadlHlMjiTtxTNdAoPDAAczi3GJC1 Tx8nd+h6r6uPCMY5rHvFHy5Rdv3C8Lr82Io/wf0fHlk0U0VmcGePDG4U9yShMAQ4JhxW PtIGD4Tq40gUJe9ir4hBqk9XlD4ol/j1NoS7t2DsF9BJFxh20PGD9SLct+4LaUZfytUO sknVe788oqv2gUtvybO6eRUWwTCWypuQjQaVY2WFKk4hbsR6YKC3kIiYJdvkYv91LrfU hVNg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sKUHuEZM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-82318-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82318-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id iu13-20020ad45ccd000000b00690048b5b2csi3417591qvb.133.2024.02.26.13.02.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 13:02:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-82318-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sKUHuEZM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-82318-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82318-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B9C511C24AC0 for ; Mon, 26 Feb 2024 21:02:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 68AFA13172E; Mon, 26 Feb 2024 21:02:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sKUHuEZM" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8D3F312F394; Mon, 26 Feb 2024 21:02:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708981351; cv=none; b=otqNS2wpLFDBvAoA9sJ3jhZ9eK631jSwRmEagPsaRgZmdLMxch/Cf2NCdEMfKPV1V2AnDkRmv1u2TknKnCqllxmGZy31l+9azsbLUrVWqgR2/zJiIIe3l3rkpwjolgZtk8Mz/HZk9FEs0MijVC3Q4XsT0cWG9C1PQJJxtuxwpgw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708981351; c=relaxed/simple; bh=TOLX+LMPbcI2ajxr5u705EUNPqYivRst2CHEJGGDcJM=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=Z046+s47H5kb6hbrp+pLNyhh+Rg6ZXtq8NEyYVCpEBQanOZGdAIqV+3SiH6mQxvsAD0DRZN8xtDjRseACpgLSliMjMX4P/eIdtwMmwfkKgjRYd2WQwVAd3lDNqtozj/GesjKw/HvWy6IA8/BcMUGDNnfF0FW1O8OqKYZ1rDeR3Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sKUHuEZM; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21EBDC433F1; Mon, 26 Feb 2024 21:02:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708981350; bh=TOLX+LMPbcI2ajxr5u705EUNPqYivRst2CHEJGGDcJM=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=sKUHuEZMGvk9Vl1IfC73A4HhjBFaLYvP/ahlPRXWDSWb6J+SzmNK7xlAh0c7LKTCZ Kzu8R27JQdbW5X7AowimOxH7ogwGp6NULU7eO6nMKYe/fA7+v8ouu9ilCW+CTr992G GTzY2bKhfy1qjK1TzQSIGBIkYDjE3YJwTzLfhs89WjWKZWSTDXP/USJOJ37tInFTGq K7ZATwRFRPSdegNeDbkSL7FDOnZcPIhxv/Qwi2dH4QQoLQKUqcRI019MM+qLAu+V2/ kpZKrn5iWIb1rHk/zf3cuMvU29VHYQZeSxLkOP2TwvzzlAklF++78uM2lBBmcqLUcS 7FnE1HHvrtICA== Date: Mon, 26 Feb 2024 15:02:28 -0600 From: Bjorn Helgaas To: Edmund Raile Cc: bhelgaas@google.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Alex Williamson Subject: Re: [PATCH] PCI: Mark LSI FW643 to avoid bus reset Message-ID: <20240226210228.GA199890@bhelgaas> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240226102354.86757-1-edmund.raile@proton.me> [+cc Alex] On Mon, Feb 26, 2024 at 10:25:12AM +0000, Edmund Raile wrote: > Using LSI / Agere FW643 with vfio-pci will issue an FLreset, causing > a broken link only recoverable by removing power (power-off / > suspend + rescan). Prevent this bus reset. > With this change, the device can be assigned to VMs with VFIO. I don't quite understand the commit log. It says Function Level Resets cause a problem, but the patch sets PCI_DEV_FLAGS_NO_BUS_RESET, which prevents Secondary Bus Resets, not Function Level Resets. By default, I think we try reset methods in order of pci_reset_fn_methods[], so the fact that we get to the end and try pci_reset_bus_function() (where PCI_DEV_FLAGS_NO_BUS_RESET is tested) suggests that we weren't able to use FLR or PM resets. IIUC, vfio-pci resets devices to prevent leaking state from one VM to another. We might be willing to accept the downside of allowing that leakage, but I think it's worth mentioning that in the commit log. Add blank lines between paragraphs (also in the comment below), or rewrap into a single paragraph. > Signed-off-by: Edmund Raile > --- > Usefulness: > The LSI FW643 PCIe->FireWire 800 interface may be EOL but it is > the only one that does not use a PCIe->PCI bridge. > It was used in the following Apple machines: > MacBookPro10,1 > MacBookPro9,2 > MacBookPro6,2 > MacBookPro5,1 > Macmini6,1 > Macmini3,1 > iMac12,2 > iMac9,1 > iMac8,1 > It is reliable and enables FireWire audio interfaces to be used > on modern machines. > Virtualization allows for flexible access to professional audio > software. > > Implementation: > PCI_VENDOR_ID_ATT was reused as they are identical and I am > uncertain it is correct to add another ID for LSI to pci_ids.h. > drivers/pci/quirks.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c > index d797df6e5f3e..a6747e1b86da 100644 > --- a/drivers/pci/quirks.c > +++ b/drivers/pci/quirks.c > @@ -3765,6 +3765,15 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATHEROS, 0x003e, quirk_no_bus_reset); > */ > DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_CAVIUM, 0xa100, quirk_no_bus_reset); > > +/* > + * Using LSI / Agere FW643 with vfio-pci will issue an FLreset, causing > + * a broken link only recoverable by removing power (power-off / > + * suspend + rescan). Prevent this bus reset. > + * With this change, the device can be assigned to VMs with VFIO. > + */ > +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATT, 0x5900, quirk_no_bus_reset); > +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATT, 0x5901, quirk_no_bus_reset); > + > /* > * Some TI KeyStone C667X devices do not support bus/hot reset. The PCIESS > * automatically disables LTSSM when Secondary Bus Reset is received and > -- > 2.43.0 > >