Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2948983imm; Thu, 24 May 2018 19:42:19 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrRmg5otXx1iJZpcZgnos0ykPY/WKgyqo+VIQHPvOLegcPuajcYJsIi8YKX59mEqG7XNt37 X-Received: by 2002:a17:902:125:: with SMTP id 34-v6mr659746plb.42.1527216139070; Thu, 24 May 2018 19:42:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527216139; cv=none; d=google.com; s=arc-20160816; b=sca4v9Uh/89H0vd9MxjxDzRzq5AxuxhVyRLBT1YOnUk9C/1lPsruEvHTzeYzU6KOdI VQ1NhE+dcIU82V69dsEhByEalO9euo5Wah0H74Gjg7c6Oxq0cY7t+3Aj0JExKLmWPus+ wHcK1bzK04c3u2QJIYRlmEbAuFzV7GKWJv9uisMHisFRF6rCUlgLodx85rjYnKqaPXWC ucoyvdFWEpzTHexx7IE4oz9P4G/PyM2LJLILqXoTKPyCvAj31QsZzv5EWJqqpDEaiMSh 6ZeWvGOnfMJIDTTtH2a+4VpqxBsfAM5SPCELmbigcR8JtlwHSmLeZQwuciG2Ti189vq/ DAvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=MZaOdgUq2iGAgnITTnF97a62EMfccQpp9Hd+OVFbYzc=; b=vjDI63XAMOaoOsXfguwZovqdme4KWGVf+wlvVqWZKOLtR8pKUb/63BQ/1wNuffmRja 3UPdUvXA44RtGLJxWpPBP0bRI3QmFrPt5ncdxf4VN1+nJsuPoOcY+vIU4YFuaQSv9wDO AVbgbJLByjzY2DJzJIJ8rONfuSB2FyZsXSKriBSwS4QzKs8PjaFFlyFEoeSSavBRMQsN Eu1G0papbmn7guFP/bwSqT5VbyYqwhh5bRBYlWN2sN1TvrfJkbqr/98GzmULxup1tLmF TnWGwvwYvdhqDpX0X6Yd4Oylk1/LgylD74qZf1goZiL+Si29yaXswhZdIXPtNsKNHvzo SixA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oyakiMB/; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x11-v6si22457971pln.163.2018.05.24.19.42.04; Thu, 24 May 2018 19:42:19 -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=@kernel.org header.s=default header.b=oyakiMB/; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968867AbeEXUZc (ORCPT + 99 others); Thu, 24 May 2018 16:25:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:48102 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967470AbeEXUZ2 (ORCPT ); Thu, 24 May 2018 16:25:28 -0400 Received: from mail-qt0-f182.google.com (mail-qt0-f182.google.com [209.85.216.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2210C20891; Thu, 24 May 2018 20:25:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527193528; bh=M6qAATZ1Oi8/XCXsq5kIbigsNb3n3Q7rxFRmX2WDbq0=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=oyakiMB/Kgls87yR6HSFq/TwEoe76d57s1hWjxV9hIQoGU1ZVpRlXg/E2r1H0LOID TKHBaARpNY52FnhEUbsohoWH7HwLF6BbdEp7vbAhS9pNPHehp55TLPt4qZiCOlGmh3 0INkRC9/jGC3ORCc5BZmB1ml0A2VzGBp9Y6g6u2o= Received: by mail-qt0-f182.google.com with SMTP id 32-v6so3790523qtr.13; Thu, 24 May 2018 13:25:28 -0700 (PDT) X-Gm-Message-State: ALKqPwf77QwZr/I+ZhGvQy/YuNr2+y3D8ulzjA9iXfziSyrTVqHj1P7e 07qLeR7+5nMCCuEpRoA5TgiYss9AaVWnP4YDCA== X-Received: by 2002:aed:3bae:: with SMTP id r43-v6mr8661226qte.362.1527193527250; Thu, 24 May 2018 13:25:27 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a0c:9b02:0:0:0:0:0 with HTTP; Thu, 24 May 2018 13:25:06 -0700 (PDT) In-Reply-To: <20180524181834.GF4828@sirena.org.uk> References: <20180524175024.19874-1-robh@kernel.org> <20180524175024.19874-2-robh@kernel.org> <20180524181834.GF4828@sirena.org.uk> From: Rob Herring Date: Thu, 24 May 2018 15:25:06 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 1/8] driver core: make deferring probe after init optional To: Mark Brown Cc: Greg Kroah-Hartman , Linus Walleij , Alexander Graf , Bjorn Andersson , "Rafael J. Wysocki" , Kevin Hilman , Ulf Hansson , Joerg Roedel , Robin Murphy , Frank Rowand , "linux-kernel@vger.kernel.org" , devicetree@vger.kernel.org, Architecture Mailman List , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 24, 2018 at 1:18 PM, Mark Brown wrote: > On Thu, May 24, 2018 at 12:50:17PM -0500, Rob Herring wrote: > >> Subsystems or drivers may opt-in to this behavior by calling >> driver_deferred_probe_check_init_done() instead of just returning >> -EPROBE_DEFER. They may use additional information from DT or kernel's >> config to decide whether to continue to defer probe or not. > > Should userspace have some involvement in this decision? It knows if > it's got any intention of loading modules for example. Kernel config > checks might be good enough, though it's going to be a pain to work out > if the relevant driver is built as a module for example. I looked into whether we could hook into uevents in some way. If we knew when all the coldplug events had been handled, that would be sufficient. But it doesn't look to me like we can tell when that happens with the uevent netlink socket. I think about the only thing we can tell is if userspace has opened a socket. I'm not all that familiar with how the whole sequence works, so other opinions on this would be helpful. Also, for this to work with serial consoles, we have to make the decision before we get to userspace. I couldn't get systemd to create serial gettys either if we deferred later. There's some dependence on /dev/console, but I didn't get to the bottom of it. Rob