From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1836BC2D0CD for ; Wed, 21 May 2025 19:23:59 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4b2hDY4VPxz3btJ; Thu, 22 May 2025 05:23:57 +1000 (AEST) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip="2600:3c04:e001:324:0:1991:8:25" ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1747855437; cv=none; b=Un7XcAzH+tkfSSBist//XIfOgA0K6YqxtwQp0ZxgnTsZeazDfRMWSqON5im+bkYFT1ACs5VPAdCuAEko1ebF4RumuMRMMnjCgpNNyorPmHpGftQXJmlIG88YoxzfLlmSrVj7v1p42OdSEI8/ovg4BTXloXps5+FAPDq5aY+ajDqwuo7dy/SntOxfXZDIzd5X7OrNE30hmIQ8OM1y4CulxkE+BoDlzsFCZcF+5bw+Cz5d7BWH+B5DKpQiJKCCQLcZBn6COQad7f+iCeUyVX6ZN41JtXQN/lL0UtBNjKIV/iExAorRSfcd1cRKJvL0pMBmUp/455QxlJF35nmN0d9HuQ== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1747855437; c=relaxed/relaxed; bh=nvMhPCNArjuYh9XsSY/VRs8qHQyJwWhmmiS4kqOWn9U=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=HK/aIesK+8+spUzz1B/aOhxAMCU5jewEbOMrYSp3oTET/wKx6tHfqOh1Ll2fsDOEcS25UOy2y76YhvFbkoCL7SKHZB67lbTuAo2zqTaLf6b+74tB6Nz6ugR89YC/peAUvqMDxaQk+agl30EV1B+lWvWcPpjp7SAo2EMzNZqe+GEYfUdJnGz34jrHUFWLxwGXrN6kVH5bgls5A+2Z5DGMhZpIGErgaypPylhi2lSavnvDUH1eSGolaZ6BWl+AYlGg2ufQg/DkE89RmuiEDsYkj0hSuAensIoxadWfip1wn3pxAlHibwnMGqcXLzyl1wWO15vgBAJJJFZWrgK9On+GqQ== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=Ix0Hjd6V; dkim-atps=neutral; spf=pass (client-ip=2600:3c04:e001:324:0:1991:8:25; helo=tor.source.kernel.org; envelope-from=helgaas@kernel.org; receiver=lists.ozlabs.org) smtp.mailfrom=kernel.org Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=Ix0Hjd6V; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=2600:3c04:e001:324:0:1991:8:25; helo=tor.source.kernel.org; envelope-from=helgaas@kernel.org; receiver=lists.ozlabs.org) Received: from tor.source.kernel.org (tor.source.kernel.org [IPv6:2600:3c04:e001:324:0:1991:8:25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4b2hDX5V6Nz2xd3 for ; Thu, 22 May 2025 05:23:56 +1000 (AEST) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id A8FC2629F1; Wed, 21 May 2025 19:23:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29530C4CEE4; Wed, 21 May 2025 19:23:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1747855434; bh=x7SU6M9EiUqm3oCZdiOBIeMXoijnsJiejNFd+jPSSMc=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=Ix0Hjd6V1tx7KT5m6va1h0PDbofHGDHqXg8V7tyNqlwUs2SN7+1SUzlq6WqxYUK3n Y0tNStRGPFzn3dbbIvkfZmgdo5Z/7NRBsMJdIZ/wYzDnjbYWG8hwysgv1lxLMgk+sK 9EQxQy1UMIy9XBxaKH5/0Hf7GAFkxpUO3uvXiAd7AcpuY10uxrfkHafU7YUaZTN137 5Z8caXYvQebeBl/TVEU5w0gRMrBIqDeFamINoGn4dvFv+ZUUj0A+Lq3BIjoPC1VOwA fgG5xBra7M6bxg1bZ3l5deHZpQCYIFhjHBQe02WK++ej1oZ2WqvKuG7we9YLRBctWv KTCJJzLwrJ5JA== Date: Wed, 21 May 2025 14:23:52 -0500 From: Bjorn Helgaas To: Jonathan Cameron Cc: linux-pci@vger.kernel.org, Jon Pan-Doh , Karolina Stolarek , Weinan Liu , Martin Petersen , Ben Fuller , Drew Walton , Anil Agrawal , Tony Luck , Ilpo =?utf-8?B?SsOkcnZpbmVu?= , Sathyanarayanan Kuppuswamy , Lukas Wunner , Sargun Dhillon , "Paul E . McKenney" , Mahesh J Salgaonkar , Oliver O'Halloran , Kai-Heng Feng , Keith Busch , Robert Richter , Terry Bowman , Shiju Jose , Dave Jiang , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Bjorn Helgaas , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= Subject: Re: [PATCH v7 02/17] PCI/DPC: Log Error Source ID only when valid Message-ID: <20250521192352.GA1430719@bhelgaas> X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20250521100035.0000544e@huawei.com> On Wed, May 21, 2025 at 10:00:35AM +0100, Jonathan Cameron wrote: > On Tue, 20 May 2025 16:50:19 -0500 > Bjorn Helgaas wrote: > > > From: Bjorn Helgaas > > > > DPC Error Source ID is only valid when the DPC Trigger Reason indicates > > that DPC was triggered due to reception of an ERR_NONFATAL or ERR_FATAL > > Message (PCIe r6.0, sec 7.9.14.5). > > > > When DPC was triggered by ERR_NONFATAL (PCI_EXP_DPC_STATUS_TRIGGER_RSN_NFE) > > or ERR_FATAL (PCI_EXP_DPC_STATUS_TRIGGER_RSN_FE) from a downstream device, > > log the Error Source ID (decoded into domain/bus/device/function). Don't > > print the source otherwise, since it's not valid. > > > > For DPC trigger due to reception of ERR_NONFATAL or ERR_FATAL, the dmesg > > logging changes: > > > > - pci 0000:00:01.0: DPC: containment event, status:0x000d source:0x0200 > > - pci 0000:00:01.0: DPC: ERR_FATAL detected > > + pci 0000:00:01.0: DPC: containment event, status:0x000d, ERR_FATAL received from 0000:02:00.0 > > > > and when DPC triggered for other reasons, where DPC Error Source ID is > > undefined, e.g., unmasked uncorrectable error: > > > > - pci 0000:00:01.0: DPC: containment event, status:0x0009 source:0x0200 > > - pci 0000:00:01.0: DPC: unmasked uncorrectable error detected > > + pci 0000:00:01.0: DPC: containment event, status:0x0009: unmasked uncorrectable error detected > > > > Previously the "containment event" message was at KERN_INFO and the > > "%s detected" message was at KERN_WARNING. Now the single message is at > > KERN_WARNING. > > > > Signed-off-by: Bjorn Helgaas > > Tested-by: Krzysztof WilczyƄski > > Reviewed-by: Kuppuswamy Sathyanarayanan > Matches the spec conditions as far as I can tell. > > I guess interesting debate on whether providing extra garbage info is > a bug or not. Maybe a fixes tag for this one as well? I added: Fixes: 26e515713342 ("PCI: Add Downstream Port Containment driver") since it looks like we've printed the source unconditionally since the addition of DPC: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/pci/pcie/pcie-dpc.c?id=26e515713342#n69 > Reviewed-by: Jonathan Cameron > > I briefly wondered if it makes sense to have a prefix string initialized > outside the switch with "containment event, status:%#06x:" > made sense but it's probably not worth the effort and maybe makes it > harder to grep for the error messages. So in the end > I think your code here is the best option. > > Jonathan