From patchwork Tue Aug 26 15:11:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 4782961 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 079A39F383 for ; Tue, 26 Aug 2014 15:12:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DC65520123 for ; Tue, 26 Aug 2014 15:12:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BB52520117 for ; Tue, 26 Aug 2014 15:12:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758434AbaHZPLu (ORCPT ); Tue, 26 Aug 2014 11:11:50 -0400 Received: from mail-wg0-f50.google.com ([74.125.82.50]:35504 "EHLO mail-wg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758522AbaHZPLr (ORCPT ); Tue, 26 Aug 2014 11:11:47 -0400 Received: by mail-wg0-f50.google.com with SMTP id n12so14387570wgh.21 for ; Tue, 26 Aug 2014 08:11:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=jEH6eRnvv1UFZbkWFRICVu5vhvXJ1ot8iwbOQLGUmNg=; b=wL5hPV7gy5ePu7sIzRHbAqLeadhaEsTipG1JH8UG7AujnrH4789Ieeub8iFhDwdSpJ tXx9Y4DrqiBdDSP7zQdUKhcDOTgnCm9J6INlNIHxNzDVZhNGI/KXMr4TUh/Gm/0X8DzA LEhBu3babdLSx3UaJGuBmHJH0OrwHuAzBkV9llR/ZdbxdLnOE4PFZVZd3iIXarMxiyn+ OqWKTKpaUMR0b9QW7l0i6eed+DAVekpj2/u64EgJv1m8mJZ01F9kk8PJfzJ/ZavxQion K0apfhYZT+Cg0vjVJdUwaB+GEnD4Utc2cp5T5JH4MD18KX2k/tMpaXr43t861u7EYTUj 02bA== X-Received: by 10.181.13.116 with SMTP id ex20mr22847072wid.31.1409065906327; Tue, 26 Aug 2014 08:11:46 -0700 (PDT) Received: from localhost (port-7111.pppoe.wtnet.de. [84.46.27.226]) by mx.google.com with ESMTPSA id lp1sm13037047wic.21.2014.08.26.08.11.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Aug 2014 08:11:45 -0700 (PDT) From: Thierry Reding To: Bjorn Helgaas Cc: Stephen Warren , linux-pci@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 3/6] PCI: tegra: Clear CLKREQ# enable on port disable Date: Tue, 26 Aug 2014 17:11:35 +0200 Message-Id: <1409065898-26887-4-git-send-email-thierry.reding@gmail.com> X-Mailer: git-send-email 2.0.4 In-Reply-To: <1409065898-26887-1-git-send-email-thierry.reding@gmail.com> References: <1409065898-26887-1-git-send-email-thierry.reding@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Thierry Reding When a root port is disabled, disable the CLKREQ# signal if available. Signed-off-by: Thierry Reding --- drivers/pci/host/pci-tegra.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c index 83fa33e16650..bd53b123218b 100644 --- a/drivers/pci/host/pci-tegra.c +++ b/drivers/pci/host/pci-tegra.c @@ -569,6 +569,7 @@ static void tegra_pcie_port_enable(struct tegra_pcie_port *port) static void tegra_pcie_port_disable(struct tegra_pcie_port *port) { + const struct tegra_pcie_soc_data *soc = port->pcie->soc_data; unsigned long ctrl = tegra_pcie_port_get_pex_ctrl(port); unsigned long value; @@ -579,6 +580,10 @@ static void tegra_pcie_port_disable(struct tegra_pcie_port *port) /* disable reference clock */ value = afi_readl(port->pcie, ctrl); + + if (soc->has_pex_clkreq_en) + value &= ~AFI_PEX_CTRL_CLKREQ_EN; + value &= ~AFI_PEX_CTRL_REFCLK_EN; afi_writel(port->pcie, value, ctrl); }