Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4464874pxb; Sat, 6 Nov 2021 14:37:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzlcsMc/2M38pN0/XuS2uIuVR1+/lJD0xnUfK9gMQ+GOMut0jG1SfoMlCH6QNtDwVV8ejJ X-Received: by 2002:a17:906:14c7:: with SMTP id y7mr87398533ejc.123.1636234654336; Sat, 06 Nov 2021 14:37:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636234654; cv=none; d=google.com; s=arc-20160816; b=jCZPq0cHErjWybpVddyk2EEznwsy+d08PI8pVCxVetkrCbnifLyrQf94wRaSdNaP3d /B1zuTPocbw91asJUOvpUkrbArzSJz1KmyPEv81g7M3z1GyGE4NN7Lv4jVwDco3C9Tlz Eow4FSNDVJK4itR56mr855rWfkv7shxvcirTaJkOzxw3ifJ0cTB+aqNBuuM9KQgLfhpf 3hPyVbAY8QEtTkN/ne8QSK1Uo6VItk8EHiBs8ox5e4PzzH4q2oe8xEayzqQh59xmqJx8 pQUj4655kh7urEX4NspImnO3DhSuwxYUTTGPBmTFFuQXqffkE46FPsdEdqCzgPAsDAAG pUlA== 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=NM7x5Xb9QzcDyYGi0ieqwqwOgz/tPDERV+wmYTzgbd8=; b=MGHH1HrQDEL0mOowau3nViGjH2ioFjebu6joG1CqDk/X2/Uu+X2iVhSmeEA08X7I7i YCrdLIMFYnESRzc8ur7n3/L289zuPTEL4wyhZghSGwpiZlR0C3Izq1hya/FRM5iuDKKi aA6DJ6YN2wbAWZN9OmU9zn6ALE7npassY0OyVo9lXzBzsF7Bxh3RMA6plDQoOxMSXI8g CLRQYuCRdWqjeFRXnUEW8n25ZSgnhVmxd+VPNShjMNkdcCAQAMvaa6BWf3xmpOqZ4Rxt sSCWxGBDJvqhAFMl+wAf+lkY/2ixFEcLArn38aWUPU5JJ/yqqcHBEjZ8rFbqDUe/dFwU PkRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=PezMUUZC; 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 e10si17442500edv.299.2021.11.06.14.37.09; Sat, 06 Nov 2021 14:37:34 -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=PezMUUZC; 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 S234106AbhKFR7T (ORCPT + 99 others); Sat, 6 Nov 2021 13:59:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233621AbhKFR7I (ORCPT ); Sat, 6 Nov 2021 13:59:08 -0400 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 346A1C061570; Sat, 6 Nov 2021 10:56:27 -0700 (PDT) Received: by mail-ed1-x52c.google.com with SMTP id r12so44752665edt.6; Sat, 06 Nov 2021 10:56:27 -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=NM7x5Xb9QzcDyYGi0ieqwqwOgz/tPDERV+wmYTzgbd8=; b=PezMUUZCG/Nd21Bm0r4JVVyZ4ldBDsEguw/TaA1d2LAKwjMQ1yZz3KXQP4UYNBbCmm R1Gf2OR1w34XOL0HmLnGMyNyIwLMWyR3bGhP252BJ1utNy795BV/ejZ/c4CM9UY/jdPz S/b9c63fvYYUrxpGhi4nuwT7EnoZYaxAkQevOEGnVVCoPaEfm8saJmMidmu1HULpNNzC Uph2qKwhejekKSA07no0Pp2no12XbHiUN0dARMLt6D5RCtwlB2BqmFCDkYCa0Y6N1IwI RVLp91Ad24M3BrDaRYe3Q29Q8W6gRClyGCxedKSGOlHQyk2qz/usQNjjrSOAjWMwh2OJ fPMQ== 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=NM7x5Xb9QzcDyYGi0ieqwqwOgz/tPDERV+wmYTzgbd8=; b=NFeCN8remJPz/zJILLtDcc8R3F93PR5thd5DDbJ+tBTsGmG9zAUZ0dDVu15Af5+EiD hPb9xWjtAnm+JQ2DVtdB22qm5cqXRnweTUikJyl1hbhCYidFjZ4LJbxNToRxsJwKhHqe txLQoNFhQlu745e4SmBNSadFs0tElXoDYbH0SPgXB3sxYIc/4d3dRmW69Cszu72JPMbi 1gaOMBl7pRW0LVlE6uzPFFY7sMnnp89OczqlapnrVG99k7+ordMgSRP+gZ8LkBVXiGCr SohMtk6Ha5BfqwGHbd8/30dIDreiNrGHuP1mKYzQOTSjCDjHq+5Wn6jCHbnTK9bG/g5X 7zLg== X-Gm-Message-State: AOAM5312YhmXWm+MN/dJnruJi7Ug+OdbcWfnWLIQVFPTQ4MMuFcwCnvE VWfBK4jsqhyt6x1j4f+Z35Y= X-Received: by 2002:a17:906:6dc9:: with SMTP id j9mr72440649ejt.317.1636221385838; Sat, 06 Nov 2021 10:56:25 -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.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Nov 2021 10:56:25 -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 2/2] PCI/ASPM: Never enable CLKPM for insane devices Date: Sat, 6 Nov 2021 18:56:21 +0100 Message-Id: <20211106175621.28250-3-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 clkpm_store() makes it possible to turn off link->clkpm_disable for devices that fails pcie_aspm_sanity_check(). - Ceck the result of pcie_aspm_sanity_check() when setting link->clpm_disable within clkpm_store(). 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 72cb17489e88..c81b0ef32229 100644 --- a/drivers/pci/pcie/aspm.c +++ b/drivers/pci/pcie/aspm.c @@ -1282,7 +1282,7 @@ static ssize_t clkpm_store(struct device *dev, down_read(&pci_bus_sem); mutex_lock(&aspm_lock); - link->clkpm_disable = !state_enable; + link->clkpm_disable = !(state_enable && !pcie_aspm_sanity_check(pdev)); pcie_set_clkpm(link, policy_to_clkpm_state(link)); mutex_unlock(&aspm_lock); -- 2.20.1