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 X-Spam-Level: X-Spam-Status: No, score=-12.2 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 903A4C64E7B for ; Mon, 30 Nov 2020 21:33:46 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 149112073C for ; Mon, 30 Nov 2020 21:33:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="LEuwYqyZ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fhDgfe13" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 149112073C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=btNRrJWlUQRNY4PKBdQhvPS4BymX5lVbwQF166yVecA=; b=LEuwYqyZqhVh3v3edC6UqxFdD wtllcweSi/R5tPu3Mjtb1G7RB50mZozzuRJPPN7mA4+Rhn2kUs1ZzkK2An5+ApvydF0nl+HCi+r+A B7zoByft+QDvf9CGgauEJBE6PaD7hXUVhXoYYKqq6NBkC97bbCEjYHlrA2BNCIyeoH5ofRn3Hn5C6 NqbnhQAPFeuWaQjv15iZj9gM+Dsu4h7T08TpFkparhDCABFW7lya9npzU+MNZqRIsBGbMBdsuZcyt xqYG3g4ZeDcW6LqFc9DaBAA8K8hBZBLKXmJQdgp8hSEUftXBqcZS13p2t/2VYe+D58Nfy1Ui9PE1S 6U8+Ymbww==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kjqmg-0007uK-QU; Mon, 30 Nov 2020 21:32:34 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kjqme-0007tV-6M; Mon, 30 Nov 2020 21:32:33 +0000 Received: by mail-pf1-x444.google.com with SMTP id s21so11245545pfu.13; Mon, 30 Nov 2020 13:32:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=DctpeWixZedWLIe9T1LbBcTwsFUdxzd0r0hcVxTsfr4=; b=fhDgfe13+5vMBwPhR0Nm2sF7yPR7/+YZoRNFjaqMM7xSuS4dxZAZkL8BAxiJPjw7Uz muVv/yv9OoAvarZvE2MaNg7uRQZhilkPFRchY7flcG/cBaJQonzi6nvEYXn7CqYyhmJI 5WPQOU73USzJSQGTE7FPg9jZhFYsmHw7dJzYvXElsfHM84oiht/u0v55r0X+o3p1ZwWf OKUk3nR9c41R6ZOrfVOAIjvHuuwXW7SG2vvxjzKoupv9CFkc4mwEFjZEXW0FouVgdoVV x9TNy5PFJt1srUFgIRosrbsEQQInyQYEN028L/Y3WG0UmUnpX4vaMBbeoy5GsdgrN6VY lKbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=DctpeWixZedWLIe9T1LbBcTwsFUdxzd0r0hcVxTsfr4=; b=bIyt2K+yKlUFGAnVGpUmygpcuUHdTKnMAya/ffpkxjrcks/TjGWYRgNdPkZKHS3M6F NSiLH7HSE0iDQVtxiK3i9z11gIROHO+anNd5f9u7qJZyuZ2iOnXNGTNASh9VF5mNhYa+ AArGRgYt6YyMGGMpDZLLW9ajcxr0KAoDyWozI2lf72DODLyXmGPPyYMTZj1VAZUwBPHF vuhBjuz6TY89ANcfWHG3HA0sUn6Hphzb6yke6HDPKL7dv4VctYd6/7+pnEX2hIGIp20X SouwK71e+pgLSsbaQK33R/eeJ1ZmPBrA3a+SWR1KEZzUt5AllpMWn+jlnvGCGAb2Gwso YNNA== X-Gm-Message-State: AOAM533FEcsTD6P7Q8f5+nNxlEZSYsJn24mD3Oz+xgCAy3UGiDHYZIhP P7sftKDOc3TPWc/wCQo8Tco= X-Google-Smtp-Source: ABdhPJxfDZPbPmlCJKGaCYMq+K75fM2nT/D47wgF9HTC6Hmxau6KgM2AqO9qnbgPZgA1WpXm9fCSIw== X-Received: by 2002:a63:c944:: with SMTP id y4mr19792249pgg.435.1606771950226; Mon, 30 Nov 2020 13:32:30 -0800 (PST) Received: from [10.230.28.242] ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id i13sm17470708pfo.139.2020.11.30.13.32.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Nov 2020 13:32:29 -0800 (PST) Subject: Re: [PATCH v2 2/6] PCI: brcmstb: Add control of EP voltage regulator(s) To: Jim Quinlan , linux-pci@vger.kernel.org, Nicolas Saenz Julienne , broonie@kernel.org, bcm-kernel-feedback-list@broadcom.com References: <20201130211145.3012-1-james.quinlan@broadcom.com> <20201130211145.3012-3-james.quinlan@broadcom.com> From: Florian Fainelli Message-ID: <154a809d-9320-f0a1-45ad-78af0303a9ac@gmail.com> Date: Mon, 30 Nov 2020 13:32:26 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <20201130211145.3012-3-james.quinlan@broadcom.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201130_163232_288481_59D6A1B5 X-CRM114-Status: GOOD ( 21.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Herring , Lorenzo Pieralisi , open list , Florian Fainelli , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , Bjorn Helgaas , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" 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 11/30/2020 1:11 PM, Jim Quinlan wrote: > Control of EP regulators by the RC is needed because of the chicken-and-egg > situation: although the regulator is "owned" by the EP and would be best > handled on its driver, the EP cannot be discovered and probed unless its > regulator is already turned on. > > Signed-off-by: Jim Quinlan > --- > drivers/pci/controller/pcie-brcmstb.c | 38 ++++++++++++++++++++++++++- > 1 file changed, 37 insertions(+), 1 deletion(-) > > diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c > index bea86899bd5d..9d4ac42b3bee 100644 > --- a/drivers/pci/controller/pcie-brcmstb.c > +++ b/drivers/pci/controller/pcie-brcmstb.c > @@ -23,6 +23,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -210,6 +211,10 @@ enum pcie_type { > BCM2711, > }; > > +static const char * const ep_regulator_names[] = { > + "vpcie12v", "vpcie3v3", "vpcie1v8", "vpcie0v9", Only if you need to re-spin this patch series, I would be keen on putting each string on its own line, that way when adding a subsequent regulator name, it is just a matter of an one line d > +}; > + > struct pcie_cfg_data { > const int *offsets; > const enum pcie_type type; > @@ -287,8 +292,25 @@ struct brcm_pcie { > u32 hw_rev; > void (*perst_set)(struct brcm_pcie *pcie, u32 val); > void (*bridge_sw_init_set)(struct brcm_pcie *pcie, u32 val); > + struct regulator_bulk_data supplies[ARRAY_SIZE(ep_regulator_names)]; > }; > > +static void brcm_set_regulators(struct brcm_pcie *pcie, bool on) > +{ > + struct device *dev = pcie->dev; > + int ret; > + > + if (on) > + ret = regulator_bulk_enable(ARRAY_SIZE(ep_regulator_names), > + pcie->supplies); > + else > + ret = regulator_bulk_disable(ARRAY_SIZE(ep_regulator_names), > + pcie->supplies); > + if (ret) > + dev_err(dev, "failed to %s EP regulators\n", > + on ? "enable" : "disable"); Should not you propagate the return value to the caller here? -- Florian _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel