Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1652909rdb; Mon, 8 Jan 2024 06:19:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IFBh11u7x2lmIwIx2O8KhGsXIo2l0XrAvnSiQ9b9/Z440KceHUP16UawvvZjjLSTmAW+CJK X-Received: by 2002:a17:90a:c392:b0:28c:825e:2cf4 with SMTP id h18-20020a17090ac39200b0028c825e2cf4mr1825600pjt.41.1704723565869; Mon, 08 Jan 2024 06:19:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704723565; cv=none; d=google.com; s=arc-20160816; b=M1oh3zyE36bjTAgh9rMjFZJFd1p0w+8tT74uVLMYaSMDtLRUkqZgwAYkDysIgc+opj PyfgB/86utx4FAZh/D3u5zqnsX1KgiTKO/J3OOaDlojtFpb8fDatC+FjLesnD+V3Xci0 cusgK8sqgoOgvlH4fI71QE+Kjy9B/OI3Ln0pr1ltzP0THt0HxxGiQnk2E58ARaHXFjOw r6iQY5AAm9UF1huA/sW+Oocm/y5cIzTEvaciZO8piXZ+vt81GsW3ICFCO1C3+Hls47e9 fkVfrLlb5a6czpoaX87lvL/ZqK4e5xoV8K2WJuVft8AT7L4OfwYIWLe+TlmguUshJFcT G8TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=hL5vcNokoN8EvrbWKtm3VJpmq+dFZ0zacErpIYU+Zuo=; fh=0E/hMay0J5k9agk8WzIkmGTG9IiVB3P1F680TiBzPPs=; b=N7Vq4hDW50qJ7CvfS2MPSHuV0zLCdJH8lrEA6hSi4wBvpS8WlpqCpWz+OdCpTZ6IS5 LoI3p/m4LNyKH5FiGJwxfsqyyF5bG763Vt8GLnOKQL9226VJgalmPD79LgShPnOFdj1n Tc44lFEzHcoU0PDX3bQvLblL+bItwbpYfPEiWdn1EhsmsjA8+jHlGwpF/3OD4qS7UplF Jn0p5g2m66RIFhZ1zy92Cya0wOFIiBSV/eDFNd475rTCTqCG+A7bn2AzBuFilZSpwwXY KJuKfGWtN1ogKpY8JDLkPv/b8ezVjbWTuqhrkjFPZU9FTdUUauY89m8SIYOvSfP3I2Vq OcXA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-19688-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19688-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id c17-20020a17090abf1100b0028c03cee45dsi5587917pjs.68.2024.01.08.06.19.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 06:19:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-19688-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-19688-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19688-linux.lists.archive=gmail.com@vger.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 3A270B21E19 for ; Mon, 8 Jan 2024 14:19:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 307B84643E; Mon, 8 Jan 2024 14:19:13 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from bmailout1.hostsharing.net (bmailout1.hostsharing.net [83.223.95.100]) (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 EC2C347775; Mon, 8 Jan 2024 14:19:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wunner.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=h08.hostsharing.net Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL TLS RSA CA G1" (verified OK)) by bmailout1.hostsharing.net (Postfix) with ESMTPS id 8267530000D0D; Mon, 8 Jan 2024 15:19:01 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 65AA919453; Mon, 8 Jan 2024 15:19:01 +0100 (CET) Date: Mon, 8 Jan 2024 15:19:01 +0100 From: Lukas Wunner To: Vidya Sagar Cc: bhelgaas@google.com, alex.williamson@redhat.com, treding@nvidia.com, jonathanh@nvidia.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, vsethi@nvidia.com, kthota@nvidia.com, mmaddireddy@nvidia.com, sagar.tv@gmail.com Subject: Re: [PATCH V3] PCI: pciehp: Disable ACS Source Validation during hot-remove Message-ID: <20240108141901.GA17779@wunner.de> References: <20230111190533.29979-1-vidyas@nvidia.com> <20230730191519.3124390-1-vidyas@nvidia.com> <20230730194026.GA19962@wunner.de> <7880aa6e-9fc5-c026-138f-42bef3c48b69@nvidia.com> <20230731195930.GA13000@wunner.de> 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: User-Agent: Mutt/1.10.1 (2018-07-13) On Thu, Jan 04, 2024 at 08:01:06PM +0530, Vidya Sagar wrote: > On 8/1/2023 1:29 AM, Lukas Wunner wrote: > > As an alternative to disabling ACS, have you explored masking ACS > > Violations (PCI_ERR_UNC_ACSV) upon de-enumeration of a device and > > unmasking them after assignment of a bus number? > > I explored this option and it seemed to work as expected. But, the issue > is that this works only if the AER registers are owned by the OS. If the > AER registers are owned by the firmware (i.e. Firmware-First approach of > handling the errors), OS is not supposed to access the AER registers and > there is no indication from the OS to the firmware as to when the > enumeration is completed and time is apt to unmask the ACSViolation > errors in the AER's Uncorrectable Error Mask register. > Any thoughts on accommodating the Firmware-First approach also? Are you actually using firmware-controlled AER or is it a theoretical question? PCI Firmware Spec r3.3 sec 4.6.12 talks about a _DSM to disable DPC on surprise-hotplug-capable ports. Maybe that would be an option? BTW what happens if the system resumes from sleep and a device in a hotplug-capable port doesn't have a bus number configured yet (because it's been powered off and is now in D0uninitialized state)? Could the ACS Violations then occur as well? Do we have to mask ACS Violations *generally* on Root Ports and Downstream Ports when going to system sleep and unmask them after setting a bus number in the attached device on resume? And I suppose that would not only be necessary for hotplug ports? Thanks, Lukas