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=-5.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 8ED73C433E6 for ; Tue, 2 Feb 2021 19:50:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 615BE64E43 for ; Tue, 2 Feb 2021 19:50:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240073AbhBBTuT (ORCPT ); Tue, 2 Feb 2021 14:50:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240138AbhBBTtL (ORCPT ); Tue, 2 Feb 2021 14:49:11 -0500 Received: from mail-oi1-x235.google.com (mail-oi1-x235.google.com [IPv6:2607:f8b0:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C680C06178C for ; Tue, 2 Feb 2021 11:48:31 -0800 (PST) Received: by mail-oi1-x235.google.com with SMTP id w8so24083940oie.2 for ; Tue, 02 Feb 2021 11:48:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ZSXnsXOh3hBwQ0FBMh5iVZ9JTSULSvhbn6nE2ip4xGU=; b=ZUrCz+B1eGiuxlVYw+vA2x/efphepCu8o71osANOPPpf4+fFruvqtUjr4CEaJTPofL Qr7/U7HE6MO6wYuDZcFbYFAYUbgwLwhA00TTDWsR3PMSyOBwgD0k6PQOc1Z1j7YzME+/ vXmE3O6flEaUv2HFMrjnMnowunrZfdOP1tynDGMCOOZsd0KZBQXtvELYQNAQpUJoWMYj 9WhjCKFI1TiwFuJC8YwppSM9T9xouL/jAyhb9dU709pvBMcIfwsXVIzYVBgkDePnBbk/ 5lEysnoAz5Y+TnA59cZa+CFrcdYHFHo6YriuEzM8pcF9tI2+WgcTOI1EI+kCBY9VcDLA Yhsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ZSXnsXOh3hBwQ0FBMh5iVZ9JTSULSvhbn6nE2ip4xGU=; b=jBWa/V1TWGrI948IX6pyRnYBEaCewWxUH9yHMP6OCRjTl8H5idrhPfggf3MA42ZcU5 VMvcRpXmtG6YGAg0Aaaw9T33pJU7bORjP2vcw+rAFmWcH7jIGm43uLiMIGhrmtR7LVBO H+bHhIZuJj+ykBW3xdjDroPXy1q6HFmEycttK0nIQSV4tBIjX938bMfBwyvbCsH54MBK 9oGO74amK/xHlGE/G7D4U7M2QABdqL2xN47TaoU2nsAY6GsYCfAqAwDl0aK5RmzYLRSG JIjH5tlQiIk7vgTAUajGBOM+Bv+diJ639Ah8GTNn2bYCLaWxewguqjrs1RS6nl+iBEvF WcnA== X-Gm-Message-State: AOAM532NVptsY1FpP8WDJ9rlENZxQFIvE9/mZZGeSf0hXwQ5PR+IU3Jh jYUARVa++nx9eoIDk01qlczQew== X-Google-Smtp-Source: ABdhPJxMbOKdnb0NsWQpRqJsWqS2ZPHN8kvdgzsSEVMxwE9+RCz70zlYR/Iv9MWqZYfjLu5EhXTMdg== X-Received: by 2002:aca:a905:: with SMTP id s5mr3717098oie.5.1612295310681; Tue, 02 Feb 2021 11:48:30 -0800 (PST) Received: from builder.lan (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id r7sm2468593oih.31.2021.02.02.11.48.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Feb 2021 11:48:30 -0800 (PST) Date: Tue, 2 Feb 2021 13:48:28 -0600 From: Bjorn Andersson To: Dmitry Baryshkov Cc: Bjorn Helgaas , Rob Herring , Andy Gross , Arnd Bergmann , Greg Kroah-Hartman , Stanimir Varbanov , Lorenzo Pieralisi , Bjorn Helgaas , linux-arm-msm , Manivannan Sadhasivam , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "linux-kernel@vger.kernel.org" , PCI Subject: Re: [PATCH v2 3/5] pcie-qcom: provide a way to power up qca6390 chip on RB5 platform Message-ID: References: <20210129215024.GA113900@bjorn-Precision-5520> 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-arm-msm@vger.kernel.org On Sat 30 Jan 10:14 CST 2021, Dmitry Baryshkov wrote: > On Sat, 30 Jan 2021 at 06:53, Bjorn Andersson > wrote: > > > > On Fri 29 Jan 16:19 CST 2021, Dmitry Baryshkov wrote: > > > > > On Sat, 30 Jan 2021 at 00:50, Bjorn Helgaas wrote: > > > > > > > > On Fri, Jan 29, 2021 at 06:45:21AM +0300, Dmitry Baryshkov wrote: > > > > > On 28/01/2021 22:26, Rob Herring wrote: > > > > > > On Thu, Jan 28, 2021 at 11:52 AM Dmitry Baryshkov > > > > > > wrote: > > > > > > > > > > > > > > Some Qualcomm platforms require to power up an external device before > > > > > > > probing the PCI bus. E.g. on RB5 platform the QCA6390 WiFi/BT chip needs > > > > > > > to be powered up before PCIe0 bus is probed. Add a quirk to the > > > > > > > respective PCIe root bridge to attach to the power domain if one is > > > > > > > required, so that the QCA chip is started before scanning the PCIe bus. > > > > > > > > > > > > This is solving a generic problem in a specific driver. It needs to be > > > > > > solved for any PCI host and any device. > > > > > > > > > > Ack. I see your point here. > > > > > > > > > > As this would require porting code from powerpc/spark of-pci code and > > > > > changing pcie port driver to apply power supply before bus probing happens, > > > > > I'd also ask for the comments from PCI maintainers. Will that solution be > > > > > acceptable to you? > > > > > > > > I can't say without seeing the code. I don't know enough about this > > > > scenario to envision how it might look. > > > > > > > > I guess the QCA6390 is a PCIe device? Why does it need to be powered > > > > up before probing? Shouldn't we get a link-up interrupt when it is > > > > powered up so we could probe it then? > > > > > > Not quite. QCA6390 is a multifunction device, with PCIe and serial > > > parts. It has internal power regulators which once enabled will > > > powerup the PCIe, serial and radio parts. There is no need to manage > > > regulators. Once enabled they will automatically handle device > > > suspend/resume, etc. > > > > > > > So what you're saying is that if either the PCI controller or bluetooth > > driver probes these regulators will be turned on, indefinitely? > > > > If so, why do we need a driver to turn them on, rather than just mark > > them as always-on? > > > > What's the timing requirement wrt regulators vs WL_EN/BT_EN? > > According to the documentation I have, they must be enabled right > after enabling powering the chip and they must stay enabled all the > time. > So presumably just marking these things always-on and flipping the GPIO statically won't be good enough due to the lack of control over the timing. This really do look like a simplified case of what we see with the PCIe attached modems, where similar requirements are provided, but also the ability to perform a device specific reset sequence in case the hardware has locked up. I'm slightly worried about the ability of extending your power-domain model to handle the restart operation though. Regards, Bjorn