From patchwork Wed Oct 5 02:58:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 12998843 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E055C433FE for ; Wed, 5 Oct 2022 02:58:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229592AbiJEC6W (ORCPT ); Tue, 4 Oct 2022 22:58:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229472AbiJEC6V (ORCPT ); Tue, 4 Oct 2022 22:58:21 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EE095A2FC; Tue, 4 Oct 2022 19:58:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id BEB23CE1232; Wed, 5 Oct 2022 02:58:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE820C433D6; Wed, 5 Oct 2022 02:58:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664938697; bh=iXLlB/JyBslVw0glbr+v06sxs2sGy1qV661ipd4xGwI=; h=From:To:Cc:Subject:Date:From; b=Ccj5VL28hYmZJU2GXBLI57djHsFE1z3W2ZPNZlhvlDgLrD8mCQT9q9eLyIL4XIijX pKyJJREieBQIx2McTJhcSUs86E4TqyNi0eb9DttQp3tv07nxKxnrqurg4C5xJylxXy uAUFL6IKaERx9I1j7m2GRfF7rCR7TAi7PqV4jGqTtdEQ6J/Hsr6BFFJQL/z4zdE9gv izGNdCWsfaPABVRGQyOTMbqPljFfKYut50mIjAmoS/4lnGGoPryLuCejhRKUsdyhSe TVv+OlqhonRGPk2wOo7qwi1VhetSS8sWQnojwPZJS/GRe9rehHTabBno4+MC9g0YXI mZRcrOgTxugiQ== From: Bjorn Helgaas To: linux-pci@vger.kernel.org Cc: Vidya Sagar , "Saheed O . Bolarinwa" , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rajat Jain , "Kenneth R . Crudup" , Kai-Heng Feng , Abhishek Sahu , Thierry Reding , Jonathan Hunter , Krishna Thota , Manikanta Maddireddy , Vidya Sagar , sagupta@nvidia.com, linux-kernel@vger.kernel.org, Bjorn Helgaas Subject: [PATCH 0/3] PCI/ASPM: Fix L1SS issues Date: Tue, 4 Oct 2022 21:58:06 -0500 Message-Id: <20221005025809.2247547-1-helgaas@kernel.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org From: Bjorn Helgaas This is really late, but I think we have two significant issues with L1SS: 1) pcie_aspm_cap_init() reads from the L1SS capability even when it doesn't exist, so it reads PCI_COMMAND and PCI_STATUS instead and treats those as an L1SS Capability value. 2) encode_l12_threshold() encodes LTR_L1.2_THRESHOLD as smaller than requested, so ports may enter L1.2 when they should not. These patches are intended to fix both issues. Bjorn Helgaas (3): PCI/ASPM: Factor out L1 PM Substates configuration PCI/ASPM: Ignore L1 PM Substates if device lacks capability PCI/ASPM: Correct LTR_L1.2_THRESHOLD computation drivers/pci/pcie/aspm.c | 155 +++++++++++++++++++++++----------------- 1 file changed, 90 insertions(+), 65 deletions(-) Reviewed-by: Kuppuswamy Sathyanarayanan