Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2428945rdd; Fri, 12 Jan 2024 09:06:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IEyCCkfekYkBocuRBKberC65wKrK8+FnbT56+jXTKIuV29RFjTDQEjLKWZYsWhel/vGg31F X-Received: by 2002:a17:902:da8f:b0:1d4:4779:dfd7 with SMTP id j15-20020a170902da8f00b001d44779dfd7mr1234036plx.20.1705079203243; Fri, 12 Jan 2024 09:06:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705079203; cv=none; d=google.com; s=arc-20160816; b=oKbfM5cgKmwdCUQAwQjTs6aQc0JYOaYPhAtQau3pNWsxJFH2/seHXPZkWp93MjLkry uWU3xzXwwEl98WYLmLcJkJ9yZ2aE68OkbEn1lqazkn+60A9aZFn6GELH6Hkl/hxE9eym L8oxf3kLFtwyOXweezWiQvJ30Lmte4NoyOzl/cMUmEwGpQotanr2lE7S0Gux2N+xksYG sKba/ZeRzmlkaedf7Te4O8RwyusV0z6K6d4kMi+7lZFUQNGq8F9DhLQDQjp3bkpNgq4L ihU2ySK37rIjYAyAiVo1xhyQkZGMUKwU2IjYTXp0zohB8U+kkNtXfDfwn4ml1MVDLNXt RzJg== ARC-Message-Signature: i=1; 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=X6KMcdZKSKELE+omxrFSNIZuTzSWGNlw+QWzDZURCs8=; fh=wLbxXZwcVhddDl8ei+ay4UEh5CUxYykHGJULUcQIgmI=; b=B8UiNNPGwsM+ElSYqL2BUNPIVZkhBzRznBL4Mahqqh+X++Ot3FugXF6Sb6cWMHzFo0 AdRE7/7Gnz2H4lnNLGQTKJd7J1ztV3mXRYHp3YgLhWk8u0Bo9tsyI7ccv7ZvtJ6h8fWk TRKWEXmLeXpboNlocNQHUFI6oZrSbp+UJjMOEIDpyxLxsmfLXpOd8j50qS6qNV6m+1Cr 4ufG8RW7+GIkrOkXrgqIOmstU6pGvzt6rGjCrBx1l4pVeLHJc2/3ePpwpTHesnmGhrUj rvjIiYByAFakCNt08noSaPMw3xXg0z7VGAxOFFKOVq0c2oCbWpuU5ubhGJ71TOfEDM6t RM8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Y/zzcq8E"; spf=pass (google.com: domain of linux-kernel+bounces-24885-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24885-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id f1-20020a17090274c100b001d5ad9a8e4bsi778562plt.489.2024.01.12.09.06.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 09:06:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24885-linux.lists.archive=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=@kernel.org header.s=k20201202 header.b="Y/zzcq8E"; spf=pass (google.com: domain of linux-kernel+bounces-24885-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24885-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 5D166283398 for ; Fri, 12 Jan 2024 17:06:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DCAC41B5B3; Fri, 12 Jan 2024 17:06:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Y/zzcq8E" 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 1B72117C78; Fri, 12 Jan 2024 17:06:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58747C433F1; Fri, 12 Jan 2024 17:06:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705079184; bh=ChOHcFdSRNFjvK3N8OYYhuCgtYXFpkTyeUTD5QgblIA=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=Y/zzcq8EM1YES3DPDYMNeuSgyTK4ElDmYRAE6AbLqPcpzI0xKRqZtpTbd5s5JwYeS 93waMWxV8pcyAlzlU9+/kgh2wPTk6U9cNDuLFEFRFU/01mLjboHttb9ID1F9AFWGUm T8849i4Ep4lio4qhfYZ+VYpyqS4YtcL8nzMNYxhqoznesU0ZW2n6j7ySLCzdqYIpBp XSLixugrSd89EfkOFvKAWYgeZrkjQbdTCvCs8K9ZhNEKA9nDoqniS038QxkmkoIcxk IlK+jG9xfNzJGKl2MZMEjlHZgsg4zOOzoAyZNyGymByfgjPI4LaSdd5yvMKX7MiMue zGFJfuW2kb1tA== Date: Fri, 12 Jan 2024 11:06:22 -0600 From: Bjorn Helgaas To: Vidya Sagar Cc: bhelgaas@google.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, treding@nvidia.com, jonathanh@nvidia.com, kthota@nvidia.com, mmaddireddy@nvidia.com, sagar.tv@gmail.com Subject: Re: [PATCH V1] PCI: Clear errors logged in Secondary Status Register Message-ID: <20240112170622.GA2272469@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: <20240104013229.693041-1-vidyas@nvidia.com> On Thu, Jan 04, 2024 at 07:02:29AM +0530, Vidya Sagar wrote: > If a downstream port has a PCIe switch connected to it, the enumeration > process leaves the 'Received Master Abort' bit set in the Secondary > Status Register of the downstream port because of the Unsupported > Requests (URs) take place in the downstream hierarchy. Since the > ownership of Secondary Status Register always lies with the OS including > systems with Firmware-First approach for error handling[1], clear the > error status bits in the Secondary Status Register post enumeration. I would expect these URs to happen when enumerating below *all* PCIe Root Ports (not just when switches are present), and Master Aborts should happen in conventional PCI. Similarly, I don't think Firmware-First is relevant here. Only the fact that the OS owns PCI_SEC_STATUS because there's no mechanism to negotiate for platform ownership of it. We're in the merge window right now, so we'll start merging v6.9 material after v6.8-rc1 is tagged. > [1] https://lore.kernel.org/all/1fb9d746-0695-4d19-af98-f442f31cd464@nvidia.com/T/ > > Signed-off-by: Vidya Sagar > --- > drivers/pci/probe.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c > index 43159965e09e..edf8202465d8 100644 > --- a/drivers/pci/probe.c > +++ b/drivers/pci/probe.c > @@ -1470,6 +1470,9 @@ static int pci_scan_bridge_extend(struct pci_bus *bus, struct pci_dev *dev, > } > > out: > + /* Clear errors in the Secondary Status Register */ > + pci_write_config_word(dev, PCI_SEC_STATUS, 0xffff); > + > pci_write_config_word(dev, PCI_BRIDGE_CONTROL, bctl); > > pm_runtime_put(&dev->dev); > -- > 2.25.1 >