Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1233804ybi; Fri, 31 May 2019 16:28:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqzVGr8i4XpSA3rAC7Wsg1wqAN8Juv7ExJ4nBuFwLq1FADi7rXVOCNZwgCYFfFMAQWOZtuly X-Received: by 2002:a17:902:b682:: with SMTP id c2mr12851321pls.9.1559345325602; Fri, 31 May 2019 16:28:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559345325; cv=none; d=google.com; s=arc-20160816; b=wPAIFwXJNK405R6DteOUwNQpT7FOPR5T0B1q4Z72ZeTcDKgyaK549+WG/cqYfsCqEb sBTR4QBG7Y40YO+JGsDgXlVdJzdGI0f8JRmoCoqOz6DDhTu/vCZ4ymyt56X8g74HfWD6 4hJXCyLep3YozWWOTPr0xRlgZ0f8fuK7Oiw5nJVfjP0PEHmjCcOVbUex9WivnVNIwipg aU4Pyvo+sPrFwQHeDYXlfSvGZv3QblYYfZpo0SfU2nRTh24ZN56k1lwcvWIQ8k8m53Yt +QDpp+yRvjYBOBjjORuPtFua3V1Isgjs7FL+cFDJPfTPUqZlhU30ncWllmyCOm4a8EqQ doVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature; bh=IjWknxF+MT+pqYMz9ZzVkiJnt69fefCa6nXkl8WnRPk=; b=m8GtpwN74wCD1wgLNdL12Vw5iR3wp4UqJPBT3X5F/OHrb1CP2EnZs/0F/2MqAFKlOo MXXIV20aIQKEHNVCZODw290CNEbkyNehkTf/LUyBI3JbrN/6rBlQDgL7MI8TdXURkJp6 DctnIjxBtvAcAGSFELkg03z5NWxRRZuv0hT911Yd6yqUBz351MwuCinTOTbjUeV5ZeZH CFGAahta99v9Hzj6+U+7CGK/mi7I47GFzoIVdDb7agnAPL69n8/j7ySjVlRC+VKqC7VK QXZX+OyzZiZT+f8uqcAOkWu6Cv6pLDGs7USLIL8BJRc7OwM4gs2B78X0SO3Z2wDZyHku Q8hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=HMQpuwDh; dkim=pass header.i=@codeaurora.org header.s=default header.b=doB6uQl3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 6si8758158pfe.21.2019.05.31.16.28.25; Fri, 31 May 2019 16:28:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=HMQpuwDh; dkim=pass header.i=@codeaurora.org header.s=default header.b=doB6uQl3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726831AbfEaX1O (ORCPT + 99 others); Fri, 31 May 2019 19:27:14 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:45546 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726609AbfEaX1O (ORCPT ); Fri, 31 May 2019 19:27:14 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 990036077A; Fri, 31 May 2019 23:27:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1559345232; bh=G6EhyJ9g00tRI9kO08bdec8G8ptEPWdzLzRXpkaiZXw=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=HMQpuwDh+9qbjOD9qj9hSuH2aXcDmskIgDowXZJDqywcWgZvC1RqLZx9nJ9gv9AXR H07wULWdcUsZp0LBitfh+zVPDnEwPrt7PxHoDX4PRpqYJHiqqaauAZAlEN2z/+5vBt aL5UfGkLBiLcNp30zXM+4XZRVDuqoBfM1qQeGsuQ= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED,SPF_NONE autolearn=no autolearn_force=no version=3.4.0 Received: from [10.46.160.165] (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: collinsd@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 5A8F06077A; Fri, 31 May 2019 23:27:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1559345231; bh=G6EhyJ9g00tRI9kO08bdec8G8ptEPWdzLzRXpkaiZXw=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=doB6uQl3pZKr/0HKUsp3oIm2bbLAQuFpIodFciHO1mvq7+h6AO6ZX6at2vfdu/H4c F8ii5eDekCQvRM2oKjEtlbvENU7FKhqQIEaB6vbzALmqrcXBgIKW5zxdlHJUlO29ph A/uU4qYw8+0YnbQiDX6J3vb55XLOMGxHFLey0a3s= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 5A8F06077A Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=collinsd@codeaurora.org Subject: Re: [PATCH v1 0/5] Solve postboot supplier cleanup and optimize probe ordering To: Saravana Kannan , Rob Herring , Mark Rutland , Greg Kroah-Hartman , "Rafael J. Wysocki" , Frank Rowand Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@android.com References: <20190524010117.225219-1-saravanak@google.com> From: David Collins Message-ID: Date: Fri, 31 May 2019 16:27:10 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190524010117.225219-1-saravanak@google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Saravana, On 5/23/19 6:01 PM, Saravana Kannan wrote: ... > Having functional dependencies explicitly called out in DT and > automatically added before the devices are probed, provides the > following benefits: ... > - Supplier devices like clock providers, regulators providers, etc > need to keep the resources they provide active and at a particular > state(s) during boot up even if their current set of consumers don't > request the resource to be active. This is because the rest of the > consumers might not have probed yet and turning off the resource > before all the consumers have probed could lead to a hang or > undesired user experience. This benefit provided by the sync_state() callback function introduced in this series gives us a mechanism to solve a specific problem encountered on Qualcomm Technologies, Inc. (QTI) boards when booting with drivers compiled as modules. QTI boards have a regulator that powers the PHYs for display, camera, USB, UFS, and PCIe. When these boards boot up, the boot loader enables this regulator along with other resources in order to display a splash screen image. The regulator must remain enabled until the Linux display driver has probed and made a request with the regulator framework to keep the regulator enabled. If the regulator is disabled prematurely, then the screen image is corrupted and the display hardware enters a bad state. We have observed that when the camera driver probes before the display driver, it performs this sequence: regulator_enable(), camera register IO, regulator_disable(). Since it is the first consumer of the shared regulator, the regulator is physically disabled (even though display hardware still requires it to be enabled). We have solved this problem when compiling drivers statically with a downstream regulator proxy-consumer driver. This proxy-consumer is able to make an enable request for the shared regulator before any other consumer. It then removes its request at late_initcall_sync. Unfortunately, when drivers are compiled as modules instead of compiled statically into the kernel image, late_initcall_sync is not a meaningful marker of driver probe completion. This means that our existing proxy voting system will not work when drivers are compiled as modules. The sync_state() callback resolves this issue by providing a notification that is guaranteed to arrive only after all consumers of the shared regulator have probed. QTI boards have other cases of shared resources such as bus bandwidth which must remain at least at a level set by boot loaders in order to properly support hardware blocks that are enabled before the Linux kernel starts booting. Take care, David -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project