Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp726004pxb; Tue, 2 Feb 2021 16:49:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJwS2OoB+o9BSba+81/yK3xSiUiPhmQUNy+FEhuEO8qqUyc6Tbk0kPPwwH1unMtK7GKhLoU5 X-Received: by 2002:a50:fd84:: with SMTP id o4mr649682edt.340.1612313382058; Tue, 02 Feb 2021 16:49:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612313382; cv=none; d=google.com; s=arc-20160816; b=rZx9KK0f1/n0TjW5UBiVPjSv6BxljW37pcLHpHyg+Amy8gKac4TBkbelYoXUOdL6rF OLJu4/wrMH36BeNctXipnaKy1cFt9n3F7YKaQUSqE9sA7FfZQb9ucrbk4oqGuCo3q9O5 lO6EmWRd/EUmqhkbIKpDrWtc8r97VTGFst/BI8hm0jJpwtWGlxp8mOK+PTmXvs7Eqp56 vxjWoF6hvKevoTy01QlM/v/5jqTuPTNV9B7eQCrt33olsOs0kuGyea40YgzEFli857rS Bo9vq/W7p5RFtT38KB5E3Hhcqc38MJZRpP7oE0tu3tNLjUSknKk93grwcBcyC2jQI1+9 ElmQ== 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 :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ZSXnsXOh3hBwQ0FBMh5iVZ9JTSULSvhbn6nE2ip4xGU=; b=zWtZilXi5mNE6fU1iheCLD26MGXFyMR0RyTOxQLj2Vy3Oo5h8zhmNjOAL4g3jl/Q6j bEcAPvTcZOMKhAWZkWMJlbLNXyRdVSheS52CxvLaKKeHKd6EHBd/0W4ktu0qy6ogea/j gJRQ4YAg25FjneGnyPXSkZ9veT9aHy5lgjvZylcVjaSRfvffcDMzdSxtxQ2l769ZkBOY MPhz0PPCEp5rmbsEVdaJl4ErQx4OvERNVAnQUOl38RQHB5QsVhCgkt1Ujzmpk+VT0l9b 1pPh3Vp96B/aawr268x1bz5qmDbXTtFkpgzxwJDDXV6Wk0RCDLRWmKBa3NHDFvKis+fO DwUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZUrCz+B1; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x2si268757ejn.747.2021.02.02.16.49.18; Tue, 02 Feb 2021 16:49:42 -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=@linaro.org header.s=google header.b=ZUrCz+B1; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240079AbhBBTug (ORCPT + 99 others); Tue, 2 Feb 2021 14:50:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240136AbhBBTtL (ORCPT ); Tue, 2 Feb 2021 14:49:11 -0500 Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A77DC06174A for ; Tue, 2 Feb 2021 11:48:31 -0800 (PST) Received: by mail-oi1-x22a.google.com with SMTP id g69so24050812oib.12 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=t9eKkQnRm7RQiHNh5gxch1Kh4uImFnw9CsFIUDK5tp0SsmQ4ZvBYF+wN1sVRnOKD98 Py2XW7rycMrGHhfA6HIWOb8ZC1a5p5yIFrj+920HcDvzY2gOpbJ9H7bL0AsdK6/2k6eI oLtGX8HQ2QRbsKRWrPvb9DU8o2kVUjQuzlgt1rUbHUQKGbRK1GzYqLf8PQGV6FATPmBW f1GR7V0SYd18wQd+/Z+ibAKo4bcbJrO88daI9hLwj7eg3xFSpkEQOUT4axlH/lVOmvwb A9M92tFG3nGz7jMpePIa12FJvqBRHgnk8usaWVxhcLfbGJhEQSsowV9s5AlSTv5LEQuy Raww== X-Gm-Message-State: AOAM531ReCr4QMsxehLRTeOesHCom+txonCIwVvySyAsFDlYntIbEcjf BSlk7n1K9zlPk3vHx9Tr3SeM5Q== 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-kernel@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