From patchwork Mon Oct 24 22:17:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ray Jui X-Patchwork-Id: 9393401 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 D4602607F0 for ; Mon, 24 Oct 2016 22:21:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BAAFD29120 for ; Mon, 24 Oct 2016 22:21:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AEED92917A; Mon, 24 Oct 2016 22:21:09 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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 4F9C029160 for ; Mon, 24 Oct 2016 22:21:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965319AbcJXWRo (ORCPT ); Mon, 24 Oct 2016 18:17:44 -0400 Received: from mail-pf0-f172.google.com ([209.85.192.172]:34964 "EHLO mail-pf0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965310AbcJXWRm (ORCPT ); Mon, 24 Oct 2016 18:17:42 -0400 Received: by mail-pf0-f172.google.com with SMTP id s8so105910987pfj.2 for ; Mon, 24 Oct 2016 15:17:41 -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=Ne2u0wm7k5/Lad3mdSuIBZ+4l8maeM4TNjjFj32hPYHersaryiaf9dMT7+dmsWIPgh Rk6/GV0pCfHxPdm/xMby6B1LemWDxto/MFsrDYUKwcO1rbWHy0ZlFkRkyfvK5N1C0EGB Bbj6MVAvE7w1nQmFZ5bSrGjhws4GDrYWktjOE= 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=GtN4Z6voHhF5I4v+sCXfonJHvmjho7rPMVS9FDHENmTWJ96rJADSeuXYBTaM55JgkV y+3G3JKw3/AOcx0d/gnttJ6MRbNHnyY+ArkUECiq7POJ31cnJIOifAd9GbsJ5OshrFGJ 6P3gnZqhPNtswu/DkeutUP8tHwXawEfR+1c+xDanMxtC4AxKsMgyfALAvdaLSR/PwIz4 yROGY3+Z4+c19pESrr2EzHEKbKcg6W65LJZC8I0ShxR9owm/qBvzry2zsT3TnEkMhtMt LdpkkmoI52Etc/pfNivAmiolNNYRmoim0l6qGpWGO6107Ezu1kIeR3Z0504ejcRodN43 +gSw== X-Gm-Message-State: ABUngvc6lESF4eEKOt7kP9lJHlDBgkYAOkCZybxe/Icso5E6eEKg5QwMAqheks/m8d074egf X-Received: by 10.98.39.66 with SMTP id n63mr1524555pfn.72.1477347460877; Mon, 24 Oct 2016 15:17:40 -0700 (PDT) Received: from lbrmn-lnxub44-1.ric.broadcom.com ([216.31.219.19]) by smtp.gmail.com with ESMTPSA id x1sm27745131pax.7.2016.10.24.15.17.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 24 Oct 2016 15:17:40 -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 , Ray Jui Subject: [PATCH 02/12] PCI: iproc: Do not reset PAXC when initializing the driver Date: Mon, 24 Oct 2016 15:17:02 -0700 Message-Id: <1477347432-17656-3-git-send-email-ray.jui@broadcom.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1477347432-17656-1-git-send-email-ray.jui@broadcom.com> References: <1477347432-17656-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,