Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4348089ybl; Mon, 9 Dec 2019 09:18:41 -0800 (PST) X-Google-Smtp-Source: APXvYqwlh2nM9hVwqhh9A6zS4kuXRL4xuIRkbHs8BfobTO96bD2eEtCjNtDzRS3p30i5/E7IAW5k X-Received: by 2002:a05:6830:1d6:: with SMTP id r22mr23165615ota.196.1575911921312; Mon, 09 Dec 2019 09:18:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575911921; cv=none; d=google.com; s=arc-20160816; b=a57plZzwhg+Ow1bFqiiaNkmjfF/dX8SCR58Xz7QeNGdMr/efsB5GGOYWYluv+UEESp 8q8LRnjhPLfowDX7zCNEQWm4jgwQ7QuMAKroUPPaAZ0vS6CJ0PNyoQV0yc+/qmt+rozC 5Mtl6jSlmGVfVONFYFAuIhMw30sLkpzkYRfhhIZbmLFGuXG0HDr9URA2iiOIKpFbis65 mFa/NB99jjWQFnvQwJXrRGxUk1jkWMydabblruVA/y2X1MGzYJLVhJ2V5qfrBZSyGeqd 1PfTTIaOEAoe23si26MOi/BzAUJXJH4NA7piE9jadp3yfGQqrHlSacQUWJKwi8nbjX4c yqqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6iI9lVnNH0UerpE1bqPQXNj2mhvS1xA7PcDef5F/gq4=; b=qoHgdlTq6PQXWEjc6vE1493yIairSzPEGilA294STo2IaQl9XaA1oGxcoar5uv2R1W 4g5q4dtkfmSzAJU0gV4Prt2YEz1ZUQNPskrieW4OWrTMT5Dqghe700/iOAqSoi5epXlr gFtmyl90LKDoEjhq5pceoV0E7/Fjd2yzKzx3BlUrvOytPhXjlUO/XTAW4W3iM+BDgz6L jYWcv4IoV8HrkVvp8FzXW1FJTN6WOQgLpN6HBbeaZ7zAjs7nwSYkOgEDkUk1M+6Qn3zM 9M2BM96NixEFtD//0+vxtnZ87eNNLjx7s5ji/n0/L/iZFU5FVgO6va16wGHag/NmSFbI cAuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ragnatech-se.20150623.gappssmtp.com header.s=20150623 header.b="mR1y/P/b"; 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 d23si195439oij.270.2019.12.09.09.18.29; Mon, 09 Dec 2019 09:18:41 -0800 (PST) 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=@ragnatech-se.20150623.gappssmtp.com header.s=20150623 header.b="mR1y/P/b"; 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 S1726642AbfLIRQm (ORCPT + 99 others); Mon, 9 Dec 2019 12:16:42 -0500 Received: from mail-lj1-f176.google.com ([209.85.208.176]:43564 "EHLO mail-lj1-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725904AbfLIRQm (ORCPT ); Mon, 9 Dec 2019 12:16:42 -0500 Received: by mail-lj1-f176.google.com with SMTP id a13so16520938ljm.10 for ; Mon, 09 Dec 2019 09:16:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ragnatech-se.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=6iI9lVnNH0UerpE1bqPQXNj2mhvS1xA7PcDef5F/gq4=; b=mR1y/P/bsXVYdOXFe+gzP8Zx+TPszIIkDMmW+dwhMwGMkI7ExOmKWYaFMX8bN1t+F9 qj7X1paf5T8B09y3Tc2Guldv0ZAdxJ7YdOJnmFsohxFishgjq7UB6KGFhNm27tDnNy6b 59EPegpLJ3rDltgIz79c/aixut12eQtABsSvuz/l6gqVjXTkSzNotRwf2FY3uJpPe+nh Ox8z2/3rOmSNjkaK3qlqt0RlB580fBFcwwKdSjlNg8FCWIpauBTR2kZNWptlVfAG3Okd dlrCtNwGY7g3xe8YrGv+ArpF7ePEJY7ULSdDuqN9+gPz0AI4fTLBCKjy486Jfs9lwvKH xdBQ== 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:content-transfer-encoding :in-reply-to:user-agent; bh=6iI9lVnNH0UerpE1bqPQXNj2mhvS1xA7PcDef5F/gq4=; b=j2JayP7THQmZvHrPbiWLfkCefQA6XMbEbrqSXbnAHa7LxooQ7YDk3bMZuKaGzFkNzh DOz6w21WGQY+6U9NUZ2+R/19amx/P7GZX+tkPSxBbp7Dn/Nthw/ZgEySSApK1/r9RISQ X08E0okJFd/sgupcZMfVxfWSu2Ku8BkvWhSEvmPreYIj705TVO64YVmG4rlkBvqeYWz4 ntjtrAgOFW35f/Q2m3oOPeb8K07NyZhcaEWpRZ7NnDpP0YIRXVO2mFSIWTkotsMxs47v W456OsfaPXvq7htAD9YT/XbcKJoDnNHuEXq4SjCze7nzPPBucjwjLilJKAo5jMEl3puZ OoPQ== X-Gm-Message-State: APjAAAVyHl+ZoAXjH0OND3CIilsYl/Cfzq1lq5YnzJWEBkMm0uEpTR1f 6eC9/kIGrerkr3eUoxyzZ1BhDg== X-Received: by 2002:a2e:9e4c:: with SMTP id g12mr17287507ljk.15.1575911800327; Mon, 09 Dec 2019 09:16:40 -0800 (PST) Received: from localhost (h-93-159.A463.priv.bahnhof.se. [46.59.93.159]) by smtp.gmail.com with ESMTPSA id h24sm236983ljl.80.2019.12.09.09.16.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2019 09:16:39 -0800 (PST) Date: Mon, 9 Dec 2019 18:16:39 +0100 From: Niklas =?iso-8859-1?Q?S=F6derlund?= To: Kieran Bingham Cc: Mark Brown , Linux-Renesas , Liam Girdwood , Linux Kernel Mailing List , Laurent Pinchart , Jacopo Mondi Subject: Re: Regulator probe on demand (or circular dependencies) Message-ID: <20191209171639.GA27340@bigcity.dyn.berto.se> References: <23236201-a387-7257-35a4-ee4ed2f6bfd0@ideasonboard.com> <20191209163755.GF5483@sirena.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Kieran, On 2019-12-09 17:03:38 +0000, Kieran Bingham wrote: > Hi Mark, > > Thanks for getting back to me, > > On 09/12/2019 16:37, Mark Brown wrote: > > On Fri, Dec 06, 2019 at 04:38:04PM +0000, Kieran Bingham wrote: > > > >> The MAX9286 also exposes 2 GPIO pins, as such I have configured the > >> MAX9286 driver [1] to expose a gpio-chip [2]. > > > > So this seems like a MFD then? The nice thing about using the MFD > > subsystem is that it means that the drivers for the various subsystems > > on the device can instantiate in any order and defer separately without > > interfering with each other which seems like it's the issue here. > > Well that's part of the problem... the V4L2 async framework can not > currently support the device performing a probe-defer at all, so it > *will* fail later (and crash currently). > > I hope we can fix this sometime - but it's a recurring pain point it > seems. Unless it's just our video-capture driver, I'll have to dig > deeper here, and check with Niklas. The problem is that we can't register, unregister and re-regsiter a video device in a sane way. One easy solution to this is to not register the max9286 v4l2 subdevice until we know that the probe do not need to be deferred as this would sidestep the whole v4l2 issue described above. > > > >> - is there anything I can do here within regulator_dev_lookup() to > >> attempt creating the regulator_dev 'on-demand' when > >> of_find_regulator_by_node(node) returns empty? (or is that crazy, and > >> just a rabbit-hole?) > > > > This seems like a terrible idea, you'll have a half baked regulator in > > the system which will need special casing all over the place and > > doubtless be an ongoing source of bugs. > > Thanks - that's essentially what I'm glad to hear /before/ going down > some rabbit hole. I'll re-evaluate with the team, and see what the next > best steps are. > > -- > Regards > -- > Kieran -- Regards, Niklas S?derlund