From patchwork Tue Feb 27 13:14:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edmund Raile X-Patchwork-Id: 207216 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp2689361dyb; Tue, 27 Feb 2024 05:20:36 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUK92hxvmf1qIy6MjzBhfsdcVYFhG8irucFd3fn8P9VRAlZHG6rxc+SRGCRl8XjOxvLQh0elPe37AHjXNLdV12q4PS9og== X-Google-Smtp-Source: AGHT+IGePZHXajcmt9ZD9kf8k6Y/nntQrEWe06j+vH7Q8WGuzYbiiXoyPUZqK3MR6kYYGlg31YHX X-Received: by 2002:a17:902:e806:b0:1dc:5ad6:b6e4 with SMTP id u6-20020a170902e80600b001dc5ad6b6e4mr11790008plg.4.1709040035997; Tue, 27 Feb 2024 05:20:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709040035; cv=pass; d=google.com; s=arc-20160816; b=LJEMz4euhc3pIgcnLQHQJ/4yCfxcAkv4ExTnfmU4gSfS7C/L+22c4KUyNVahtbsJSD 6BziLvdE4T6ZBjCbkVUqHRDygqyf/ivzwcXScmaNmcigfLE8blYEigW2TqiMtPbrWzqD XOIfTztWj4LnsrUDXOMesUhq6sJX4IQmbJCFxi1DL+46/xopWXf/NDkd4zEfH7ZUhd3h 6so8YV5O10nBzR7FZPDJcLN5PBmlWG0xBMLMnRrbYpK/59TYtVjIply4hK1H1VKg2MQl XUQwHrBNqZubCFMLSMZmw44HbTgaHB3wEEqda9CIQwufGfby1GrAONdYFJjumzWCKdsT tHGg== 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:references :in-reply-to:message-id:subject:cc:from:to:date:dkim-signature; bh=ZrJU4qMFbvDi4ufPStPJLjmeabfKg0P/vMjlkrx7MbI=; fh=Lny2uLYIIK2MzedNd74r3Nmz4M55LndQH/0QeFjuVgY=; b=FhZXEv0tXir1hc7IWXXq0blGs+WAsRWq2UyOn/Jo3rNRYchmQTYHo2wkNIaYntswIV hBHSdmtfr0oJ7CpVaqOdC0dLVMjIYG7nr4f37TywdNF6Akg2gsV5HGn9oGZmZRKNk+J1 lQU2uBTvZpHf7Mg9dfL1Sk5VlQ13wDADOyujpeVItfNyCpjaiF4yuhLLlYyqdyiHWcBk s0ehCA+bqR8rb6nz1jENvYA5d15rVJ89A4f53Uhsobo24wDTyF3fj4rSPnU7tS17+Bhj jOEs9jbW7Y3lNRre+H5fnVQCipIZu6I0wYZJcEESb5IhXyDwoHJ5L6+ureIH+QgkUPrT 3/VQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@proton.me header.s=zndwy7274ndljkwkfrt7ypvhmq.protonmail header.b=S5fE3bH+; 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-83295-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83295-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id q3-20020a170902eb8300b001dc07b60355si1388115plg.15.2024.02.27.05.20.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 05:20:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83295-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@proton.me header.s=zndwy7274ndljkwkfrt7ypvhmq.protonmail header.b=S5fE3bH+; 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-83295-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83295-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 347362900C9 for ; Tue, 27 Feb 2024 13:15:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4D96713B2A9; Tue, 27 Feb 2024 13:14:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b="S5fE3bH+" Received: from mail-0301.mail-europe.com (mail-0301.mail-europe.com [188.165.51.139]) (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 C00351EB25 for ; Tue, 27 Feb 2024 13:14:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=188.165.51.139 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709039685; cv=none; b=P0nJ7yPiMdzO2YTqaDOHoeVVb9YQCvFi2q+uF0nxG+Unm7rsg5yZFrLdxQ8ujZ1foBGTiHCFE/JjFdDFhIcNsSbF95F8vagu0xEgzgdOiNn8YxcrDH2YAXhrwm3sewTU4qGqeG0WDjnmf/DY6QIGBy/49bGFREqh4Y1UXucWr5c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709039685; c=relaxed/simple; bh=rx8PCE5o6dFMSFR8vi+L7kexPHd420uWKw7zhq26y8s=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Svk6F6GlUxFBCsRvOTtqFpck7VXNO7qgN3Kdh6h0NK5FaTY0+zC3o6SCA64AD712+3zDfbBSHfG2lNEY7tXuzH8+oSHiGQ2W9U1+kX50sywNh5oUQgl205aBJ5BqfXRt6hGqtU5MWWFPOqe+viDwjn6C8XbeOX6vpDxPkBEEaio= 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=S5fE3bH+; arc=none smtp.client-ip=188.165.51.139 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=zndwy7274ndljkwkfrt7ypvhmq.protonmail; t=1709039667; x=1709298867; bh=ZrJU4qMFbvDi4ufPStPJLjmeabfKg0P/vMjlkrx7MbI=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=S5fE3bH+wdw2Dmpb8pSzPkeRDwJKlQqvoxzNGJVm5vMlgEjNnzy82BG5ydEem2Au3 eMaciU8io8jQmN2q81+g1i9hP8NPodDaY2JAe2GsjomLnTerwN5Kj27BLRIOoWooO2 2WSLxmm2l5pm3zxQRqlKvqbzIEK5GF3HlkerWh33RQJPWv8IRMQmEHVhVvEAxIf2sY OQ/YkcpQTHvEAWyYbM1G3nC2FkDCpXNe5aCIo5Q3fv5t6HkuSmL6hZsJi69Mu6sG4n FQKE3vjDU7ywCH2ak1YTH69L27DMdpFpucSjm8KcYMi8s0FP0HN+dxcf+zANImDNG8 Tz5KlKlfKdV7Q== Date: Tue, 27 Feb 2024 13:14:18 +0000 To: helgaas@kernel.org From: Edmund Raile Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Edmund Raile Subject: [PATCH v2] PCI: Mark LSI FW643 to avoid bus reset Message-ID: <20240227131401.17913-1-edmund.raile@proton.me> In-Reply-To: <20240226102354.86757-1-edmund.raile@proton.me> References: <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: 1792058365073875313 Using LSI / Agere FW643 with vfio-pci will exhaust all pci_reset_fn_methods, the bus reset at the end causes 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. Note that it will not be reset, resulting in leaking state between VMs and host. Signed-off-by: Edmund Raile --- I sincerely thank you for your patience and explaining the background of pci resets which I lacked. The commit message and comment now describe it correctly. The comment on leaking states was added. 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 is reliable and enables FireWire audio interfaces to be used on modern machines. Virtualization allows for flexible access to professional audio software. It has been used in at least the following Apple machines: MacBookPro10,1 MacBookPro9,2 MacBookPro6,2 MacBookPro5,1 Macmini6,1 Macmini3,1 iMac12,2 iMac9,1 iMac8,1 Implementation: PCI_VENDOR_ID_ATT was reused as they are identical. drivers/pci/quirks.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index d797df6e5f3e..e0e4ad9e6d50 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -3765,6 +3765,19 @@ 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 exhaust all + * pci_reset_fn_methods, the bus reset at the end causes 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. + * Note that it will not be reset, resulting in leaking state between VMs + * and host. + */ +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