From patchwork Mon Feb 26 10:25:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edmund Raile X-Patchwork-Id: 206558 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1991357dyb; Mon, 26 Feb 2024 02:54:48 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWuAMqq9lh+ugt7CK88cIzi3iGMZMbRejF64s3/o34GFfu/9+tNPzy6+hSzbco9OQ8pECoIPlDOTNFykYKPjjZM+F0o3Q== X-Google-Smtp-Source: AGHT+IGtxbrySd51PjDYZF8daLFcrqforY64aHi8w4DCct7qBKXZWDOILYlB+ShVT+zpN9+ktaTe X-Received: by 2002:a05:6a20:a220:b0:19e:c9ad:68be with SMTP id u32-20020a056a20a22000b0019ec9ad68bemr3472268pzk.43.1708944888387; Mon, 26 Feb 2024 02:54:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708944888; cv=pass; d=google.com; s=arc-20160816; b=gmiJqXfqWUdv70wPsheivmrDbS754Tn+EQaYyjjIg3FBGX6XdWYsSFGBh5e08QtJ/O 4zQtFyl16zwzWqRORGzRILL3nKZmSyrx4rjb8MTIxRpDxjqqj8YF1tDH8DhCg6WcDaZq QZv9xd60YcYzPOfMdjX/POmVYtF/QDb6oaem07hERm7AfG00jTSyHVD47IoQlOXj4OQH vlyR96OrICzQUtwqli0qXZqH/H30vpctKShpU+YRAfzfs4LPYD8i26MYa6lLiQAAuyM+ yg4oddtv9OkyFO0vzOc9/pn+j9Xt0jMK+uivnm7eBUPpqWGmgcZyl5uOiAmGhgYrnlB8 iP+g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:feedback-id:message-id:subject:cc :from:to:date:dkim-signature; bh=hvFaazzaDjEhKYnLhgusyXuDE9SwR0SnEtKd0g5cI2w=; fh=7PDzx4RycOH0C6DFauvV4iGQq70q2TFhHMPOcUprXMc=; b=q8rh0jx3Ly2lY/tLgCUoOy+VDsXdwQ9u+iiazKte1C0VcXHNgA93IDSB3cgzKLiQPS dzA/D7U1cNJG676Fpg7v8oN7RPk3EbsvUNu7Q10P0nxJYnoNFXprksn30+YmkjhDj9kJ tYl1+35BmEbi+R4GyrxA6KFFRDjuPXqWsDIRxCgudOD9PX8Tn/KAhw6mRDnvysr0Cmuv hRrcKmDIXtDBJ1Avbm8t3SkE1lMkqAUKleG+XusIVoQL0R7QF52c3SKfj4CDdkGaaIA6 3oDP/euWV8sT6NxryUYdRJsRJE48now9GVao0uCjZMr6P0sZwoHQLm5aGoD+oLBEZrkX hfHw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@proton.me header.s=vdsavk55ifat5gl55bl7736lum.protonmail header.b=IkhqcI4k; arc=pass (i=1 spf=pass spfdomain=proton.me dkim=pass dkdomain=proton.me dmarc=pass fromdomain=proton.me); spf=pass (google.com: domain of linux-kernel+bounces-81158-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81158-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=proton.me Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 186-20020a6300c3000000b005d8e38097f8si3484389pga.265.2024.02.26.02.54.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 02:54:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81158-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@proton.me header.s=vdsavk55ifat5gl55bl7736lum.protonmail header.b=IkhqcI4k; arc=pass (i=1 spf=pass spfdomain=proton.me dkim=pass dkdomain=proton.me dmarc=pass fromdomain=proton.me); spf=pass (google.com: domain of linux-kernel+bounces-81158-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81158-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=proton.me 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 6E82F28820F for ; Mon, 26 Feb 2024 10:35:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 308BE4F8A0; Mon, 26 Feb 2024 10:25:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b="IkhqcI4k" Received: from mail-4319.protonmail.ch (mail-4319.protonmail.ch [185.70.43.19]) (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 47A5525634; Mon, 26 Feb 2024 10:25:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.43.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708943143; cv=none; b=DGxz0T7m0SO2XZQhRQMZEF3sXE/kfQKnLUeOljAaFoPManUVDm3Guo/PIFlRp70sXvRJrwfgXYMMIThmFNidb8llKl52dUZ6JU1dBaDW/Qom9vRmTqWxu9iesglZj96GmKgRyGX09Z5YC+LC1cBbMO4qvwhaAfefuk+BmaDMNUM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708943143; c=relaxed/simple; bh=FB9E9JyNIVEQ3zPi5pRp1wKuBvGQBRAGlYj3fhsP/j0=; h=Date:To:From:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=l6gwQBpi5QLPF17ZbU7KmZDTI7HdkWzS8Jsxop1Ll/cYSsQy1OuvDC012L6AIEXAkGd6UlSiWCEkwZI9x/5Sn0X8Y09JMP5GW5g/49lavr+Z1w+ihJtuaeVLU37GXYeM8fDUwOtWPsxcSu4nU2RQWAnoHPbtk2T4glLBZL0Uo5E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me; spf=pass smtp.mailfrom=proton.me; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b=IkhqcI4k; arc=none smtp.client-ip=185.70.43.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=proton.me DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=vdsavk55ifat5gl55bl7736lum.protonmail; t=1708943133; x=1709202333; bh=hvFaazzaDjEhKYnLhgusyXuDE9SwR0SnEtKd0g5cI2w=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=IkhqcI4kDYcn9GN5/V9oh3ebZ9f4hJ/d2RaIUInChPoCxCblvoyZ7Zkxy0v/yi7MU 6fJg/T+O/CREAppqWvdCCYLL+NMXX7ilsxJNXqTWgN1b5XDsV4w25qktJRgI/VkMUH cwXd8JNgfpt7e73Gju7Cp10TGceZHiEGiEn28ZchWIGljboTZcZjy7fWlEj6DdKXw4 X2y7UyGg9EqLdhcRWKxZ65TM5A56sH9cjkFYk1Pja6HbRExQobDDaKzzEzAU7CWj7o 1WGijrHxmf4awf7TkbT/lq9kl092Vi4ky+EtPBK5z9k/nsTviF8WiTTX0aROJ1XSzS CZqGt3mw8VEAA== Date: Mon, 26 Feb 2024 10:25:12 +0000 To: bhelgaas@google.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org From: Edmund Raile Cc: Edmund Raile Subject: [PATCH] PCI: Mark LSI FW643 to avoid bus reset Message-ID: <20240226102354.86757-1-edmund.raile@proton.me> Feedback-ID: 45198251:user:proton Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791958595599212334 X-GMAIL-MSGID: 1791958595599212334 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. 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