From mboxrd@z Thu Jan 1 00:00:00 1970 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 77D3036604C; Tue, 12 May 2026 18:11:52 +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=1778609512; cv=none; b=ZAeSHlz9hU+k6okzZ67JlOvM3fHw9xJmDhoo8CE5Gw7ULPHplgODPXDHINCa5zC0v7zmVmPc/2AD6nCxDYTYkJi7p/8cUzX20n7BcmXvKPEZRABQ1yIIf00qjPkRTMb90zXeaK1oMDEo87QrVO5VeGEJBb8LIBBI3h09mOtmT04= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778609512; c=relaxed/simple; bh=KRdXcyJfRGIOdxyB7C1GffNqfpOeAxcM2scWyR4kFYE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Yb9MlCeXR3a/ZBT5RRtOhzm3ikvZVlhnGZ9U5DFBBfz35HX/BCn22BDWSvIly85B7qF+8bAyXAwylcjSKtvSjrglqxPg7l5VJlwi+XpmcJT+DPSZtUNIOel3szq6CYyA8o6YpZV4U/FvU4ddq1WYiMXnoui+6xhWxRtiNBm1xvg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ZRJa2yoH; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ZRJa2yoH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E67FC2BCB0; Tue, 12 May 2026 18:11:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1778609512; bh=KRdXcyJfRGIOdxyB7C1GffNqfpOeAxcM2scWyR4kFYE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZRJa2yoHeufZRpb4cyHdG3ZaBOHGkPd8YYbwHfjJez/6dKc9ExChviL7bBdDIwpsz Ok51Gr3+uqBD2w4nSfHPx5F7lEsxbX9rUrhLtcL6yfLylzxHGIK9eK24IZej/SqB/i wnhi3szCGMrfNK7NtBsc/PcN2aI1uRmI7qhAumcg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Lukas Wunner , Bjorn Helgaas , Stefan Roese Subject: [PATCH 7.0 224/307] PCI/AER: Stop ruling out unbound devices as error source Date: Tue, 12 May 2026 19:40:19 +0200 Message-ID: <20260512173944.846041126@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260512173940.117428952@linuxfoundation.org> References: <20260512173940.117428952@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.0-stable review patch. If anyone has any objections, please let me know. ------------------ From: Lukas Wunner commit 1ab4a3c805084d752ec571efc78272295a9f2f74 upstream. When searching for the error source, the AER driver rules out devices whose enable_cnt is zero. This was introduced in 2009 by commit 28eb27cf0839 ("PCI AER: support invalid error source IDs") without providing a rationale. Drivers typically call pci_enable_device() on probe, hence the enable_cnt check essentially filters out unbound devices. At the time of the commit, drivers had to opt in to AER by calling pci_enable_pcie_error_reporting() and so any AER-enabled device could be assumed to be bound to a driver. The check thus made sense because it allowed skipping config space accesses to devices which were known not to be the error source. But since 2022, AER is universally enabled on all devices when they are enumerated, cf. commit f26e58bf6f54 ("PCI/AER: Enable error reporting when AER is native"). Errors may very well be reported by unbound devices, e.g. due to link instability. By ruling them out as error source, errors reported by them are neither logged nor cleared. When they do get bound and another error occurs, the earlier error is reported together with the new error, which may confuse users. Stop doing so. Fixes: f26e58bf6f54 ("PCI/AER: Enable error reporting when AER is native") Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas Reviewed-by: Stefan Roese Cc: stable@vger.kernel.org # v6.0+ Link: https://patch.msgid.link/734338c2e8b669db5a5a3b45d34131b55ffebfca.1774605029.git.lukas@wunner.de Signed-off-by: Greg Kroah-Hartman --- drivers/pci/pcie/aer.c | 2 -- 1 file changed, 2 deletions(-) --- a/drivers/pci/pcie/aer.c +++ b/drivers/pci/pcie/aer.c @@ -1041,8 +1041,6 @@ static bool is_error_source(struct pci_d * 3) There are multiple errors and prior ID comparing fails; * We check AER status registers to find possible reporter. */ - if (atomic_read(&dev->enable_cnt) == 0) - return false; /* Check if AER is enabled */ pcie_capability_read_word(dev, PCI_EXP_DEVCTL, ®16);