From patchwork Tue Apr 27 17:51:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Quinlan X-Patchwork-Id: 12227091 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E65FC433B4 for ; Tue, 27 Apr 2021 17:54:09 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AA7D960FDB for ; Tue, 27 Apr 2021 17:54:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AA7D960FDB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:Cc:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wkafC8+zEKSbSil+EC1whGSWjTG3vWEF7fxkmEl+SHc=; b=oWE5L2qBriPPq6k17PnsfYi4sw 3tp5dqKrrDQF3efQ+YkL32T8WCheeFnIc509mpRfYdpdUkJ+5X9cK9Ro7LTUohvXyv80lB5+W40CD GnOt/kiI9sxlZaytkBNnAJHVWERY04Tn71qmqBUUWq8GxshAYnSz7CviJf+Px/8n7IExd69rCooU4 YTkJaWgFxb7RHwCSQU7k+Y0I/LlsWwYupB/8bmUI7gxsy4igu4MCswITEBh4mzOoy9KnqDq5/216T inWkIo9NUAcmYbxbZhEBTe/23pcLmSKC1ar63oFnir1GD2iGGrKLMAhZZpCkjS2LASEqZ0emE5SqY lXT8VgTQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lbRsZ-001zS4-Lg; Tue, 27 Apr 2021 17:52:11 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lbRsJ-001zQF-Cq; Tue, 27 Apr 2021 17:51:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description; bh=7XSm6/qzn9duNJgtAGMhBBSTeeaC2tU96ijTiVyfrw0=; b=sPqLXbkv4T1fGAYce7/7yfZgfa WOKoBq/DDhtMDK6R7DCpcXt/yNcDbgl7+iv9AmJZN7nt3LV+ZEaCDRJt9RUEts340u6vwig9HzZRq NSOpEs2zXeFMwOnpSmNUibXL69jpz5gOyXyedzOU2WJTiWfGmpDt7ClYzo2U1HDCWzYblPxEDokr5 MfKmVcZeQ+Cikx3FesNlrUYGjPtiZO+TC1fPwC1XQl0NeQYxHiJ+rmjiQFZmTdGJvrUo3rhVdIZSR yBNZJ3vZ+ar/xhawanPCwglsB4gMP/yeWHQwIvlFtZTNFac/pAWIQDEwUoHLa5ufhAA5Hg0vnlMl8 poQo5RLw==; Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lbRsE-00Gtke-SJ; Tue, 27 Apr 2021 17:51:52 +0000 Received: by mail-pj1-x1032.google.com with SMTP id l10-20020a17090a850ab0290155b06f6267so1449776pjn.5; Tue, 27 Apr 2021 10:51:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7XSm6/qzn9duNJgtAGMhBBSTeeaC2tU96ijTiVyfrw0=; b=ORiN/zPxZxhdaqsrIGlBT/ur3WfsLynWgmFPyXBf4D0Bm2D0t1Coryt9rFPBawWXNv X5hp3Ki0fH75da95sE5A/Fe1DZBMEGTWpTrQU6+BGFVujzcoYjHAwjncxp2B8kfZwz9t Ml0tnEqbzAacbRF+flA+YIlbJ6T8hFfea+n4T9KOenJZVmprB2yFehvwtOEfxlQGXm9n X3MkwWBjvRzbytfcS0M8thcVtrkM/kD8/Pp3YCBSJWtGUYAPTiqzKI/fiRvRLEX+32g3 aw9+h+0Q7nQpRjvFi9OAnMsL7hohfAIQuejxsoZqGg+STUagRiRC6lMcaElpBZ7Iettb +KHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7XSm6/qzn9duNJgtAGMhBBSTeeaC2tU96ijTiVyfrw0=; b=MaT1PDBD7meC7mq3SOAu1/uDongqqNVYHX7CjdgodNs1u37EhEgJzjRUB0ZjM6dXwh haG6WDJ279u0Q+BdtiunbIsPmhsxK38fyzmurghcTCUO6LwuAdcUhClNbmbNGdKE2r4Z lVSqqBxGF6gE66HwofmteuhaoBVMtM0phgRXPAWiyL/Ok6BzuC+lxRKBlM7yiYLQECkz 3T7bAPQxEK4MfAPXVn5pUNLYzCLCqGJqsK9Hgt21EeXG+uHhcpSpbT0uluBkB4VevwRL hZOtLq9MnCDV5ErIyOTLjmuu9+cRe3ch0n6va/wdwv/fUkOnSzhtSH42qNoTJao4KWuE I/6Q== X-Gm-Message-State: AOAM533heLIjeYDR+YD6PsFcEjhQFJeg2VpEteIBqziBr4uVswcGWOAl tdrxjP3FrpYPiJARmpIkyf0= X-Google-Smtp-Source: ABdhPJyT7HZQNUAXFGxWL8hWisHDSfUuIwmbKZqKOedQH2FPNEW8cz8HwMCds+JC8D7s+KhXGY4TOA== X-Received: by 2002:a17:90a:f195:: with SMTP id bv21mr6241676pjb.56.1619545909205; Tue, 27 Apr 2021 10:51:49 -0700 (PDT) Received: from stbsrv-and-01.and.broadcom.net ([192.19.231.250]) by smtp.gmail.com with ESMTPSA id h21sm2456833pfo.211.2021.04.27.10.51.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Apr 2021 10:51:48 -0700 (PDT) From: Jim Quinlan To: linux-pci@vger.kernel.org, Bjorn Helgaas , Nicolas Saenz Julienne , bcm-kernel-feedback-list@broadcom.com, james.quinlan@broadcom.com Cc: Jim Quinlan , Nicolas Saenz Julienne , Lorenzo Pieralisi , Rob Herring , Florian Fainelli , Jim Quinlan , linux-rpi-kernel@lists.infradead.org (moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE), linux-arm-kernel@lists.infradead.org (moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v1 1/4] PCI: brcmstb: Check return value of clk_prepare_enable() Date: Tue, 27 Apr 2021 13:51:36 -0400 Message-Id: <20210427175140.17800-2-jim2101024@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210427175140.17800-1-jim2101024@gmail.com> References: <20210427175140.17800-1-jim2101024@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210427_105150_939518_4100AFD0 X-CRM114-Status: GOOD ( 11.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Check for failure of clk_prepare_enable() on device resume. Signed-off-by: Jim Quinlan Acked-by: Florian Fainelli Fixes: 8195b7417018 ("PCI: brcmstb: Add suspend and resume pm_ops") --- drivers/pci/controller/pcie-brcmstb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c index e330e6811f0b..4ce1f3a60574 100644 --- a/drivers/pci/controller/pcie-brcmstb.c +++ b/drivers/pci/controller/pcie-brcmstb.c @@ -1161,7 +1161,9 @@ static int brcm_pcie_resume(struct device *dev) int ret; base = pcie->base; - clk_prepare_enable(pcie->clk); + ret = clk_prepare_enable(pcie->clk); + if (ret) + return ret; ret = brcm_phy_start(pcie); if (ret) From patchwork Tue Apr 27 17:51:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Quinlan X-Patchwork-Id: 12227093 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F561C43460 for ; Tue, 27 Apr 2021 17:54:11 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A506E613B2 for ; Tue, 27 Apr 2021 17:54:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A506E613B2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:Cc:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=FS+dgxy5FmqJfxo1aJzmoTV9iJs2iwxtKc87eOcTkpU=; b=Q0OO38ydNgNCxyrPP0k1t450D3 wGvE8K91kAZ2DpETWX3oGefaoo5GGoXoQg0kGTD4UVc7Wben3O9qHcaSVU9V+DZI7Uuzm3opHWbmE PN4PT7S5lIsH3qrdePajslLXi4Ke2MCVj1SgLi9P1qQfqCSevjnpQekIj9uWPnZOCSQQ4HyWFsWjO hauTW2FTxF0onXrJT3f5kAAtu3PuM09DMleaMzmg9U0WzXAAZUotBbrcCics3obF+GE4Z7kE+AYuA 4mfZLrNHeA+AlhEpy7xVQMlr7sdgZqorYwqC+q4jR3/GzuwmNAODzjTLrvClbBsCBbFMYd6taa5lI 3A8tUneQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lbRsk-001zSv-7h; Tue, 27 Apr 2021 17:52:22 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lbRsK-001zQM-9f; Tue, 27 Apr 2021 17:51:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description; bh=2TeMQIR29LL2unimARSS4Lts2CWaYP5hnwBOgRuHstg=; b=uXtdr/uaaivqJXaj+3TZsr5ctv jePCEUI2ftVf3J5O5wGvyIDvC8MnOAXs6xpEa65UAXpyG+pYxH1bY72EavAYP3EQQ+tEVVpsyRntg Letf+cD4TkjtE/2dRM79czB4Gt/68DuQFwwDpPIYis4UFMSdNrEW02Mw3RCcLGRZhQ1I0jbQVPa+3 ScNiN1ZmUKOgETAXkDBgExCwIdIqlgwpC1l4Q3+9KmilktQzy3MPfAicSkH8oj93Nk97+XxanljEY 5VgllcIJ7knzw6kVcRXr0fM+mlaifqDUGptlkLGLNBLFkhiFCD+E0wKwBhplVRjPR4GgzVHrgNnO3 AyD+L97w==; Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lbRsH-00GtlC-NO; Tue, 27 Apr 2021 17:51:55 +0000 Received: by mail-pj1-x1034.google.com with SMTP id md17so3934413pjb.0; Tue, 27 Apr 2021 10:51:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2TeMQIR29LL2unimARSS4Lts2CWaYP5hnwBOgRuHstg=; b=QdGe6x34JJei2d/ron5yM0DJQaJi1jeLsPy+/ZgW8umuLF/6hL54BgrJOy72zTLBjj SaK5FWmffeSlWH5iOk1FAJzl5PWqPNY0lPgOA5SoFwV0/2U0dVHZ0jjDJkB/LW1qInfS wq2eVemAQ6lsSAsYA3EN1hzrNckL75XUZy/osCJ5UlUQCbmfEpjZZocSlIxOYVBx/mZL U/iMQ+0T33Mgv4wd74WTfR7YUksY5jo7JzL6mJ5MNE6JTiIUTDMIl6zX4PT9PejgPwQR r5nEtNC8rKuUUFqSPLFX40vmF4R558O6AWsl/aBxO/vk9eHCR05ZAIhLcyS83em4fyeA 5xTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2TeMQIR29LL2unimARSS4Lts2CWaYP5hnwBOgRuHstg=; b=eHcxwsY9N3dfB0BHrqmh1XGeXFBy7zVvmwNNN7l7dYzwN2Mp/mlVDllwkMfIV182ch hIMFSDmiO4+MUll1qtlqGi40wmEhsV1samK0/DoL2olDQlgxWFUASIqWxl6FZ6/QZ7H/ mUtF4hkn+M4sKatzDlmk7Sc1sFA0aNjw0i4j3DjZgNmG2p4mqyegaLLtABRywxKqPdZx vDP7nHALLy+x7Fvet1KdPp2x78qZidq1Ha4AWZ/rAOUBJxYLxNLJZUMmEfpUAtbl6O04 UOx/R+2wqYe3zmo69rCtPdi/h5+Z4/4m+8I7+utzLQCHkY9cKE9aMK+tp4VPN5l4VQgI kS4w== X-Gm-Message-State: AOAM530ZP2tlfXLcRYCkjLLn0nGPawqdNUld+sIbRm+pZqTz4+ac7hz4 AWw2Bgt6n951/McbECUd4R0= X-Google-Smtp-Source: ABdhPJx3pj84P+TymUJU7/RCESFFoXJOkjgVGHcMsSz22PuKQmBEfFdZP2cdrdcIWYQSdH7bw/9cXg== X-Received: by 2002:a17:90b:e95:: with SMTP id fv21mr13283405pjb.107.1619545911874; Tue, 27 Apr 2021 10:51:51 -0700 (PDT) Received: from stbsrv-and-01.and.broadcom.net ([192.19.231.250]) by smtp.gmail.com with ESMTPSA id h21sm2456833pfo.211.2021.04.27.10.51.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Apr 2021 10:51:51 -0700 (PDT) From: Jim Quinlan To: linux-pci@vger.kernel.org, Bjorn Helgaas , Nicolas Saenz Julienne , bcm-kernel-feedback-list@broadcom.com, james.quinlan@broadcom.com Cc: Jim Quinlan , Nicolas Saenz Julienne , Lorenzo Pieralisi , Rob Herring , Florian Fainelli , linux-rpi-kernel@lists.infradead.org (moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE), linux-arm-kernel@lists.infradead.org (moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v1 2/4] PCI: brcmstb: Give 7216 SOCs their own config type Date: Tue, 27 Apr 2021 13:51:37 -0400 Message-Id: <20210427175140.17800-3-jim2101024@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210427175140.17800-1-jim2101024@gmail.com> References: <20210427175140.17800-1-jim2101024@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210427_105153_779849_FF6B6F6E X-CRM114-Status: GOOD ( 11.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This distinction is required for an imminent commit. Signed-off-by: Jim Quinlan Acked-by: Florian Fainelli --- drivers/pci/controller/pcie-brcmstb.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c index 4ce1f3a60574..3b6a62dd2e72 100644 --- a/drivers/pci/controller/pcie-brcmstb.c +++ b/drivers/pci/controller/pcie-brcmstb.c @@ -257,6 +257,13 @@ static const struct pcie_cfg_data bcm2711_cfg = { .bridge_sw_init_set = brcm_pcie_bridge_sw_init_set_generic, }; +static const struct pcie_cfg_data bcm7216_cfg = { + .offsets = pcie_offset_bcm7278, + .type = BCM7278, + .perst_set = brcm_pcie_perst_set_7278, + .bridge_sw_init_set = brcm_pcie_bridge_sw_init_set_7278, +}; + struct brcm_msi { struct device *dev; void __iomem *base; @@ -1220,7 +1227,7 @@ static const struct of_device_id brcm_pcie_match[] = { { .compatible = "brcm,bcm4908-pcie", .data = &bcm4908_cfg }, { .compatible = "brcm,bcm7211-pcie", .data = &generic_cfg }, { .compatible = "brcm,bcm7278-pcie", .data = &bcm7278_cfg }, - { .compatible = "brcm,bcm7216-pcie", .data = &bcm7278_cfg }, + { .compatible = "brcm,bcm7216-pcie", .data = &bcm7216_cfg }, { .compatible = "brcm,bcm7445-pcie", .data = &generic_cfg }, {}, }; From patchwork Tue Apr 27 17:51:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Quinlan X-Patchwork-Id: 12227095 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E389C433ED for ; Tue, 27 Apr 2021 17:54:12 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F3218610FB for ; Tue, 27 Apr 2021 17:54:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F3218610FB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:Cc:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wnaC85O4ak8HG4rGzSctAvS1Ab5FY4TvZa5BmU/NkYY=; b=pltEMqu4e9iWEoO8jLRmlv5NgF NGp0DuL/fKat9r5NJotWMqhe98/lXx+sy9VhOP9/AgxaO0+U+1C2D4Mi7ZXbz7z28vPYQ2Lwcu00G 3+6oFr7SNpWtwvcjJbgMjUfdZX71713vsaicro9bHZcbcuZNMLrR2s1T3k+AWBzKwrFeowpJpLkWG B8g/704alLRdrCo++3tShJRpG8KdaUn92C3RraqT7ptRNCJq1UtKJyb9P8MpVg05SNDVJ6YUqsE7w O7rqFjAoXX5rASH8XAICKvjPxq6eCQzeuNA9Z6W5nayEHa1VehJRDPW3RvO5SPfOKLouEv5vKV384 eMsCsMoQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lbRsw-001zUX-Mc; Tue, 27 Apr 2021 17:52:35 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lbRsM-001zQj-Py; Tue, 27 Apr 2021 17:51:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description; bh=iB4Oot/0lSTvUQU4iqLoWuoZs5LYAMg1vqOt+d8WS9Y=; b=qrBUVov10xQh93OQrbVh1OewZ6 eMRlei7xM4EcqWedoxczYwwxCjmvcmcRYn1tm7GgB4z+MyNf1dZy4A7X2l0a1JA0iekGa02Ul7Bix AuAyiDrC3lWJ7Yt5XN+1XnDjInJ++Z/kecYhTaa8S9elWAmaWvvNuQBOOQODw/sfhL9KcXFUKk0fs zm2ZQMxEVS+OJs0FkC8W5uba7+auTk2Am2ZnDsbx86OFmA/ZjL2kDwxNc/d+s1w8/GukTNMNRb4q3 j1T5etS8Q5Fug6Sm+r8vxidbhJzO9xtzh5fPAaEiqjFhqTh2AFRqaDwXv/XCQ9crUJPv7x33YD9kP d0/AbvWA==; Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lbRsJ-00Gtm2-Tr; Tue, 27 Apr 2021 17:51:57 +0000 Received: by mail-pl1-x630.google.com with SMTP id s15so2897223plg.6; Tue, 27 Apr 2021 10:51:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iB4Oot/0lSTvUQU4iqLoWuoZs5LYAMg1vqOt+d8WS9Y=; b=bZqqTgnJlQGzbai3jyFB3ehCinYQgPhAhwo1ZLmVVUr6SD0z7iakzmaZMB1JJdYyo6 weePY+ZuTn5ZcU01JuNl677/XDFojGvffrR/qrhvSGoW2QqtCD+PcOrXxn8w/24Dq7a+ jNFD4ch0i836/Ug6if0d4dsHPQ4pd4rsCHijf88kLCT2N/tRYuFOWPGNET3C5op3kEKf ZlzP996/DaMphxK2SfFuAyPsOnGNZZk1//PK7siHo2NHz22m3gMirCpVUFRcRHgAZo0G k/4NxBg7xb8/qaJzxQ/Vp9EDdq4fNMuPq/nHZRT/rS3/0J3nfXp0fbgppCZYrwzH70Sf EwXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=iB4Oot/0lSTvUQU4iqLoWuoZs5LYAMg1vqOt+d8WS9Y=; b=ucDDLcFQJp4EOrqCS0SA3kOva+0C8tyipbXqU3RCsD3361LPy5SO/QblCL0hCRY6ar T+BTKm8tEr33XMuJdgnhyKDZ4V8aRfDN3kHNoWizOgvj0eykGqtInqjzg3vQFJBCZd0Z M5tXovjA4lmCmFZVWV+cBgAr3z9WDL1LA1k+bY5FTkpE0KbAB38CzWojvLq1BHbSfqcq pKqerw6V9kJUjxX0O3hEGcDYLQgM6TkCqvlJF1Zdqt7wmH1aqxqaTRVgN9K6haVMfy+6 JCWidPVSdRZTGbVM3Xrh2UECkJTBglTr8R60q5wPpQommyo/uHa7Yp25wUZ54PG8OLSb ENQg== X-Gm-Message-State: AOAM530biH8Nf9zs4z/rWOv78sISxXqs2xh6ZjiSB1vpudgWXsK2bXU7 qd+dR3WDOKsNjr1JN23p0D4T2DaULLU= X-Google-Smtp-Source: ABdhPJzHGHFcKV8nvFEefnummSuloMSBCvVu6bgx287p5NtPcZB/6U7cngbAXxMcDWS3vRqJ1BqAeA== X-Received: by 2002:a17:90b:1b03:: with SMTP id nu3mr6130980pjb.62.1619545914772; Tue, 27 Apr 2021 10:51:54 -0700 (PDT) Received: from stbsrv-and-01.and.broadcom.net ([192.19.231.250]) by smtp.gmail.com with ESMTPSA id h21sm2456833pfo.211.2021.04.27.10.51.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Apr 2021 10:51:54 -0700 (PDT) From: Jim Quinlan To: linux-pci@vger.kernel.org, Bjorn Helgaas , Nicolas Saenz Julienne , bcm-kernel-feedback-list@broadcom.com, james.quinlan@broadcom.com Cc: Jim Quinlan , Nicolas Saenz Julienne , Lorenzo Pieralisi , Rob Herring , Florian Fainelli , linux-rpi-kernel@lists.infradead.org (moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE), linux-arm-kernel@lists.infradead.org (moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v1 3/4] PCI: brcmstb: Add panic/die handler to RC driver Date: Tue, 27 Apr 2021 13:51:38 -0400 Message-Id: <20210427175140.17800-4-jim2101024@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210427175140.17800-1-jim2101024@gmail.com> References: <20210427175140.17800-1-jim2101024@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210427_105155_987462_34AEBF2E X-CRM114-Status: GOOD ( 19.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Whereas most PCIe HW returns 0xffffffff on illegal accesses and the like, by default Broadcom's STB PCIe controller effects an abort. This simple handler determines if the PCIe controller was the cause of the abort and if so, prints out diagnostic info. Example output: brcm-pcie 8b20000.pcie: Error: Mem Acc: 32bit, Read, @0x38000000 brcm-pcie 8b20000.pcie: Type: TO=0 Abt=0 UnspReq=1 AccDsble=0 BadAddr=0 Signed-off-by: Jim Quinlan Acked-by: Florian Fainelli --- drivers/pci/controller/pcie-brcmstb.c | 122 ++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c index 3b6a62dd2e72..d3af8d84f0d6 100644 --- a/drivers/pci/controller/pcie-brcmstb.c +++ b/drivers/pci/controller/pcie-brcmstb.c @@ -12,11 +12,13 @@ #include #include #include +#include #include #include #include #include #include +#include #include #include #include @@ -184,6 +186,39 @@ #define PCIE_DVT_PMU_PCIE_PHY_CTRL_DAST_PWRDN_MASK 0x1 #define PCIE_DVT_PMU_PCIE_PHY_CTRL_DAST_PWRDN_SHIFT 0x0 +/* Error report regiseters */ +#define PCIE_OUTB_ERR_TREAT 0x6000 +#define PCIE_OUTB_ERR_TREAT_CONFIG_MASK 0x1 +#define PCIE_OUTB_ERR_TREAT_MEM_MASK 0x2 +#define PCIE_OUTB_ERR_VALID 0x6004 +#define PCIE_OUTB_ERR_CLEAR 0x6008 +#define PCIE_OUTB_ERR_ACC_INFO 0x600c +#define PCIE_OUTB_ERR_ACC_INFO_CFG_ERR_MASK 0x01 +#define PCIE_OUTB_ERR_ACC_INFO_MEM_ERR_MASK 0x02 +#define PCIE_OUTB_ERR_ACC_INFO_TYPE_64_MASK 0x04 +#define PCIE_OUTB_ERR_ACC_INFO_DIR_WRITE_MASK 0x10 +#define PCIE_OUTB_ERR_ACC_INFO_BYTE_LANES_MASK 0xff00 +#define PCIE_OUTB_ERR_ACC_ADDR 0x6010 +#define PCIE_OUTB_ERR_ACC_ADDR_BUS_MASK 0xff00000 +#define PCIE_OUTB_ERR_ACC_ADDR_DEV_MASK 0xf8000 +#define PCIE_OUTB_ERR_ACC_ADDR_FUNC_MASK 0x7000 +#define PCIE_OUTB_ERR_ACC_ADDR_REG_MASK 0xfff +#define PCIE_OUTB_ERR_CFG_CAUSE 0x6014 +#define PCIE_OUTB_ERR_CFG_CAUSE_TIMEOUT_MASK 0x40 +#define PCIE_OUTB_ERR_CFG_CAUSE_ABORT_MASK 0x20 +#define PCIE_OUTB_ERR_CFG_CAUSE_UNSUPP_REQ_MASK 0x10 +#define PCIE_OUTB_ERR_CFG_CAUSE_ACC_TIMEOUT_MASK 0x4 +#define PCIE_OUTB_ERR_CFG_CAUSE_ACC_DISABLED_MASK 0x2 +#define PCIE_OUTB_ERR_CFG_CAUSE_ACC_64BIT__MASK 0x1 +#define PCIE_OUTB_ERR_MEM_ADDR_LO 0x6018 +#define PCIE_OUTB_ERR_MEM_ADDR_HI 0x601c +#define PCIE_OUTB_ERR_MEM_CAUSE 0x6020 +#define PCIE_OUTB_ERR_MEM_CAUSE_TIMEOUT_MASK 0x40 +#define PCIE_OUTB_ERR_MEM_CAUSE_ABORT_MASK 0x20 +#define PCIE_OUTB_ERR_MEM_CAUSE_UNSUPP_REQ_MASK 0x10 +#define PCIE_OUTB_ERR_MEM_CAUSE_ACC_DISABLED_MASK 0x2 +#define PCIE_OUTB_ERR_MEM_CAUSE_BAD_ADDR_MASK 0x1 + /* Forward declarations */ struct brcm_pcie; static inline void brcm_pcie_bridge_sw_init_set_7278(struct brcm_pcie *pcie, u32 val); @@ -215,6 +250,7 @@ struct pcie_cfg_data { const enum pcie_type type; void (*perst_set)(struct brcm_pcie *pcie, u32 val); void (*bridge_sw_init_set)(struct brcm_pcie *pcie, u32 val); + const bool has_err_report; }; static const int pcie_offsets[] = { @@ -262,6 +298,7 @@ static const struct pcie_cfg_data bcm7216_cfg = { .type = BCM7278, .perst_set = brcm_pcie_perst_set_7278, .bridge_sw_init_set = brcm_pcie_bridge_sw_init_set_7278, + .has_err_report = true, }; struct brcm_msi { @@ -302,8 +339,87 @@ struct brcm_pcie { u32 hw_rev; void (*perst_set)(struct brcm_pcie *pcie, u32 val); void (*bridge_sw_init_set)(struct brcm_pcie *pcie, u32 val); + bool has_err_report; + struct notifier_block die_notifier; }; +/* Dump out PCIe errors on die or panic */ +static int dump_pcie_error(struct notifier_block *self, unsigned long v, void *p) +{ + const struct brcm_pcie *pcie = container_of(self, struct brcm_pcie, die_notifier); + void __iomem *base = pcie->base; + int i, is_cfg_err, is_mem_err, lanes; + char *width_str, *direction_str, lanes_str[9]; + u32 info; + + if (readl(base + PCIE_OUTB_ERR_VALID) == 0) + return NOTIFY_DONE; + info = readl(base + PCIE_OUTB_ERR_ACC_INFO); + + + is_cfg_err = !!(info & PCIE_OUTB_ERR_ACC_INFO_CFG_ERR_MASK); + is_mem_err = !!(info & PCIE_OUTB_ERR_ACC_INFO_MEM_ERR_MASK); + width_str = (info & PCIE_OUTB_ERR_ACC_INFO_TYPE_64_MASK) ? "64bit" : "32bit"; + direction_str = (info & PCIE_OUTB_ERR_ACC_INFO_DIR_WRITE_MASK) ? "Write" : "Read"; + lanes = FIELD_GET(PCIE_OUTB_ERR_ACC_INFO_BYTE_LANES_MASK, info); + for (i = 0, lanes_str[8] = 0; i < 8; i++) + lanes_str[i] = (lanes & (1 << i)) ? '1' : '0'; + + if (is_cfg_err) { + u32 cfg_addr = readl(base + PCIE_OUTB_ERR_ACC_ADDR); + u32 cause = readl(base + PCIE_OUTB_ERR_CFG_CAUSE); + int bus = FIELD_GET(PCIE_OUTB_ERR_ACC_ADDR_BUS_MASK, cfg_addr); + int dev = FIELD_GET(PCIE_OUTB_ERR_ACC_ADDR_DEV_MASK, cfg_addr); + int func = FIELD_GET(PCIE_OUTB_ERR_ACC_ADDR_FUNC_MASK, cfg_addr); + int reg = FIELD_GET(PCIE_OUTB_ERR_ACC_ADDR_REG_MASK, cfg_addr); + + dev_err(pcie->dev, "Error: CFG Acc, %s, %s, Bus=%d, Dev=%d, Fun=%d, Reg=0x%x, lanes=%s\n", + width_str, direction_str, bus, dev, func, reg, lanes_str); + dev_err(pcie->dev, " Type: TO=%d Abt=%d UnsupReq=%d AccTO=%d AccDsbld=%d Acc64bit=%d\n", + !!(cause & PCIE_OUTB_ERR_CFG_CAUSE_TIMEOUT_MASK), + !!(cause & PCIE_OUTB_ERR_CFG_CAUSE_ABORT_MASK), + !!(cause & PCIE_OUTB_ERR_CFG_CAUSE_UNSUPP_REQ_MASK), + !!(cause & PCIE_OUTB_ERR_CFG_CAUSE_ACC_TIMEOUT_MASK), + !!(cause & PCIE_OUTB_ERR_CFG_CAUSE_ACC_DISABLED_MASK), + !!(cause & PCIE_OUTB_ERR_CFG_CAUSE_ACC_64BIT__MASK)); + } + + if (is_mem_err) { + u32 cause = readl(base + PCIE_OUTB_ERR_MEM_CAUSE); + u32 lo = readl(base + PCIE_OUTB_ERR_MEM_ADDR_LO); + u32 hi = readl(base + PCIE_OUTB_ERR_MEM_ADDR_HI); + u64 addr = ((u64)hi << 32) | (u64)lo; + + dev_err(pcie->dev, "Error: Mem Acc, %s, %s, @0x%llx, lanes=%s\n", + width_str, direction_str, addr, lanes_str); + dev_err(pcie->dev, " Type: TO=%d Abt=%d UnsupReq=%d AccDsble=%d BadAddr=%d\n", + !!(cause & PCIE_OUTB_ERR_MEM_CAUSE_TIMEOUT_MASK), + !!(cause & PCIE_OUTB_ERR_MEM_CAUSE_ABORT_MASK), + !!(cause & PCIE_OUTB_ERR_MEM_CAUSE_UNSUPP_REQ_MASK), + !!(cause & PCIE_OUTB_ERR_MEM_CAUSE_ACC_DISABLED_MASK), + !!(cause & PCIE_OUTB_ERR_MEM_CAUSE_BAD_ADDR_MASK)); + } + + /* Clear the error */ + writel(1, base + PCIE_OUTB_ERR_CLEAR); + + return NOTIFY_DONE; +} + +static void brcm_register_die_notifiers(struct brcm_pcie *pcie) +{ + pcie->die_notifier.notifier_call = dump_pcie_error; + register_die_notifier(&pcie->die_notifier); + atomic_notifier_chain_register(&panic_notifier_list, &pcie->die_notifier); +} + +static void brcm_unregister_die_notifiers(struct brcm_pcie *pcie) +{ + unregister_die_notifier(&pcie->die_notifier); + atomic_notifier_chain_unregister(&panic_notifier_list, &pcie->die_notifier); + pcie->die_notifier.notifier_call = NULL; +} + /* * This is to convert the size of the inbound "BAR" region to the * non-linear values of PCIE_X_MISC_RC_BAR[123]_CONFIG_LO.SIZE @@ -1216,6 +1332,8 @@ static int brcm_pcie_remove(struct platform_device *pdev) struct pci_host_bridge *bridge = pci_host_bridge_from_priv(pcie); pci_stop_root_bus(bridge->bus); + if (pcie->has_err_report) + brcm_unregister_die_notifiers(pcie); pci_remove_root_bus(bridge->bus); __brcm_pcie_remove(pcie); @@ -1255,6 +1373,7 @@ static int brcm_pcie_probe(struct platform_device *pdev) pcie->np = np; pcie->reg_offsets = data->offsets; pcie->type = data->type; + pcie->has_err_report = data->has_err_report; pcie->perst_set = data->perst_set; pcie->bridge_sw_init_set = data->bridge_sw_init_set; @@ -1322,6 +1441,9 @@ static int brcm_pcie_probe(struct platform_device *pdev) platform_set_drvdata(pdev, pcie); + if (pcie->has_err_report) + brcm_register_die_notifiers(pcie); + return pci_host_probe(bridge); fail: __brcm_pcie_remove(pcie); From patchwork Tue Apr 27 17:51:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Quinlan X-Patchwork-Id: 12227097 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0426CC433ED for ; Tue, 27 Apr 2021 17:54:25 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5AB2C60FDB for ; Tue, 27 Apr 2021 17:54:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5AB2C60FDB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:Cc:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=uMWSzzhRzlHyqHgeaa7PLiOha0hdJHvIl+NZwt6rGzQ=; b=W+/vZ1XgP2gTa1CH+8bsHir7Kg d+SkuZ+rixN0oDAMGMM+/a/MEMV2AJlBMyQPsq/64AyslnfXMYkgO32mwolVcoa8tG18A3U8uvtYM 4+znC23qg3/nFFVNtjq4FXaGKeTo5uYMcW4990ElzfZAE9RcvFbbndVAzHdrFJbL61xkYoXB8330h 1XSC2kzO4iatYswN6UyI1LNspuAA4xMmSLj2rUPaum3X80a+tjmMkMZLyvh2U1KB3eJSmbHi2L3fA l/aTk+/AYT4xLWJcS0pYzjbtJu10jLcUvvCO84lKO9XLlQiiaoOyxI7wCk2/n+Hr8AwEMCizsy/J/ o+wrUkEA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lbRt8-001zYK-HD; Tue, 27 Apr 2021 17:52:46 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lbRsO-001zQx-D4; Tue, 27 Apr 2021 17:52:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description; bh=jiipAsdDAcWlKdQjKY9n5M1r8f05IAR9cMGWFIS34F0=; b=D9QC0hm6UNLIKEfqyNcBUdrJu9 qnWgZg+JONIOO572mIt1DGx6HAsDzdqgNM4TdiO95rM18er9NNkx0g/Z32zTs4FitvSnyfW3iCmRr xTsYVnB02BIsVrOpGhMQNzAgOaqbb58S7myOKeICtDtBx40CyquPfafx+R5ILF3gktJwlREfbdJrh aCCHA4TwU+2ljHi8y+MT49B/G7KxjhfksrTbnLnZjp8U8dwu+iRUjStzzGeFEBhZmZyP36bQbmAi8 fI+kmpLpnwmLz8QijMEZIiP6RJPyPoHS0tFjNjNtkK38xUX/Ja4NDg34FvWgv+94RA6srNwH8sG85 z1IAP8bg==; Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lbRsM-00Gtmd-0b; Tue, 27 Apr 2021 17:51:59 +0000 Received: by mail-pj1-x1034.google.com with SMTP id y22-20020a17090a8b16b0290150ae1a6d2bso7684062pjn.0; Tue, 27 Apr 2021 10:51:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=jiipAsdDAcWlKdQjKY9n5M1r8f05IAR9cMGWFIS34F0=; b=hPMjlmoOuIUZ3C5DGZchaD2tsGt5B76Llw9rbAkVaizKoIZgvw060WzJHMt5oKMjbu LGiYJRjTQojS9n8vI/CfsucS9s42iSiunAazCphzMnAtGiP0Jry8hx2C6+Q5bOIuU53+ 3gSLZ6aPTYQq3tHZG2OCFZuWEXK25fouBZudK0lfifTD9Omyj2w3nZPKV/Z/Sh9E9Ytz HkQNM9ItJh/s6boqBuzxR+Pliqara/Yl5PF+cCUEuuQA3K9CL+2zAG+OOLy2sTEePvi3 4DycYR42e4mJ0XkwCb2TVnqUBmkwBqPet2Yh+yCayLN9RD6B9Ww8Vz0Iy8nF9IxYitgU eR3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=jiipAsdDAcWlKdQjKY9n5M1r8f05IAR9cMGWFIS34F0=; b=l7448WTPKlusRREtGRa5SLJfeuMd6O6vmkoqPFi/NiQy5zLM+D48DhK6ZI5SxC8C8v AljpdJHd/U8L9ZGot1O6DH7z0egurV2FkbVttWcfkBlIMEHshz2hxK8+y0humkoZpECn 6dKEQDrZ2lVr5FyLt60FDWdm2hYzgaRfY0VNy8eUONo/DpzwAzwPnHRov3Y6VelnK88K zHcePuQAZ9PRlYi/yvqGyIewOB1R+yzD3dGJEPMgoQJyP7oA5Ej1OLkFbV5RbuvdebNK yU9Du3XLcf94y5CNQvb8rUEkRYurPP/XErL3/oQF+odAxVrJigOLi2Eg5fn7B6Fr9MiL F6Ng== X-Gm-Message-State: AOAM53080j3yJRViMuJGaGC6OPntzwVRoSSJgLsWoxSqroWpCGuVds5i AOUPSchkDRBxAfbV80gVUoA= X-Google-Smtp-Source: ABdhPJynTAfXzItwN2Cr+tVlU0GDgflTrBaY3jF7/6SbzWDHNNgu/uH9c/JnVpRZbze56TA1Eqx1IA== X-Received: by 2002:a17:90a:a60b:: with SMTP id c11mr28260596pjq.125.1619545917681; Tue, 27 Apr 2021 10:51:57 -0700 (PDT) Received: from stbsrv-and-01.and.broadcom.net ([192.19.231.250]) by smtp.gmail.com with ESMTPSA id h21sm2456833pfo.211.2021.04.27.10.51.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Apr 2021 10:51:57 -0700 (PDT) From: Jim Quinlan To: linux-pci@vger.kernel.org, Bjorn Helgaas , Nicolas Saenz Julienne , bcm-kernel-feedback-list@broadcom.com, james.quinlan@broadcom.com Cc: Jim Quinlan , Nicolas Saenz Julienne , Lorenzo Pieralisi , Rob Herring , Florian Fainelli , linux-rpi-kernel@lists.infradead.org (moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE), linux-arm-kernel@lists.infradead.org (moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v1 4/4] PCI: brcmstb: add shutdown call to driver Date: Tue, 27 Apr 2021 13:51:39 -0400 Message-Id: <20210427175140.17800-5-jim2101024@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210427175140.17800-1-jim2101024@gmail.com> References: <20210427175140.17800-1-jim2101024@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210427_105158_072508_FEBD056C X-CRM114-Status: GOOD ( 14.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The shutdown() call is similar to the remove() call except the former does not need to invoke pci_{stop,remove}_root_bus(), and besides, errors occur if it does. Signed-off-by: Jim Quinlan Acked-by: Florian Fainelli --- drivers/pci/controller/pcie-brcmstb.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c index d3af8d84f0d6..a1fe1a2ada48 100644 --- a/drivers/pci/controller/pcie-brcmstb.c +++ b/drivers/pci/controller/pcie-brcmstb.c @@ -1340,6 +1340,15 @@ static int brcm_pcie_remove(struct platform_device *pdev) return 0; } +static void brcm_pcie_shutdown(struct platform_device *pdev) +{ + struct brcm_pcie *pcie = platform_get_drvdata(pdev); + + if (pcie->has_err_report) + brcm_unregister_die_notifiers(pcie); + __brcm_pcie_remove(pcie); +} + static const struct of_device_id brcm_pcie_match[] = { { .compatible = "brcm,bcm2711-pcie", .data = &bcm2711_cfg }, { .compatible = "brcm,bcm4908-pcie", .data = &bcm4908_cfg }, @@ -1460,6 +1469,7 @@ static const struct dev_pm_ops brcm_pcie_pm_ops = { static struct platform_driver brcm_pcie_driver = { .probe = brcm_pcie_probe, .remove = brcm_pcie_remove, + .shutdown = brcm_pcie_shutdown, .driver = { .name = "brcm-pcie", .of_match_table = brcm_pcie_match,