From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933534AbcIAOxu (ORCPT ); Thu, 1 Sep 2016 10:53:50 -0400 Received: from mga05.intel.com ([192.55.52.43]:48614 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933159AbcIAOxs (ORCPT ); Thu, 1 Sep 2016 10:53:48 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,268,1470726000"; d="scan'208";a="1050191866" Message-ID: <1472741623.4887.482.camel@linux.intel.com> Subject: Regulator probe From: Andy Shevchenko To: Mark Brown Cc: "linux-kernel@vger.kernel.org" , "Hunter, Adrian" Date: Thu, 01 Sep 2016 17:53:43 +0300 Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.4-1+b1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! I have found an issue which I have no idea how to solve properly. Let's look at the details. The platform I'm working on (Intel Edison) has the following devices: Pin control (registered in platform code) GPIO (PCI device) SDHCI (PCI device) WiFi card (SDIO connected to SDHCI) Regulator for WiFi card (registered in platform code, enumerated via SFI notifier) In the kernel configuration CONFIG_PINCTRL_MERRIFIELD=y CONFIG_GPIO_MERRIFIELD=y CONFIG_SDHCI_PCI=y CONFIG_REGULATOR=y (All intermediate dependencies also built-in) Platform has setting regulator_has_full_constraints(); During the boot I got the following: #1 [    0.286099] calling  intel_mid_platform_init+0x0/0x36 @ 1 [    0.290348] Using generic wifi platform data [    0.291055] initcall intel_mid_platform_init+0x0/0x36 returned 0 after 3906 usecs [    0.291411] calling  mrfld_pinctrl_init+0x0/0x21 @ 1 [    0.292556] initcall mrfld_pinctrl_init+0x0/0x21 returned 0 after 976 usecs Regulator for WiFi and pin control are registered. #2 [    0.555321] calling  mrfld_pinctrl_init+0x0/0x14 @ 1 [    0.563920] initcall mrfld_pinctrl_init+0x0/0x14 returned 0 after 7812 usecs Pin control is initialized. #3 [    0.572562] calling  regulator_fixed_voltage_init+0x0/0x14 @ 1 [    0. 573366] bcm43xx-vmmc-regulator: Failed to request enable GPIO96: -517 [     0.573708] reg-fixed-voltage reg-fixed-voltage.0.auto: Failed to register regulator: -517 [    0.574376] initcall regulator_fixed_voltage_init+0x0/0x14 returned 0 after 1953 usecs Obviously GPIO device isn't probed yet. #4 [   12.322718] calling  mrfld_gpio_driver_init+0x0/0x1b @ 1 [   12.349569] initcall mrfld_gpio_driver_init+0x0/0x1b returned 0 after 11716 usecs GPIO driver is initialized. # 5 [   20.843973] calling  sdhci_drv_init+0x0/0x20 @ 1 [   20.843976] sdhci: Secure Digital Host Controller Interface driver [   20.843978] sdhci: Copyright(c) Pierre Ossman [   20.843989] initcall sdhci_drv_init+0x0/0x20 returned 0 after 5 usecs [   20.843999] calling  sdhci_driver_init+0x0/0x1b @ 1 [   20.881460] sdhci-pci 0000:00:01.3: SDHCI controller found [8086:1190] (rev 1) [   20.881471] sdhci-pci 0000:00:01.3: found 1 slot(s) [   20.888242] sdhci-pci 0000:00:01.3: No vmmc regulator found ^^^^^ PROBLEM! Regulator is present, though it's in a waiting list. [   20.888272] sdhci-pci 0000:00:01.3: No vqmmc regulator found #6 [   21.520126] calling  deferred_probe_initcall+0x0/0x70 @ 1 [   21.521460] bcm43xx-vmmc-regulator: at 2000 mV [   21.524831] reg-fixed-voltage reg-fixed-voltage.0.auto: bcm43xx-vmmc- regulator supplying 2000000uV [   21.524902] initcall deferred_probe_initcall+0x0/0x70 returned 0 after 4646 usecs ^^^^^ Too late [   27.479039] calling  regulator_init_complete+0x0/0x30 @ 1 [   27.479048] bcm43xx-vmmc-regulator: disabling So, my understanding that in _regulator_get() we have to try probe deferred regulators once again. But I have no idea how to fix this properly. P.S. Of course everything works in case of CONFIG_SDHCI=m, but it's looks like not a (proper?) solution. -- Andy Shevchenko Intel Finland Oy