From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 782A8C433EF for ; Fri, 8 Jul 2022 19:09:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238749AbiGHTJR (ORCPT ); Fri, 8 Jul 2022 15:09:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238234AbiGHTJQ (ORCPT ); Fri, 8 Jul 2022 15:09:16 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA02E1D30F; Fri, 8 Jul 2022 12:09:15 -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 945F4B8293A; Fri, 8 Jul 2022 19:09:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9FA2C341C0; Fri, 8 Jul 2022 19:09:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657307353; bh=+NZEyFYPdbr8kXruv6m/Wp64ICTEZTxsYg+7/aEdf78=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=gSBMHeCpq53HUAvj/h+EELkWExteN9Os8rQPs6jm/JxJQxzOrG9Qi5V0Dc6sJnIag VIqW7BjaGaD+VzWvr/V/+63lIFVnlBonGuhQvn29lK5IIvJteFeQrjnSzt/zl9kywM CphmN9BwhAiKUCUUpBk2g10G+TtL6Ibw18U9cGUodzgWAWmh38bPPtvTeF5h2WH1+i q5o0Maojf90EF0EkOGBxXUONQaxPxn/SDamY23ZYVvDLe4tDUJuiEhvBuacfE5rc9J ukhClWOuzy+ginFATtxnLQcXnNoUtKr889rpv+CrvOAtaciqfLKzQy+oEi3/4AyIfL HhPZ1VKsbtaKA== Date: Fri, 8 Jul 2022 14:09:11 -0500 From: Bjorn Helgaas To: Jim Quinlan Cc: Jim Quinlan , "open list:PCI NATIVE HOST BRIDGE AND ENDPOINT DRIVERS" , Nicolas Saenz Julienne , Bjorn Helgaas , Lorenzo Pieralisi , Cyril Brulebois , "maintainer:BROADCOM BCM7XXX ARM ARCHITECTURE" , Florian Fainelli , Lorenzo Pieralisi , Rob Herring , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Philipp Zabel , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , open list Subject: Re: [PATCH v1 3/4] PCI: brcmstb: Add control of subdevice voltage regulators Message-ID: <20220708190911.GA366338@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 08, 2022 at 11:16:08AM -0400, Jim Quinlan wrote: > On Wed, Jul 6, 2022 at 7:13 PM Bjorn Helgaas wrote: > > On Fri, Jul 01, 2022 at 12:27:24PM -0400, Jim Quinlan wrote: > > > This Broadcom STB PCIe RC driver has one port and connects directly to one > > > device, be it a switch or an endpoint. We want to be able to leverage the > > > recently added mechanism that allocates and turns on/off subdevice > > > regulators. > > > ... > > > + * If we have failed linkup there is no point to return an error as > > > + * currently it will cause a WARNING() from pci_alloc_child_bus(). > > > + * We return 0 and turn on the "refusal_mode" so that any further > > > + * accesses to the pci_dev just get 0xffffffff > > > + */ > > > + if (brcm_pcie_linkup(pcie) != 0) > > > + pcie->refusal_mode = true; > > > > Is there a bisection hole between the previous patch and this one? > > The previous patch sets .add_bus() to pci_subdev_regulators_add_bus(), > > so we'll turn on the regulators, but we don't know whether the link > > came up. If it didn't come up, it looks like we might get a CPU abort > > when enumerating? > > I don't think so. At this commit, attempting the link-up is still > done before the call > to pci_host_probe(). Since there is no power there will be no link, > the probe will > fail and pci_host_probe() will never be invoked. Ah, OK, thanks for the explanation. > > I think we should split out the refusal_mode patch: > > > > - Add refusal mode > > - Add subdev regulator mechanism > > - This patch (which would then be clearly about managing regulators > > in suspend/resume, IIUC) > > Will do. If it's not too hard to do, I think splitting it will make the patches easier to read. Bjorn From mboxrd@z Thu Jan 1 00:00:00 1970 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 39CCDC43334 for ; Fri, 8 Jul 2022 19:10:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=S7behagBKhYd2dacwSm1ay8KdalCjrRsaAZc5zzC5YY=; b=pRCOaA1aQQEVUI NFv0dYjquW5ZG6ZV9ZNa/63dUf0cg0bNp024NKDl9LeDai3j5jvn/o+lu+iZd+VnTl7L/4t+0PKtw sGiu5auCNtnuSQcirhVzfegmeulH/LrBk069vZHPsSTmsnh/yp5i+tAcy8ikSlO3ozQ8CeitTQZJU DbRtVRSoSDtgcOPOv2h3ZH4bsPfXqpduqezBR3I14Mn9beaUQB5Yq5YK/N1veKkOFdaJqM4p+uMzH VMJQ92Ng9naFxwfYL1tkr7ao5XDg3LJ4IbxXwTNfUV76TBvSoQQm14/c7Zvs/WAABI9gsMWwYU4S1 DRs4Ki0AS2DQ/cIwj4Rw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o9tLq-005YEm-QV; Fri, 08 Jul 2022 19:09:18 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o9tLn-005YCt-A0; Fri, 08 Jul 2022 19:09:16 +0000 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 CFA8762729; Fri, 8 Jul 2022 19:09:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9FA2C341C0; Fri, 8 Jul 2022 19:09:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657307353; bh=+NZEyFYPdbr8kXruv6m/Wp64ICTEZTxsYg+7/aEdf78=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=gSBMHeCpq53HUAvj/h+EELkWExteN9Os8rQPs6jm/JxJQxzOrG9Qi5V0Dc6sJnIag VIqW7BjaGaD+VzWvr/V/+63lIFVnlBonGuhQvn29lK5IIvJteFeQrjnSzt/zl9kywM CphmN9BwhAiKUCUUpBk2g10G+TtL6Ibw18U9cGUodzgWAWmh38bPPtvTeF5h2WH1+i q5o0Maojf90EF0EkOGBxXUONQaxPxn/SDamY23ZYVvDLe4tDUJuiEhvBuacfE5rc9J ukhClWOuzy+ginFATtxnLQcXnNoUtKr889rpv+CrvOAtaciqfLKzQy+oEi3/4AyIfL HhPZ1VKsbtaKA== Date: Fri, 8 Jul 2022 14:09:11 -0500 From: Bjorn Helgaas To: Jim Quinlan Cc: Jim Quinlan , "open list:PCI NATIVE HOST BRIDGE AND ENDPOINT DRIVERS" , Nicolas Saenz Julienne , Bjorn Helgaas , Lorenzo Pieralisi , Cyril Brulebois , "maintainer:BROADCOM BCM7XXX ARM ARCHITECTURE" , Florian Fainelli , Lorenzo Pieralisi , Rob Herring , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Philipp Zabel , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , open list Subject: Re: [PATCH v1 3/4] PCI: brcmstb: Add control of subdevice voltage regulators Message-ID: <20220708190911.GA366338@bhelgaas> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220708_120915_413630_BC0FF949 X-CRM114-Status: GOOD ( 28.67 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Jul 08, 2022 at 11:16:08AM -0400, Jim Quinlan wrote: > On Wed, Jul 6, 2022 at 7:13 PM Bjorn Helgaas wrote: > > On Fri, Jul 01, 2022 at 12:27:24PM -0400, Jim Quinlan wrote: > > > This Broadcom STB PCIe RC driver has one port and connects directly to one > > > device, be it a switch or an endpoint. We want to be able to leverage the > > > recently added mechanism that allocates and turns on/off subdevice > > > regulators. > > > ... > > > + * If we have failed linkup there is no point to return an error as > > > + * currently it will cause a WARNING() from pci_alloc_child_bus(). > > > + * We return 0 and turn on the "refusal_mode" so that any further > > > + * accesses to the pci_dev just get 0xffffffff > > > + */ > > > + if (brcm_pcie_linkup(pcie) != 0) > > > + pcie->refusal_mode = true; > > > > Is there a bisection hole between the previous patch and this one? > > The previous patch sets .add_bus() to pci_subdev_regulators_add_bus(), > > so we'll turn on the regulators, but we don't know whether the link > > came up. If it didn't come up, it looks like we might get a CPU abort > > when enumerating? > > I don't think so. At this commit, attempting the link-up is still > done before the call > to pci_host_probe(). Since there is no power there will be no link, > the probe will > fail and pci_host_probe() will never be invoked. Ah, OK, thanks for the explanation. > > I think we should split out the refusal_mode patch: > > > > - Add refusal mode > > - Add subdev regulator mechanism > > - This patch (which would then be clearly about managing regulators > > in suspend/resume, IIUC) > > Will do. If it's not too hard to do, I think splitting it will make the patches easier to read. Bjorn _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel