From patchwork Wed Jul 3 18:02:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Quinlan X-Patchwork-Id: 13722662 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EB01CC30653 for ; Wed, 3 Jul 2024 18:04:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Reply-To:MIME-Version: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=AuhuIrsgOqkZW3If8rwxeIX971dD10izklbCiwFuSEQ=; b=Uq02d3gOfF7+q+xAKxXdPx701X 1+sEh0USj3El7RPtpz7W4b1gID4x4AHbvTI9IfzLV+B3BzXYUTndXEB2++3bP43IQCQxQ3SwpNJNC SEjYNTn1hd9CG1e1PDTS6w7CzDTLQLsopWZPSkmkwh/Gc4yVQHBtE7thhdyDyJr4P8A8m101xyefZ z368EygxpTgzuXut+hsi8u5LZdUUdNoNLB/mbDlj1NdoeR6iQwzpo2AfiCMVjPDDar6UIQ0k7eLZs 8nTNBNVxdAnC9+wfXYkALukgSCeSbISZzjVBzbRICFdC8gJWCveQXjVuUHmqTBjIdOdxwC+MS2Yfb 3HKBiE9w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sP4LF-0000000B5gV-4BUl; Wed, 03 Jul 2024 18:04:30 +0000 Received: from mail-qv1-xf2c.google.com ([2607:f8b0:4864:20::f2c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sP4K1-0000000B51B-49Zc for linux-arm-kernel@lists.infradead.org; Wed, 03 Jul 2024 18:03:16 +0000 Received: by mail-qv1-xf2c.google.com with SMTP id 6a1803df08f44-6b5daf5ea91so9486536d6.1 for ; Wed, 03 Jul 2024 11:03:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1720029793; x=1720634593; darn=lists.infradead.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=AuhuIrsgOqkZW3If8rwxeIX971dD10izklbCiwFuSEQ=; b=cXAlhl0qdl+fBjElXIV+GqCoPoSPNO6NVyV/QHyisO/hvqJ7XiFZhVyqsCLCAUy0lS AQl05oZuu4QZTWQRZfT92i4aQ8BmZfjz7bmrd0FSsgzXWfIzfGvwVPLVEHE1cH9CEClD M4S5kuPiDdKDAn3oYFE/FK5Ke7Ww06/zDsJmc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720029793; x=1720634593; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=AuhuIrsgOqkZW3If8rwxeIX971dD10izklbCiwFuSEQ=; b=CD4O9azg8TVy1nYORSZ5Ofzn8mcidYw9fDr0mivyANqortPumhqCTB0mYAfu5lBhy8 Kjs2rrradloFq1br51eYDwJpRy6DMfMTEjSSLhGvUq2ecdXVYhWB12gDTEbKkqy57MIG Zi8xGXwqmR6gqvy0vsvknUPZnG+4P93dl7fTi1Bjhj6XsQ4KBbGIDQPGfBq1NaZhDWN2 MzHSjrivP1/YGEpOtPUM7YhPSDarw4FAw63AqMh0jI/Qwo02Ep/SHHCUhH7Nppl0uiXh Ju47nvfsS79vdOlBdjfX+tvTFacj42RUW5iylCyB0Da8umNzr5NeuTib1J2eXu+/ucUP sjQg== X-Forwarded-Encrypted: i=1; AJvYcCVazAhaWk74GeEQM0hUSESxPuO95N6JtmEoitmzLZhwhxbvNt9qDdA7HSVWDSXz9HZEO8D8B3iV4W5eNvC8zqHbFMF+G5Bu5nM01vaigWck/h+4ivk= X-Gm-Message-State: AOJu0YwMgc2TFoYy6l3E8Qq5cKBVIiEGv0vctRZdkc69FXsBiGBPSpC4 mYm8dPvYxqaVM6eiiErD9pbxy4VJE+wv26yoR4Uchj2aLjT9AdqW+aMxdAYC4A== X-Google-Smtp-Source: AGHT+IFvyn19h6XGEm0wfTzwiOrNHdvorSM1l6w/oocJLdctEG+4frKOEE66qjj0sNM+aokLw7rXCg== X-Received: by 2002:ad4:5c6b:0:b0:6b5:a81b:b974 with SMTP id 6a1803df08f44-6b5b704f9c0mr156271586d6.7.1720029793079; Wed, 03 Jul 2024 11:03:13 -0700 (PDT) Received: from stbsrv-and-01.and.broadcom.net ([192.19.144.250]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6b59e5f1a6dsm55589626d6.83.2024.07.03.11.03.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jul 2024 11:03:12 -0700 (PDT) From: Jim Quinlan To: linux-pci@vger.kernel.org, Nicolas Saenz Julienne , Bjorn Helgaas , Lorenzo Pieralisi , Cyril Brulebois , Stanimir Varbanov , bcm-kernel-feedback-list@broadcom.com, jim2101024@gmail.com, james.quinlan@broadcom.com Cc: Florian Fainelli , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , Philipp Zabel , 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 v2 05/12] PCI: brcmstb: Get resource before we start asserting reset controllers Date: Wed, 3 Jul 2024 14:02:49 -0400 Message-Id: <20240703180300.42959-6-james.quinlan@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240703180300.42959-1-james.quinlan@broadcom.com> References: <20240703180300.42959-1-james.quinlan@broadcom.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240703_110314_079697_27C82738 X-CRM114-Status: GOOD ( 11.87 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Place all of the devm_reset_contol_get*() calls above the calls that assert the reset controllers. Signed-off-by: Jim Quinlan --- drivers/pci/controller/pcie-brcmstb.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c index 69926ee5c961..59daa4b2e6c5 100644 --- a/drivers/pci/controller/pcie-brcmstb.c +++ b/drivers/pci/controller/pcie-brcmstb.c @@ -1644,6 +1644,11 @@ static int brcm_pcie_probe(struct platform_device *pdev) ret = PTR_ERR(pcie->perst_reset); goto clk_out; } + pcie->bridge = devm_reset_control_get_optional_exclusive(&pdev->dev, "bridge"); + if (IS_ERR(pcie->bridge)) { + ret = PTR_ERR(pcie->bridge); + goto clk_out; + } ret = reset_control_assert(pcie->swinit); if (ret) { @@ -1662,12 +1667,6 @@ static int brcm_pcie_probe(struct platform_device *pdev) goto clk_out; } - pcie->bridge = devm_reset_control_get_optional_exclusive(&pdev->dev, "bridge"); - if (IS_ERR(pcie->bridge)) { - ret = PTR_ERR(pcie->bridge); - goto clk_out; - } - ret = brcm_phy_start(pcie); if (ret) { reset_control_rearm(pcie->rescal);