Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp5838465imw; Wed, 20 Jul 2022 13:40:46 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sl9sxvPdTcmbGkTkNK7isWAI/ejIWGOT8AbOq+9WkA26LQ7SjLlixT6X4PFVFD+ezBaViq X-Received: by 2002:a17:90b:1d8a:b0:1f0:6083:5d80 with SMTP id pf10-20020a17090b1d8a00b001f060835d80mr7327528pjb.147.1658349646103; Wed, 20 Jul 2022 13:40:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658349646; cv=none; d=google.com; s=arc-20160816; b=LtYc2jymDTjS1o23/zhvtAIDCKDa7XIEGAWqw+4glZS23IHqy4/+JBbEPUwM2l/E5k HIL0DhkAyHdNHp7lpAiQlq7G+2ENax4ovEbfYcagTg9Kz4HJMRGf6gcua5nI4AXlbQMB 2SUy8oVvHxRwnJnyAWELzEgrlIHlVuBDqX0b7Frs1CN5hnidMd2dVNWphlOmSE8rWDu+ fbFz0uSSw43De4ZyfMIeHa2rmVKFfSwQCXTWyBmWTIqK9b7h98nkADy2Sqe7saXJu1T6 ebrJvWjZT9cB6wM4TBC/MFakH3GqmV0kfmZeWqrWzKmfE8A0oi7lKupNoUdSfUPpHThc RP+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=mhhrfW3oR1FB2AyLyVuW7pz3HcjF1Rg+D3rjH/Wp+yk=; b=MokzeepYFnNCuUd0UB/dMSUcgwy4MEKasQtXt0R9kS2MOiiFUXeO8pESK2D9xDLpSw b6oAFAISSNeufM5WMgepY+QH/t2XYmlCwlFiZArpGTSgCr74exCGHM7OxVnJJnmd7Bv0 cEe3oV3L8tZuI8P7tJXJ7S01TrOn4WxKlP812Z1uh2NwdEAshFENhEYL21BFDtVuc1Lt q3kVy+mL8vixSRxtHwkNFbiBIzCMrrkDy6ILPvkjKZta89IL58r+aqXKQPUYqJ2N+MwP dy9rIjlIfMbKCdFojc1L2cOB4kuMG6qoLOAkDaJWoDemLBlr4HSjjBSDHF3FEd4KxVpr 8CoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jMAx2T3K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t22-20020a056a0021d600b0051964d16f32si167101pfj.180.2022.07.20.13.40.30; Wed, 20 Jul 2022 13:40:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jMAx2T3K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229523AbiGTUhL (ORCPT + 99 others); Wed, 20 Jul 2022 16:37:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbiGTUhJ (ORCPT ); Wed, 20 Jul 2022 16:37:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B69418E1E; Wed, 20 Jul 2022 13:37:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 12ACE61CBB; Wed, 20 Jul 2022 20:37:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4630DC3411E; Wed, 20 Jul 2022 20:37:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658349427; bh=7PpBRv20MvSwwE36jMplF6JP0iKXxREOK8LZEaor688=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=jMAx2T3KOeZbhoBtYHqIwmEVTobmpeXTtp999f/G+GjFUkZPwlQBR+OBog38tBgJU q1LOLTUmlq6cBIZmoM7azA/nb0LXgzjM3AV/YmfrZOAZI+THEjnWIfOgAPfx7AQWXc 5BCjiLggpScM0Zx1Ml7T5/hCU7TTOw+U0rMkAyV2DRHHK81ZQrLninPD15othpv4HB 2VWsRzC11A7tk9m/n28R4+d2liQywt8OB4SvK2x4FdvRqBTAjSFCYKmCV9s/ZqOXMx D1XIGIT1Ci3jMSu05hNJxs93f3TRymkZFCwpfaWboobEzGH2BpMyWUR6/wD+FGwts4 1FtgbYp8na7iQ== Date: Wed, 20 Jul 2022 15:37:05 -0500 From: Bjorn Helgaas To: Jim Quinlan Cc: linux-pci@vger.kernel.org, Nicolas Saenz Julienne , Bjorn Helgaas , Lorenzo Pieralisi , Cyril Brulebois , bcm-kernel-feedback-list@broadcom.com, james.quinlan@broadcom.com, Florian Fainelli , Lorenzo Pieralisi , Rob Herring , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , open list Subject: Re: [PATCH v2 2/6] PCI: brcmstb: Split brcm_pcie_setup() into two funcs Message-ID: <20220720203705.GA1654821@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220718224033.GA1450714@bhelgaas> X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 18, 2022 at 05:40:33PM -0500, Bjorn Helgaas wrote: > On Mon, Jul 18, 2022 at 01:14:25PM -0500, Bjorn Helgaas wrote: > > ... > > > So I think brcm_pcie_setup() does initialization that doesn't depend > > on the link or any downstream devices, and brcm_pcie_start_link() does > > things that depend on the link being up. Right? > > > > If so, "start_link" might be a slight misnomer since AFAICT > > brcm_pcie_start_link() doesn't do anything to initiate link-up except > > maybe deasserting fundamental reset. Some drivers start the LTSSM or > > explicitly enable link training, but brcm_pcie_start_link() doesn't > > seem to do anything like that. > > > > brcm_pcie_start_link() still does brcm_pcie_set_outbound_win(). Does > > that really depend on the link being up? If that only affects the > > Root Port, maybe it could be done before link-up? > > What about the /* PCIe->SCB endian mode for BAR */ thing? Does that > depend on the link being up? > > And the "Refclk from RC should be gated with CLKREQ#" part? Does that > depend on the link being up? > > It seems obvious that brcm_pcie_set_ssc() and reading the negotiated > link speed and width depend on the link being up. Can we close on this? Splitting into (a) stuff that can be initialized before the link is available and (b) stuff that depends on the link makes good sense, but then (b) should only contain stuff that actually depends on the link. The "PCIe->SCB endian mode for BAR" *sounds* like something related to the primary side of the RP, not the link. Not sure about "Refclk from RC". RC would certainly be primary side, but ASPM has to do with secondary (link) side. Bjorn