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: 13722648 X-Patchwork-Delegate: kw@linux.com Received: from mail-qt1-f181.google.com (mail-qt1-f181.google.com [209.85.160.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 38CAF18754C for ; Wed, 3 Jul 2024 18:03:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720029796; cv=none; b=slZNrt556GVKr6cn7yLC/FTux4M0CRylqzZFEeiO2FRiyOxNceEgv2oMRNWyKmCM7vU77eFyWAJIIM1xRtGtowFoafTeekW2S9NOxQPvuREUXFljJat4aF4s+IBoKk2AuYCAStgToFTuSYZ9M6he2loWTY5gYYfIRqBq89U+mak= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720029796; c=relaxed/simple; bh=40N0DREb5pP3gbc8QqHOhOuu2Dm16NudKUpztYOddqk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type; b=hRsJYSDNMFtNesqeubmYpUIvnWhVS0DidbOmTReBBFbV/uD+itv4IDuDz762wvMzBS4Z5Df1qeCnHGQR7Dqqr6+nW7tO1G2D6QyDhNs5WcOyWN8XdafFfPt7nsp4HynEhXq6N8ibtNKjJEwPaLvQRw9dMQF5tFtxhQhcSNAnT+k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=J5IEABNY; arc=none smtp.client-ip=209.85.160.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="J5IEABNY" Received: by mail-qt1-f181.google.com with SMTP id d75a77b69052e-445033fbc24so46273411cf.3 for ; Wed, 03 Jul 2024 11:03:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1720029793; x=1720634593; darn=vger.kernel.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=1MQZoniAISMMt5/DKGF/VWhkNRaVu+ugSxBxBjNXKSs=; b=J5IEABNYjk+PtBcnFLbL+uQPmYnC1HeTsBmmqwJedgev7Ep6+9HJ9znYMtguBL7r6r sbRbvwCMnzY0AdjV+sWr4nR26055gW5ONZdDSN/D/C1ckPVchNl9l08liv6ZL+Wker0t dPeeh0Ak6R+5eloCNW4Qsf/5FDC9kpsPnYX9g= 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=1MQZoniAISMMt5/DKGF/VWhkNRaVu+ugSxBxBjNXKSs=; b=nBDn25QzsdM+0kp26cf/lVcjlU4PLwor8Um/OUvDBPay+3LA3RCu9RitlXSq4RQW0T +ejtsIOplhiVOq3qym394SnmrBqkTIaWTeNWdZp7vaiP8+tydJQsvTQFlNZU0rOF6F8e NQDUJbjeM1YeuD012MTkzpwquhuDNDObbPn+GgeXXEjhr4iiD0RzM5CsgolkPPtzGT2V zxiAE+CK/4Bn2JX35qMqQPjLeGEvQnuh3m4STCJpQxQDpeasbNjDbEkOeEwetGRT06Fl sRzXPCQFjJQ2+jc40UEw3Zgs6oo4eDN5gKAAROxwdExKOvPxZPozF3cGRHup7HNVfoIR 2HFA== X-Gm-Message-State: AOJu0YzvRUUmD+zt+o4dNSRPGe1/xPwHYiOmnVRI7Jh2InO2k+U1PKtN /Pvf5QeTva0W1YV/cjfJmL+YTZkYzBZrpBCMQFJPxqhd1N7ZJDH3951mNuOo1FUsu0X1EC/R9IR NDZqNBmdaUVIc/KdKlozYV0vBSZYQ7fCTOuvvOM3X5Kx5GDtpS5e6Q0oQ/hXHVL8bW/QK+0Q/nP m9FmwYVyvtW+O/y2Lovx/LE1v1aetszFfgIombr1kFmtgXnMuQ 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> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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);