Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4558283pxb; Sat, 6 Nov 2021 16:52:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxr9iB4nhbf16MebnF5WKjbQFq0oLCzA7LlrCnzxjBHXF+kisaZFSBbweECnwaJOCinKxz8 X-Received: by 2002:a05:6e02:160e:: with SMTP id t14mr29132073ilu.15.1636242739027; Sat, 06 Nov 2021 16:52:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636242739; cv=none; d=google.com; s=arc-20160816; b=nzPY2g4ubuu30Lvm1T/s9rqnTOYTEH7c+ynsEo0MpUltcwWiRKwaIsGgYesIFFa3JR iLjJLX/XYAqdjGPw4gSUNgw57QAX6JTnObZJdevy73eRjuOhOFPzfjp7omFMcR/ToWks 1mOIEKFXeuFiETl3PabI+l771x5OLeayGUfXcT7jfBDY5QE65cjcIV6i3YUSkh1d809w c38LMC3vZJrtYhssKqyQPXQvZSX+kkbAg2/Bikojkp6jbYfBjB/j8ZMm1thBQ15xydv9 RhiODFRZG2ZsDNdThJtzf9ZuFJl1qHhiId/tNxmd+xIP+fOsa1XWdShxpa/ly4AvCZc6 KWHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=3h30cY2ZC1huP0EMgM5FS83vEMXGDQzOBr2MExkq4aI=; b=XxZou3ZOSIfGXBvp9f/Bg1D4QrAwpFU5lQmVeISmhTxhUgL0lbWZe25Fb54c+uZpko 9hgqNLZ1cbtjdi7FJphK0Zdhvj7i/H0RUt35yi3Rcgom7BDA7X27cIfJH1pY1DTck4eQ eTVvIbxd0AoMMvYZvDAiRHXEpzh356b707W6j1B3SdhL8mPV3xLM/bG6xKG2L8r+/uJm xtQEHSX/99n1DbX7X3WpQPawCpecXbcxKWkk6Sbtr/77yWq2mp8i9bJMg0EXgNqV8S7v KzUUnAuEIyJkq8pr78I5Nqn7gEu4QmsI7kpEn1yigPnPlYayy+H9PFDqaeQkhS3tt0MZ TLrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="mdLx/I0x"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y15si25526575ilu.148.2021.11.06.16.52.07; Sat, 06 Nov 2021 16:52:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="mdLx/I0x"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234789AbhKFR7L (ORCPT + 99 others); Sat, 6 Nov 2021 13:59:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233407AbhKFR7H (ORCPT ); Sat, 6 Nov 2021 13:59:07 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DAA9C061714; Sat, 6 Nov 2021 10:56:26 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id r12so44752598edt.6; Sat, 06 Nov 2021 10:56:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3h30cY2ZC1huP0EMgM5FS83vEMXGDQzOBr2MExkq4aI=; b=mdLx/I0xdAZRgq2bYmMSfDC0Sc4CmjriBkzB+nh67PONr/3rzE5saq/xmCTogau4Xq k6Hi3iMsnc9I4BPDW7rPLLlwJXP1P317OPY9mG+pQXymBf719YlZ9uGM7Lpd8rozY+As P9+4lzUKVAeDXSbTVo4F3aI7ZS49SgoaEs914bVaRjaAKzkEV2P+mDTtnEDKf44eyJ3D +HhEsCQF/JHDLS2fZ33oOhmRMU86n5REPLtM2Uh9KEI7TH9dC783eHSB7iqZWPZw2tYg i3SNSFn2kjiqbLtY9QA4wxjLsCIRgZ1Q24i1ldMYhbCafn0XtYgYAKfujIMs/SMBx8dc X8OA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3h30cY2ZC1huP0EMgM5FS83vEMXGDQzOBr2MExkq4aI=; b=vs5ftvkZgZVs2uTxbGQc0VrQbQliCJH6i1JvB5c5K0E0ELY1rCdWm6m1sST3OvitEN cIKYpYE9u7FHkTsGPNt2KPo5sWfpwXSvmiOsBeILFIHFkU7g8lPUJhB+rCCMtCeo8TUH N6j9pzEMtq6vmwJJ34/pRVoz0tzB53Piw99f4Ahp+whbUWiC6l0/cPbx6qxm4za8Xkoa 0w8Lq6QGrVpPWe5LKFQvP7nthygC4NWt+usJW8m8qy5mPL0cslsLP3M62bmnDv4M00i+ UWaSOgCAtjQI8fbBUPSfnTUJHblpoOvrSnifF6g+6DMzR1Rx/tM3IFy3wRinZ/FJWUW9 e+zw== X-Gm-Message-State: AOAM531vfdtEj0hbFh2hnfJZ330I70Wvutmz6g8sbtwMD17U3XHBtKce QlP9BT8djUyLviPzaZLMxVHL6X5wMVI= X-Received: by 2002:a17:906:aecf:: with SMTP id me15mr17708145ejb.351.1636221384973; Sat, 06 Nov 2021 10:56:24 -0700 (PDT) Received: from localhost.localdomain ([2a02:ab88:109:9f0:f6a6:7fbe:807a:e1cc]) by smtp.googlemail.com with ESMTPSA id z2sm5802224ejb.41.2021.11.06.10.56.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Nov 2021 10:56:24 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org Cc: "Saheed O. Bolarinwa" , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH v1 1/2] PCI/ASPM: Never enable ASPM for insane devices Date: Sat, 6 Nov 2021 18:56:20 +0100 Message-Id: <20211106175621.28250-2-refactormyself@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20211106175621.28250-1-refactormyself@gmail.com> References: <20211106175621.28250-1-refactormyself@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org aspm_attr_store_common() makes it possible to clear the disable bits even for devices that fails pcie_aspm_sanity_check(). - Extend the if condition in aspm_attr_store_common() to screen out insane devices. Signed-off-by: Saheed O. Bolarinwa --- drivers/pci/pcie/aspm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c index 013a47f587ce..72cb17489e88 100644 --- a/drivers/pci/pcie/aspm.c +++ b/drivers/pci/pcie/aspm.c @@ -1225,7 +1225,7 @@ static ssize_t aspm_attr_store_common(struct device *dev, down_read(&pci_bus_sem); mutex_lock(&aspm_lock); - if (state_enable) { + if (state_enable && !pcie_aspm_sanity_check(pdev)) { link->aspm_disable &= ~state; /* need to enable L1 for substates */ if (state & ASPM_STATE_L1SS) -- 2.20.1