Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1553568ybz; Thu, 30 Apr 2020 01:11:17 -0700 (PDT) X-Google-Smtp-Source: APiQypI09qOKwCOttb+97MKlcHmZyQ2sBDL8utuzyfFQrhQBkuHrzOu50S3RmweVS0lz7KeFXHmE X-Received: by 2002:a17:906:7f13:: with SMTP id d19mr1569941ejr.57.1588234277331; Thu, 30 Apr 2020 01:11:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588234277; cv=none; d=google.com; s=arc-20160816; b=Cip/MzRXwERgfr0/HBunKJTIpibrMjn5C9+yUZSw2XXQC9mla49kKO3moBvuioy49d vSMkvyaQ4FmA2ypzggWwj7w7sjoReaA2iaBI3lpHKt8j47BRjXT0ZFIRci1KFKk2BIZZ /5uby0+Jj7tEx+FC7+Ybuu63oXSTJB9/3oNEMn0VtVy/p4g8tPPhSyjyoqDZmT3WElrq jWErWvhjjwVJ2EqGbvwIbLpebGTWgx9V4nvQeWaCIRqUjh2axxsy+xWmJrCYqPvUrap4 9ZslE3NSR4Awv3CyL4uA2Yy1c57MHmtgGtkxOMmW0mWVFig0kFyV+yHGXLOwr1liSyEI sNuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Kz88JjuoM75cah2SEJVXtfVC+Z892kE31eu3baI40as=; b=eIofZCHb88Jz/twAX5akLLA0v43Owx8gV0u9PWliq7PCXkGNynoZM9VWsKXatOVGTg r6BuJDPge+h9FAElEL/oJHxrA4c3PmTbduIa1yYHp23aYimOzq3xbw7xl57NgTymGG8B ysGNz73/qd/p1uVPcqa5yudUm3CXyB9wsb7J3l5VOXTUx76jRe0kWig6m6ovvD2KHHey DdZAla206/cvINDYVTesE6ruuekW6tIcFKWo8BYnSnR97fL17S02P2A59E2hao2thpCQ x1ZEk9aW6w0EPmErtkaLKGCMUW8i8rQ13m1TmkzLA9t8jwbGe9giOFQ6Yvn9Wdr+h7Cu PJ3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TtcL8ObD; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g16si4387496edr.382.2020.04.30.01.10.51; Thu, 30 Apr 2020 01:11:17 -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=@kernel.org header.s=default header.b=TtcL8ObD; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727771AbgD3IHd (ORCPT + 99 others); Thu, 30 Apr 2020 04:07:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:50848 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726871AbgD3IGn (ORCPT ); Thu, 30 Apr 2020 04:06:43 -0400 Received: from pali.im (pali.im [31.31.79.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E7E032192A; Thu, 30 Apr 2020 08:06:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588234003; bh=7Q6yx7BAcNGphXyMJ64Hizlmq02sPIkiGXe5IfpE7Z8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TtcL8ObD9ZShKGhTyCFi7x9xii5PxTKPG28YjJWpUDfsSnzJR2XRsB+IuWynuwZ5s FVggj8KBUEpbTwrAOvO0TrscLr5TJOODGSjQ8wfYnUasQD+lssLZCNSAjD00ONAR87 LuwCzjE1oAbDDpLUvris+w/1Bl6QBWsByjAMKaz8= Received: by pali.im (Postfix) id EF9F8AC9; Thu, 30 Apr 2020 10:06:40 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Jason Cooper , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Rob Herring , Thomas Petazzoni , Lorenzo Pieralisi , Andrew Murray , Bjorn Helgaas , Remi Pommarel , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Tomasz Maciej Nowak , Xogium Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH v4 02/12] PCI: aardvark: Don't blindly enable ASPM L0s and don't write to read-only register Date: Thu, 30 Apr 2020 10:06:15 +0200 Message-Id: <20200430080625.26070-3-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200430080625.26070-1-pali@kernel.org> References: <20200430080625.26070-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Trying to change Link Status register does not have any effect as this is a read-only register. Trying to overwrite bits for Negotiated Link Width does not make sense. In future proper change of link width can be done via Lane Count Select bits in PCIe Control 0 register. Trying to unconditionally enable ASPM L0s via ASPM Control bits in Link Control register is wrong. There should be at least some detection if endpoint supports L0s as isn't mandatory. Moreover ASPM Control bits in Link Control register are controlled by pcie/aspm.c code which sets it according to system ASPM settings, immediately after aardvark driver probes. So setting these bits by aardvark driver has no long running effect. Remove code which touches ASPM L0s bits from this driver and let kernel's ASPM implementation to set ASPM state properly. Some users are reporting issues that this code is problematic for some Intel wifi cards and removing it fixes them, see e.g.: https://bugzilla.kernel.org/show_bug.cgi?id=196339 If problems with Intel wifi cards occur even after this commit, then pcie/aspm.c code could be modified / hooked to not enable ASPM L0s state for affected problematic cards. Signed-off-by: Pali Rohár --- drivers/pci/controller/pci-aardvark.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/controller/pci-aardvark.c index f9955b494267..74b90940a9d4 100644 --- a/drivers/pci/controller/pci-aardvark.c +++ b/drivers/pci/controller/pci-aardvark.c @@ -356,10 +356,6 @@ static void advk_pcie_setup_hw(struct advk_pcie *pcie) advk_pcie_wait_for_link(pcie); - reg = PCIE_CORE_LINK_L0S_ENTRY | - (1 << PCIE_CORE_LINK_WIDTH_SHIFT); - advk_writel(pcie, reg, PCIE_CORE_LINK_CTRL_STAT_REG); - reg = advk_readl(pcie, PCIE_CORE_CMD_STATUS_REG); reg |= PCIE_CORE_CMD_MEM_ACCESS_EN | PCIE_CORE_CMD_IO_ACCESS_EN | -- 2.20.1