Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1706511pxu; Fri, 27 Nov 2020 13:17:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJzu+agqQOUDdn0n5Cjpc3f1D5D3+pRVdIlW8AhKKOEBm5RUEpa5mcNo/GkmK/2AZoQ/8/AN X-Received: by 2002:a05:6402:48d:: with SMTP id k13mr9819938edv.92.1606511820094; Fri, 27 Nov 2020 13:17:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606511820; cv=none; d=google.com; s=arc-20160816; b=AFdiCMq5WZl9X8uLDqfcu8Va+sB+VUc5yYYf/LILt7YReOYHkGiuAKCs28H6ZKK4Nb ZkxG+HuhzAGRIntCyY/2VzrMDiyiq3YzdKNse1cle4m7CB0qoh6YfELcLTdbTrWprok8 uoWXu44kIsIWUn3R+Tc343IavyYnGXHcWmkJ8G1cdBXqfyawYrENWnScM2x7IP4N2uf/ kJvGuKHy+dNA3Umb2jbkExhepTo64rwiiMtIFKYIJiwE2GqPGH7L5tjbk6lmIVsaumDy FBv6Xx8YXyjXKM3goyNJy6Xp1oyX4WJabOUxZpYT5mV2sbs0T3oXuQfqu4Z/87FxhGeF /j0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=99dxDuHuVdg60PLnZPbJIUpm+VSqbSocEKra7YZr6YU=; b=eIW4ZC6+2ZlmcSBea4xrS5NQwzQAyGJwNobVJqoeDYPsCWsCfhj1H77eXHNv5NhyEE EBvkU+caSFRTE6K/KRLdhbbwumNJ1U6//gI4HML7RekV9h3PNS8hy/QK0krAyB9oZxMW J4LduH+iieltMMAp/BwPl0zX1x55IDvm6eS0Y7j5gwKxgMtF+swSq7I1I2H2ohrqzcJt qkIKcbjqH7bE3xHCOq4MZno1Orx7Yk7O6RHEp3zCzcqbmAcIyt+LEP/BvrnoMT3kT/9f 2Y7XbCv1l3f2SDeVcHYW6MnuGTBWBeT9obVfuUyU3PSkm32xa8lmGyewDtbjFUpmUIKo u0bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=hwXRfjuv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j6si6481362edn.551.2020.11.27.13.16.37; Fri, 27 Nov 2020 13:16:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=hwXRfjuv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729619AbgK0UvH (ORCPT + 99 others); Fri, 27 Nov 2020 15:51:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731634AbgK0U1S (ORCPT ); Fri, 27 Nov 2020 15:27:18 -0500 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26202C061A49 for ; Fri, 27 Nov 2020 12:27:12 -0800 (PST) Received: by mail-wr1-x443.google.com with SMTP id m6so6775366wrg.7 for ; Fri, 27 Nov 2020 12:27:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=99dxDuHuVdg60PLnZPbJIUpm+VSqbSocEKra7YZr6YU=; b=hwXRfjuvyvwVXyKwjzK8qb7GWEeaDkY2Vttu70UTMKTI4v3OgSpaD6rSPhuj9AxlK5 5y0RicGth2nUwAqEEg5p2BlLG1A6eRwbxXcku/l9Ecm5xKgaemfmo14RocBRS/W1c9HR gjTCcAfAJu2KT0+dTxS4QC3hjFtp+K7vzNWvs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=99dxDuHuVdg60PLnZPbJIUpm+VSqbSocEKra7YZr6YU=; b=HMfH7tW74lGWRWuBYCaXZmPjVFBpp5ZuIhLq88kX/tZivxVT2XtvaUaO4qXoyEwEhY BC0rSoCfmYwx9StiN7Uxil3c4eulC/T3ObQG5Jmz00nskthfhiXJOSjdXJ3PStNUKQcr wRf3zaj0WOkg1GL3WjO6SN0npwpjFk5IYQjOIU+WKOiokpGAkVnmJ5X+hyzh/m5AN2rG 04xu3N4+S6rDdDukdSNlUgi8e+bANUk3bN78y10N/Ws0/xwfhT8JlhQ0u2EQr0WlhP8d hWbVi7qymPZhZGmumi/CMKqotZx6YMN2KoNRhhjXM8DiP7iC+UyXFU969MrP6n7eneiU IVzw== X-Gm-Message-State: AOAM530GRPE+KkCro0yVqljs3A/un0w2AhJyJo2GaX5XcBbn1Gg0s8T/ x0eNgJhZoG7VtbM4vQHZ7EAw474FgTf+cpbtEXGYNA== X-Received: by 2002:a5d:5552:: with SMTP id g18mr12960850wrw.145.1606508827510; Fri, 27 Nov 2020 12:27:07 -0800 (PST) MIME-Version: 1.0 References: <20201125192424.14440-1-james.quinlan@broadcom.com> <20201125192424.14440-3-james.quinlan@broadcom.com> <20201126114912.GA8506@sirena.org.uk> In-Reply-To: <20201126114912.GA8506@sirena.org.uk> From: Jim Quinlan Date: Fri, 27 Nov 2020 15:26:53 -0500 Message-ID: Subject: Re: [PATCH v1 2/6] PCI: brcmstb: Add control of EP voltage regulator(s) To: Mark Brown Cc: "open list:PCI NATIVE HOST BRIDGE AND ENDPOINT DRIVERS" , Nicolas Saenz Julienne , "maintainer:BROADCOM BCM7XXX ARM ARCHITECTURE" , Lorenzo Pieralisi , Rob Herring , Bjorn Helgaas , Florian Fainelli , Liam Girdwood , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , open list Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="00000000000034884805b51c7ca8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --00000000000034884805b51c7ca8 Content-Type: text/plain; charset="UTF-8" On Thu, Nov 26, 2020 at 6:49 AM Mark Brown wrote: > > On Wed, Nov 25, 2020 at 02:24:19PM -0500, Jim Quinlan wrote: > > > + for (i = 0; i < PCIE_REGULATORS_MAX; i++) { > > + ep_reg = devm_regulator_get_optional(dev, ep_regulator_names[i]); > > + if (IS_ERR(ep_reg)) { > > Does PCI allow supplies to be physically absent? If not then the driver > shouldn't be using regulator_get_optional() and much of the code here > can be deleted. Hi Mark, First, as an aside, I'm a little confused about the purpose of devm_regulator_get_optional(...); the other xxx_get_optional() calls I am familiar with (eg clock, reset, gpio) return NULL if the desired item does not exist, and then NULL can be used as a valid pointer for the rest of the API. Not so here. At any rate, our SOCs are placed in a variety of boards which implement the PCIe RC-EP connection as they wish. From the PCIe driver's point of view, the type of power supply that needs to be turned on is specified in the DT and they cannot be hard coded by the driver. I've listed all of the four possibilities; typically one, maybe two will be specified, but never all of them. In addition, sometimes a regulator is hard wired on and not even controllable by the PCIe controller. > > > +static void brcm_set_regulators(struct brcm_pcie *pcie, bool on) > > +{ > > This is open coding the regulator bulk APIs. Except that a bulk regulator "get" requires that all supplies are present. I would have to first scan the node's properties for the "-supply" properties and fill in the bulk regulator structure. I'm fine with doing that. However, a previous incarnation of this commit was reviewed by RobH, and if I understood him correctly he wanted the actual names of the possible regulators to be used and specified in the bindings doc. I just followed the example of "pcie-rockchip-host.c" whose bindings doc was reviewed by RobH. Regards, Jim Quinlan Broadcom STB --00000000000034884805b51c7ca8 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIIQQwYJKoZIhvcNAQcCoIIQNDCCEDACAQExDzANBglghkgBZQMEAgEFADALBgkqhkiG9w0BBwGg gg2YMIIE6DCCA9CgAwIBAgIOSBtqCRO9gCTKXSLwFPMwDQYJKoZIhvcNAQELBQAwTDEgMB4GA1UE CxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMT Ckdsb2JhbFNpZ24wHhcNMTYwNjE1MDAwMDAwWhcNMjQwNjE1MDAwMDAwWjBdMQswCQYDVQQGEwJC RTEZMBcGA1UEChMQR2xvYmFsU2lnbiBudi1zYTEzMDEGA1UEAxMqR2xvYmFsU2lnbiBQZXJzb25h bFNpZ24gMiBDQSAtIFNIQTI1NiAtIEczMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA tpZok2X9LAHsYqMNVL+Ly6RDkaKar7GD8rVtb9nw6tzPFnvXGeOEA4X5xh9wjx9sScVpGR5wkTg1 fgJIXTlrGESmaqXIdPRd9YQ+Yx9xRIIIPu3Jp/bpbiZBKYDJSbr/2Xago7sb9nnfSyjTSnucUcIP ZVChn6hKneVGBI2DT9yyyD3PmCEJmEzA8Y96qT83JmVH2GaPSSbCw0C+Zj1s/zqtKUbwE5zh8uuZ p4vC019QbaIOb8cGlzgvTqGORwK0gwDYpOO6QQdg5d03WvIHwTunnJdoLrfvqUg2vOlpqJmqR+nH 9lHS+bEstsVJtZieU1Pa+3LzfA/4cT7XA/pnwwIDAQABo4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