From patchwork Tue Nov 1 00:38:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ray Jui X-Patchwork-Id: 9406703 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B123A60722 for ; Tue, 1 Nov 2016 00:39:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A0AF42930A for ; Tue, 1 Nov 2016 00:39:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 953C029341; Tue, 1 Nov 2016 00:39:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E78C29319 for ; Tue, 1 Nov 2016 00:39:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S948306AbcKAAjP (ORCPT ); Mon, 31 Oct 2016 20:39:15 -0400 Received: from mail-pf0-f169.google.com ([209.85.192.169]:36209 "EHLO mail-pf0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S948292AbcKAAjO (ORCPT ); Mon, 31 Oct 2016 20:39:14 -0400 Received: by mail-pf0-f169.google.com with SMTP id 189so31629745pfz.3 for ; Mon, 31 Oct 2016 17:39:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YFMRVeq6uxAatAjqaMrmVcgCANvI7Dc+iT2S3pNslY4=; b=YhaAiXgeKcM81MdsT5W0D5iBNh1Id94UctQOVP6CjAttM7yYtzHMx5GdBos/w46w2f 4EU22e0fpY1JOp5hDjILBMjP2QCD7skgEZhbVw/tG1eO55D8xd5nnlOLX2R5mUP4vCG/ Dht0wAsepDGEszTUSIaUwfVzfPYNrYFgO2M6Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=YFMRVeq6uxAatAjqaMrmVcgCANvI7Dc+iT2S3pNslY4=; b=Lrl8Cerss+FgnqsWl/tZNzV0Pr4vrAGXzz1bCY9w6TaddEw5qm900tchyN5hmxwCqh WjejMPlG7ciH2WZTweZRWKsOray7S9N7QWwK/lHyXAhg1JsfJ+0D5uxblw5s7KnE/5jv FCrVQFOGoMEmriZsxZFQutHGtih6TypijIaWCyAQ9gyIRlTNq3LqHwhZAw3O9NHxbOxJ /L+JWq7EuGEUEP+Du8ZNwQO7KwsqzTmCndkMxV+8g3ZpI0274euvqQMeL/jiyI3JoMmY 5AVmxeoCE8ylfE6OgHrj3hfRPlNdQjYWvpxWq3waLpB9WDMdjUNH8vEadkk+e5Wo6Fgv Ve+g== X-Gm-Message-State: ABUngvdackssNq7Ece9Cbz4FNEy3r2fIHBeiBPueiJ8RLRw+adbyB4uHD0BM2Zjdrq6woRmd X-Received: by 10.99.208.21 with SMTP id z21mr18027241pgf.79.1477960753535; Mon, 31 Oct 2016 17:39:13 -0700 (PDT) Received: from lbrmn-lnxub44-1.ric.broadcom.com ([216.31.219.19]) by smtp.gmail.com with ESMTPSA id x62sm2574619pfb.20.2016.10.31.17.39.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 31 Oct 2016 17:39:13 -0700 (PDT) From: Ray Jui To: Bjorn Helgaas , Bjorn Helgaas Cc: linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-pci@vger.kernel.org, Alex Barba , Oza Oza , Ray Jui , Ray Jui Subject: [PATCH v2 02/12] PCI: iproc: Do not reset PAXC when initializing the driver Date: Mon, 31 Oct 2016 17:38:31 -0700 Message-Id: <1477960721-17649-3-git-send-email-ray.jui@broadcom.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1477960721-17649-1-git-send-email-ray.jui@broadcom.com> References: <1477960721-17649-1-git-send-email-ray.jui@broadcom.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP During initialization, the current iProc PCIe host driver resets PAXC and the downstream internal endpoint device that PAXC connects to. If the endpoint device is already loaded with firmware and has started running from the bootloader stage, this downstream reset causes the endpoint device to stop working Signed-off-by: Ray Jui Reviewed-by: Scott Branden --- drivers/pci/host/pcie-iproc.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/pci/host/pcie-iproc.c b/drivers/pci/host/pcie-iproc.c index a9b9cd8..3f4884a 100644 --- a/drivers/pci/host/pcie-iproc.c +++ b/drivers/pci/host/pcie-iproc.c @@ -243,16 +243,13 @@ static void iproc_pcie_reset(struct iproc_pcie *pcie) { u32 val; - if (pcie->ep_is_internal) { - val = iproc_pcie_read_reg(pcie, IPROC_PCIE_CLK_CTRL); - val &= ~PAXC_RESET_MASK; - iproc_pcie_write_reg(pcie, IPROC_PCIE_CLK_CTRL, val); - udelay(100); - val |= PAXC_RESET_MASK; - iproc_pcie_write_reg(pcie, IPROC_PCIE_CLK_CTRL, val); - udelay(100); + /* + * PAXC and the internal emulated endpoint device downstream should not + * be reset. If firmware has been loaded on the endpoint device at an + * earlier boot stage, reset here causes issues + */ + if (pcie->ep_is_internal) return; - } /* * Select perst_b signal as reset source. Put the device into reset,