Received: by 2002:a05:7412:9c07:b0:fa:6e18:a558 with SMTP id lr7csp776484rdb; Sun, 28 Jan 2024 08:26:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IHSiumkDNj00QOHX5bc3rhpUPAQOLxgHFaiwaunN53go0v6cQlKLUSxPlY9zEnqTG/LcJpy X-Received: by 2002:a17:906:715a:b0:a2d:5256:1df with SMTP id z26-20020a170906715a00b00a2d525601dfmr2888770ejj.24.1706459163457; Sun, 28 Jan 2024 08:26:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706459163; cv=pass; d=google.com; s=arc-20160816; b=rmSLiae093NFQyXqQ3LmtLv0k/JPrgwaN2L0bNUt5D9ryG3peg20dh8azeAxpashbI 1fPldNxEL0+2o2upaTtU07LulMUguidOCPtjNPuHV0uWFb1vOxSpQl/oynCWSiUb1abQ zl5xYKL8RAIKZ4v+TZ/zpzmwdWMgdsy6/FZ71HlTfsKHpDCswFJYgz7Vonk0vX7U19oq e/29EobVwU+UEv4QybvtrIBfkUAoKfbmzVsEfx7qkBITUI8X6eJOMOjLvTPrcawp+VvM qpujs0y0eyRaWvHuefSm4g+ry1la9cQGuVyyeXcQ9oMMASIL7MaSgoJIZfHlyd4JVgeD QuMA== 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=7XcaBbnibu5RPhTdwvImKeAGwDCZO8suG0Vxeo5haA4=; fh=CL/i6CNtiioyJMoUGPrMO+mbdHLTAf2j4y44MtZ8cP0=; b=ZktITpaJGBi8bnvB10E6L6H70AXcU3UE3JB7aKWDQ+slLQrzgA/TQn/BRwSyE1b7yd Azvdt42LChulLjqljcSH/lvh7+XvhMCnatT6iRxzwASLj4OFl8NR8A3BrG+Iac6iHc6x q0cTQGV/I1pxS5XZBmFpCRb+RoNwhsKsuKdi1YJKrC9T4GmOdWP1O1+K1EYOr2zovC/k ToZ9B28tBaFV9VPGvFwnCA9JBgBJBAWweXJaHdhyQOLSZhLPS1fNMEVVTCZKR7Ouqc4T Yi6/2zjWr8wwZMnMaQwV37plT3gTRqNFBfy+4F9o6s4Xkjj/06BkIbcLdhyuyYE1MTMo 1rZg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=psJtnZxF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-41735-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41735-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. [147.75.80.249]) by mx.google.com with ESMTPS id g1-20020a170906394100b00a317234c7f9si2701042eje.894.2024.01.28.08.26.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jan 2024 08:26:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-41735-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=psJtnZxF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-41735-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41735-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 38C151F2A714 for ; Sun, 28 Jan 2024 16:26:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7406A612EC; Sun, 28 Jan 2024 16:13:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="psJtnZxF" 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 8D14660EDC; Sun, 28 Jan 2024 16:13:39 +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=1706458419; cv=none; b=XReZQplTK/u/3yvo/BW0XzilNhCUUnrOBEKrWlDHMiEQqjTlCYXNw4adZ9sgWHP7hUT45WIZ9QogxCONVgHOWvaMmDyRUZLrDG7VP94p9Mbu+VpBkciivdc0lvQZcgGIN6xyXK/lpqZ08rxQpSkJXn54h7+LNNZGc/5XXuDbJdw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706458419; c=relaxed/simple; bh=DWIRCtbLVXByUfR4/XlOy6OuDSTU5emKKZ/hb3zZs+s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gJNZs8I3ZkWfOZmaKTLbFSL0k30uEYOClMedyxKWi92MuGRt4L2MkF+l/ADovSXZALcs+x25YbFjFduw/erfaYsTZurfmolI5xLg2XGnqLLmq+wxdGXm1K77W+X0ylMmK/Q33my8wdmvIH9JXIo9G3FJY2EoiRYkpcFyXQNJA4w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=psJtnZxF; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60DA6C43390; Sun, 28 Jan 2024 16:13:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706458419; bh=DWIRCtbLVXByUfR4/XlOy6OuDSTU5emKKZ/hb3zZs+s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=psJtnZxFCR3TapCsLUVpoxOCLl0sVmDSRjjWz50t16xjR5VAkiOHMsvZMBUC0sU+e 3UYu9Sq6e5YPfJikX2UNd9sWg9YTmfxg51rb2kogFzPTwzC6/MQNfnt65BU0fPDou8 +KZUd32Q0CJpyM9EvvpjlxH7NgdjHUQeO8H7KpxESrNWGfAUU1Ab1Tz99Eqgv/aYyA 9r12EpbWuAU/DCjSICQSjdpFx1nUvuJQsx8YPZzwVuPauLMnVY7yMVE/aIHfZP9jKA gLARJHNo0SgTOnMShHHTla5oyRIXoalqIqzX/ypGG/xlpopFDH6Rzlr43OU6vzv8tc eYdJNv3qNMeEQ== 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.6 14/31] PCI/AER: Decode Requester ID when no error info found Date: Sun, 28 Jan 2024 11:12:44 -0500 Message-ID: <20240128161315.201999-14-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240128161315.201999-1-sashal@kernel.org> References: <20240128161315.201999-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.6.14 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 40d84cb0c601..c9afe4362835 100644 --- a/drivers/pci/pcie/aer.c +++ b/drivers/pci/pcie/aer.c @@ -740,7 +740,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), @@ -928,7 +928,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