Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3838987imw; Mon, 18 Jul 2022 15:43:25 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vyI87Gtvq5f6bWWZe1rdhkcWEVfYkVFsRtcNCtPw6FZvXWkaCRit1kwndBhs787kJJJmTy X-Received: by 2002:a17:907:2c4a:b0:72b:5b9b:9c50 with SMTP id hf10-20020a1709072c4a00b0072b5b9b9c50mr28387159ejc.636.1658184204815; Mon, 18 Jul 2022 15:43:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658184204; cv=none; d=google.com; s=arc-20160816; b=PtLR6SXnvun7XB+hvvFOuaddnNWth1/IiQ6U1A1ISYriLhjEItkg8OCmwCLB4aoHFS R7YDull200mcy7CrhG2O9GVzMMbZ6PsSGYFEATp4SlxpTtudIZky0CCKEcHLVh8XZjys RbMuB72GuUCl4ltUX9F8tHuMuu8+iV0caRv5rHKbKnIDtA8tUq3h5YIYgsmdLfSJMpqW BOfmWdFZ6aFFJy/oK5O1r/VCuJozo01JPOE8ZmLp1W2tGTg5hfOxY90ONqHEhIC1rcHg FzmSF4EjhpWPPXDE9q/Hz9DaylL+pE4DNhvvefI1GxbW7RZmpnqLPeNqRUSuozvKf7JR rK3w== 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=yKmFL9YVDRZppSWmo8ACjR6DCOP9XleXCP46PKQlcE4=; b=Uv/TDCylMrEyD68s+cUki9joUGWfqZE0IW89x7Bmbc4ISbJdRLYGWh+ZBrLrdb8LrX s6TgYNEycWCNz/sSjV97JiX1NQLaX2i6mhcs7j8QYxn7riM/LkohzJOAkqicCkctyIwu Gd9gPMVJ/gpsxYj0UgCNXuH3DY3z87zDRJaWcVqx9BxePANdpvoNeObPq+kJb3b0IqWS NBBSm0EJLurY+h5aGJPEI1ai3l8RELsWiWAiWrPNuusOdXXbmkN43ktlpxYUfdS+4HHR prNL36rVwHyv8iTFxph/1iIRy8f/FnwzseLQiV11eo7r9DFHKUKV6MYUbZJLhBUtjHLk qJQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="mIGa+9/u"; 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 r4-20020a170906280400b00722e3682c3bsi15332712ejc.257.2022.07.18.15.43.00; Mon, 18 Jul 2022 15:43:24 -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="mIGa+9/u"; 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 S235380AbiGRWkl (ORCPT + 99 others); Mon, 18 Jul 2022 18:40:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234908AbiGRWki (ORCPT ); Mon, 18 Jul 2022 18:40:38 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29A622B261; Mon, 18 Jul 2022 15:40:38 -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 ams.source.kernel.org (Postfix) with ESMTPS id D37CBB817B7; Mon, 18 Jul 2022 22:40:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3FD2AC341C0; Mon, 18 Jul 2022 22:40:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658184035; bh=lhU/JExpOSEKJDInQznDy3qsN7c7UqcbEHd+FzPXqEY=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=mIGa+9/u5W3L/ehTjMVx+iDuDXxtClxxVs/tEEqzi6L2SMBrbXpEsILTlVtT8QEM4 QU1qVnB5+99Ra+nMwQvonth+j0hA2QIOPFslDc1FJ3zS33EKqr6s3Ks7vicDJaXz4O YvUQ5IA429Ano35x+TQwWNs3+Vy+dYLAX56jDp0hTvbT+q770IHcTsVKN+8LCQmVyk tWVm/BNZNknkXqHL6+tuFaD9H7l/poj2ON2M2pYr5maaldeIEXDD5yKCyXlpfzfeNi vUY11fMIDYUjNSzLZenS8Qzq1K0E+O0wiBEJNLBZyIcPbwk1QMUGbHe6gxMkz7FPuf T5iyd3OMRLhlQ== Date: Mon, 18 Jul 2022 17:40:33 -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: <20220718224033.GA1450714@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220718181425.GA1431580@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 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.