From patchwork Tue Aug 26 14:57:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 4782831 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 79C3B9F2A9 for ; Tue, 26 Aug 2014 14:59:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A1E7420142 for ; Tue, 26 Aug 2014 14:59:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A2DA0200FE for ; Tue, 26 Aug 2014 14:59:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934497AbaHZO7H (ORCPT ); Tue, 26 Aug 2014 10:59:07 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:38832 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758208AbaHZO5z (ORCPT ); Tue, 26 Aug 2014 10:57:55 -0400 Received: by mail-wi0-f171.google.com with SMTP id hi2so4353849wib.4 for ; Tue, 26 Aug 2014 07:57:54 -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=yIvdNZx/27qi553dfsnNZpiHQEand/qwNjMM/F2j5LUwLoQV4pjUK/f9TQOqVzbefW l/Y068rFi8CassJ2/tDEgwxW4XI+Hl8ymBqUxci8KSuU6w5aF/fxDadi+cnVkJM5XzF8 f2/xaPDuOZbqDR76GQLYcOlM4AymmuLjVTIFb5zx2gyTI0IpfihHL55XX5TZoYl+2uFn ZKSrOx7JSnirU8F+aSOXzbqI8evdyf48IY85+Nd1tv3s7LIid0HJQT14ymd0jhw/FXMw p9aPtsTheegc1QNmNsF8t00wF/Nu4i8vWrwm53IK4+Li2MOByMf67/AMuges7+haN6l5 YAIQ== X-Received: by 10.194.203.73 with SMTP id ko9mr10479324wjc.101.1409065074324; Tue, 26 Aug 2014 07:57:54 -0700 (PDT) Received: from localhost (port-7111.pppoe.wtnet.de. [84.46.27.226]) by mx.google.com with ESMTPSA id gk17sm12968223wic.16.2014.08.26.07.57.53 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Aug 2014 07:57:53 -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 v2 3/6] PCI: tegra: Clear CLKREQ# enable on port disable Date: Tue, 26 Aug 2014 16:57:41 +0200 Message-Id: <1409065064-17617-4-git-send-email-thierry.reding@gmail.com> X-Mailer: git-send-email 2.0.4 In-Reply-To: <1409065064-17617-1-git-send-email-thierry.reding@gmail.com> References: <1409065064-17617-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); }