Received: by 2002:a05:7412:9c07:b0:fa:6e18:a558 with SMTP id lr7csp782099rdb; Sun, 28 Jan 2024 08:42:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IFDjQlBrcIQPlIA1DcDYu/r1jj8WgO+KH/K6lgpbT64/+Riwqye+DUFoapAzBSvUoWgU57N X-Received: by 2002:a17:906:1844:b0:a31:7f7b:275f with SMTP id w4-20020a170906184400b00a317f7b275fmr2491728eje.48.1706460120685; Sun, 28 Jan 2024 08:42:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706460120; cv=pass; d=google.com; s=arc-20160816; b=ydfbHoklflMoTGjHSg2+FSkbR03/Os5SdnrW/w/nC6VVXnHe2i0h4q8IaP4c3wq3We z+Kt8wwAUEXW6guRf9nBqZ8148JOqT6tCAAjlqDLaAGbratICV2Zvnmp7hAvwY+dHCkK CFQbazEk/FfV/BD2tDes+ohO+WE8spnwbPUC1TE0KVswzBr/jg5RG7OWU7qDX2DKQ4NR T6t+qOKWk0FSSIHR8zbbSXjpcSYiIeTtfSd1gXxw7TnWRU/vg58XOFfXy4KTHYw8EAOh j9EUtN0fiR7TpWZ6YAi0l+DXNF3/BH1ye5axgJNc8PSxAh0dwTiMErR3IcXw9xORnzDX twdQ== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=/zPStUQZkpawmu0WX73Q5GAGVVJF2BXVvNP+ZwffZXk=; fh=CL/i6CNtiioyJMoUGPrMO+mbdHLTAf2j4y44MtZ8cP0=; b=VN9wyPeI7c5/GLRz6uVj9x7/zGtopySQsgJPUChkKUCI9IvWmQXTXMFMSR1fRSgDET opbzGW47PGRIibtiPveZBDKDloEy7OuMA59LOqcBZJb2p769be7tZCoxsI1TXk1i3yh2 mLIzJrJ2kEpjXux02MYGn0PbT3eNgGwtEqe5LI3Rc22P7iZ7lgMTbdcPj+Spx+RQwlcu WYA/COpgdvyoZsP80PkIA8PBppmbmwTZDJI6WKfonasvNPycopg54OtMHNHpVGCPw52b uA1gfZuUta8A5eQ52IRB5SebU7uAicrzimzWcNhEIdVfoD91PMWVxBkHqXwwfDdq3m99 Pdaw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Va9lCwBI; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-41767-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41767-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id gu20-20020a170906f29400b00a34b277fea1si2617833ejb.380.2024.01.28.08.42.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jan 2024 08:42:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-41767-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Va9lCwBI; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-41767-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41767-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 5F0381F220C6 for ; Sun, 28 Jan 2024 16:34:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5AC83745CA; Sun, 28 Jan 2024 16:14:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Va9lCwBI" 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 5BD8D6EB66; Sun, 28 Jan 2024 16:14:46 +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=1706458486; cv=none; b=ASSdwqq/dS8C2u1B1Vi+AQHPxsIQvOka/dMcC10Ic+nv9Ke1oHT2zUUepFNZz0V8n8ROcDeamX60O9XMwcaDOuW0+sJdO03vM3XFqJMplkke8hKcdPxRHVjo3KIpGLGimCRnFi/uCGQmFIE2Aj1F250A+G+zNqtBLSBs7hLc89A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706458486; c=relaxed/simple; bh=7Oc7XQZw0BQgE7vpQeYLErcpNOAZHMGGgfcBbkIJeDE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=L1luvTwUBotib3X+sHcNXwCJvwfYcl1HAkawH7MZArun740wwNapXGclN/tZg1twX42ZDYBL/Fkzz/+A3HA+/SyvFQ/qQ8iHHFigZL+3E5pC+SQCimQBx7dJg/D9bYKwyaJR9cQXx1V9eXlcSyLcdxg4rPltgDkS2K86VVlzNps= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Va9lCwBI; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB3FFC433C7; Sun, 28 Jan 2024 16:14:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706458485; bh=7Oc7XQZw0BQgE7vpQeYLErcpNOAZHMGGgfcBbkIJeDE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Va9lCwBIIFEK8Wjzgae8HaljqSkHWgy/Ma9zzXoES1GmZH4rRLjjZzZ+7+FSiqBvK X5Ypt/CMBm9OvZRhytTqxKr5NNtC7lqL6k55/eeSLMCgYS6O+kbpvY9ytRGECIX7L8 dHA8cwYU1Xotqq7Cgm2b82B961hzlPgjLG5PYToVDmMM77JWNGT2n/RGECOOtf2uEz SNPRM7NeH7Ac08dscE14dUWsKCoJbwP0aShPYVIzq53RFA6mhleH/3beyOaVX76w3c fCoBP8CxHVw4cKG32bsRJde1RhTr6WaGtx6kSg+c8KjPEYjenVKWtAT1xIErD5yTAg WwoZCNBVCUK6Q== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Bjorn Helgaas , Jonathan Cameron , Kuppuswamy Sathyanarayanan , Sasha Levin , mahesh@linux.ibm.com, linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org Subject: [PATCH AUTOSEL 6.1 12/27] PCI/AER: Decode Requester ID when no error info found Date: Sun, 28 Jan 2024 11:13:57 -0500 Message-ID: <20240128161424.203600-12-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240128161424.203600-1-sashal@kernel.org> References: <20240128161424.203600-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.1.75 Content-Transfer-Encoding: 8bit From: Bjorn Helgaas [ Upstream commit 1291b716bbf969e101d517bfb8ba18d958f758b8 ] When a device with AER detects an error, it logs error information in its own AER Error Status registers. It may send an Error Message to the Root Port (RCEC in the case of an RCiEP), which logs the fact that an Error Message was received (Root Error Status) and the Requester ID of the message source (Error Source Identification). aer_print_port_info() prints the Requester ID from the Root Port Error Source in the usual Linux "bb:dd.f" format, but when find_source_device() finds no error details in the hierarchy below the Root Port, it printed the raw Requester ID without decoding it. Decode the Requester ID in the usual Linux format so it matches other messages. Sample message changes: - pcieport 0000:00:1c.5: AER: Correctable error received: 0000:00:1c.5 - pcieport 0000:00:1c.5: AER: can't find device of ID00e5 + pcieport 0000:00:1c.5: AER: Correctable error message received from 0000:00:1c.5 + pcieport 0000:00:1c.5: AER: found no error details for 0000:00:1c.5 Link: https://lore.kernel.org/r/20231206224231.732765-3-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Reviewed-by: Jonathan Cameron Reviewed-by: Kuppuswamy Sathyanarayanan Signed-off-by: Sasha Levin --- drivers/pci/pcie/aer.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c index e2d8a74f83c3..5426f450ce91 100644 --- a/drivers/pci/pcie/aer.c +++ b/drivers/pci/pcie/aer.c @@ -748,7 +748,7 @@ static void aer_print_port_info(struct pci_dev *dev, struct aer_err_info *info) u8 bus = info->id >> 8; u8 devfn = info->id & 0xff; - pci_info(dev, "%s%s error received: %04x:%02x:%02x.%d\n", + pci_info(dev, "%s%s error message received from %04x:%02x:%02x.%d\n", info->multi_error_valid ? "Multiple " : "", aer_error_severity_string[info->severity], pci_domain_nr(dev->bus), bus, PCI_SLOT(devfn), @@ -936,7 +936,12 @@ static bool find_source_device(struct pci_dev *parent, pci_walk_bus(parent->subordinate, find_device_iter, e_info); if (!e_info->error_dev_num) { - pci_info(parent, "can't find device of ID%04x\n", e_info->id); + u8 bus = e_info->id >> 8; + u8 devfn = e_info->id & 0xff; + + pci_info(parent, "found no error details for %04x:%02x:%02x.%d\n", + pci_domain_nr(parent->bus), bus, PCI_SLOT(devfn), + PCI_FUNC(devfn)); return false; } return true; -- 2.43.0