Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp118258pxb; Tue, 2 Feb 2021 00:23:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJxU0/bE+Y9yJv5HSA2w8V3XspJUSUnK10i6IgLMRS6MbNd3MzaVwP7rgsBxHB8+FvWMRJyd X-Received: by 2002:a17:906:3fc1:: with SMTP id k1mr22084515ejj.58.1612254188088; Tue, 02 Feb 2021 00:23:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612254188; cv=none; d=google.com; s=arc-20160816; b=uUDymYAoLsoGqXfH6RFWY5k444YgtD5cXnltHR2QPOb1OfygflTGLvmQsP0kqNhnsj D0DxF4/oF7J3GufpTOSJ4xExzrTHc9TZk6qz/AEUSLr/sRYn1W7Q5qwwMayoy7bVPEVR kJwFZ+WRfjtzSg0ZZ2rc2bTABhnVtQ9lDZl282HIYBQ2ydNtt1+SZryaUoyPcIZz3CLD xdq54+hRXKD/r537SkHqhcXU0rZjNoku+nwKVnB5sROqQC5rb6D4hwj8aPd+Pmln1xro 0zyfM4k+0fDv9HFRC6YnE2KFf+auPcLpbgrTLkZ/bu0XPJJvP0LR4f83ot/HS34lXEeo jvKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=jnWY72rptLP2mi3bsf536ONY28gusJQRji0UXgomKro=; b=IlCQsJdAFwuVv2f64cYJc4HmHRM/P0l2ZHhDvcR6NdEMKvLiH8E2KEI/+43NV7ZBKy YRG7bx7qCwMojVvUHgP33QLT1m0wT/0489sxLfikUcFOnvyw0fo/rxb7AEzWgaGc5pN+ 0H8T7wlChc5mUIoTjXxoY5dO7cpy88NFLPs3+wI8PjvHAE96LsdXqLHM0vrr4jXVnQot xmKY1V9yK/UexCAd+Un3eenqot3yWYa7xOgvOe68gxxUih0Qa3UIpiZ4O+f4bOFtQXvf 7BjgyiYfuTdJNoNHBBgkLvq2L8Oji7Q7Aoc4az8N6SOrQvSE1+LOARGFQOaGbaSoeZQF yWag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=B4gFI+8T; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i10si12597729ejd.572.2021.02.02.00.22.43; Tue, 02 Feb 2021 00:23:08 -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=@google.com header.s=20161025 header.b=B4gFI+8T; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232470AbhBBIV6 (ORCPT + 99 others); Tue, 2 Feb 2021 03:21:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232437AbhBBIV2 (ORCPT ); Tue, 2 Feb 2021 03:21:28 -0500 Received: from mail-yb1-xb31.google.com (mail-yb1-xb31.google.com [IPv6:2607:f8b0:4864:20::b31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5E4FC061573 for ; Tue, 2 Feb 2021 00:20:47 -0800 (PST) Received: by mail-yb1-xb31.google.com with SMTP id i6so13236822ybq.5 for ; Tue, 02 Feb 2021 00:20:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jnWY72rptLP2mi3bsf536ONY28gusJQRji0UXgomKro=; b=B4gFI+8TlnKMhqz6tbOVJryq3Znq5MIWuzHAOCEZO5GypiU4NOFut9T0tQ5pk5dXvq goh06hx7cQwhNY83q90CUXxRahn9Qh4FLftjcwKQnCN6iMUrJ/uZ8RkjFJfyg6Acb80z OWSxirqdbEjpVLZlXRXHCXJcQUiJynislup8VRliS+WV5Bhei2DeGuiSBAkMkkdD2WIg bHAItCeeqqR5VrITXjMvxRuKyLqn+KLgeil9OBMDJRVGLk7oeZ8popox74WskuLc2yNT bP9pafaCrVd7Z1SGTD9ez4UIPLVBex9CPA1OKFXjVDSHxPELdIPH0gj05zylnGUs77JX srHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jnWY72rptLP2mi3bsf536ONY28gusJQRji0UXgomKro=; b=lqFVa5nFcZ+2JPB2a3JX08hEObylnHCu0GauRhMbijGCVer/ETKG6IbpGlSd4DnjrV eu+zb+dYdbHa0o2BbWSBeH/jRm3Jks/fP+8ew8ZBhk3O83+JLzR5NkAOKUbmYHflitV4 M4nOMSttH6gg4GtZ1435cXf/A9JWRQ5Shw0NQwM5Oj2bBlZmEpikcXXJnGmcrLWDhBM7 A59Dmefmmejs/ty4uVMGdVDcXoYhkk3QvM1WOLSiXxjy4UUivSqm+LlCMUJjimQHdRcn s45rouLDWJfASAtVbcJMX28DC/gTxbv6b1stGZvZiAUftIptpaP6udo690AceZgKmkaF Y0iQ== X-Gm-Message-State: AOAM530QirbgZSrqx0tG92bInFnbUMF2nV/Z6bA7+/Vbtpa7KAhPiDKh ouryNTnK0Hi7gBUAOjhHD9JscMhy/lpPzcVojV/33A== X-Received: by 2002:a25:b74c:: with SMTP id e12mr21829597ybm.20.1612254046790; Tue, 02 Feb 2021 00:20:46 -0800 (PST) MIME-Version: 1.0 References: <20210130040344.2807439-1-saravanak@google.com> In-Reply-To: From: Saravana Kannan Date: Tue, 2 Feb 2021 00:20:09 -0800 Message-ID: Subject: Re: [PATCH v1 0/2] Make fw_devlink=on more forgiving To: Geert Uytterhoeven Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" , Marek Szyprowski , Marc Zyngier , Tudor Ambarus , Linus Walleij , Bartosz Golaszewski , LKML , Android Kernel Team , Wolfram Sang , Linux-Renesas Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 1, 2021 at 11:55 PM Geert Uytterhoeven wrote: > > Hi Saravana, > > On Tue, Feb 2, 2021 at 4:01 AM Saravana Kannan wrote: > > On Mon, Feb 1, 2021 at 2:40 AM Geert Uytterhoeven wrote: > > > On Sat, Jan 30, 2021 at 5:09 AM Saravana Kannan wrote: > > > > On Fri, Jan 29, 2021 at 8:03 PM Saravana Kannan wrote: > > > > > This patch series solves two general issues with fw_devlink=on > > > > > > > > > > Patch 1/2 addresses the issue of firmware nodes that look like they'll > > > > > have struct devices created for them, but will never actually have > > > > > struct devices added for them. For example, DT nodes with a compatible > > > > > property that don't have devices added for them. > > > > > > > > > > Patch 2/2 address (for static kernels) the issue of optional suppliers > > > > > that'll never have a driver registered for them. So, if the device could > > > > > have probed with fw_devlink=permissive with a static kernel, this patch > > > > > should allow those devices to probe with a fw_devlink=on. This doesn't > > > > > solve it for the case where modules are enabled because there's no way > > > > > to tell if a driver will never be registered or it's just about to be > > > > > registered. I have some other ideas for that, but it'll have to come > > > > > later thinking about it a bit. > > > > > > > > > > These two patches might remove the need for several other patches that > > > > > went in as fixes for commit e590474768f1 ("driver core: Set > > > > > fw_devlink=on by default"), but I think all those fixes are good > > > > > changes. So I think we should leave those in. > > > > > > > > > > Marek, Geert, > > > > > > > > > > Can you try this series on a static kernel with your OF_POPULATED > > > > > changes reverted? I just want to make sure these patches can identify > > > > > and fix those cases. > > > > > > > > > > Tudor, > > > > > > > > > > You should still make the clock driver fix (because it's a bug), but I > > > > > think this series will fix your issue too (even without the clock driver > > > > > fix). Can you please give this a shot? > > > > > > > > Marek, Geert, Tudor, > > > > > > > > Forgot to say that this will probably fix your issues only in a static > > > > kernel. So please try this with a static kernel. If you can also try > > > > and confirm that this does not fix the issue for a modular kernel, > > > > that'd be good too. > > > > > > Thanks for your series! > > > > > > For the modular case, this series has no impact, as expected (i.e. fails > > > to boot, no I/O devices probed). > > > With modules disabled, both r8a7791/koelsch and r8a77951/salvator-xs > > > seem to boot fine, except for one issue on koelsch: > > > > Thanks a lot for testing the series! > > > > Regarding the koelsch issue, do you not see it with your OF_POPULATED > > fix for rcar-sysc driver? But only see if you revert it and use this > > series? > > I've just rechecked, and with fw_devlink=on, and my OF_POPULATED > fir for rcar-sysc, i2c-demux-pinctrl works, both with modules enabled > and disabled. Thanks Geert! My guess is that with your OF_POPULATED changes the "i2c-parents" of i2c-demux-pinctrl don't get probe deferred and therefore i2c-demux-pinctrl probes after them and everything goes well. I guess that goes to show this series can't be the magic bullet even with patch 2/3 -- especially for top level DT nodes that never have devices created. The other odd thing I noticed is that i2c-demux-pinctrl seems to return -ENODEV when I think it should do -EPROBE_DEFER. In i2c_demux_activate_master(): ret = of_changeset_apply(&priv->chan[new_chan].chgset); if (ret) goto err; adap = of_find_i2c_adapter_by_node(priv->chan[new_chan].parent_np); if (!adap) { ret = -ENODEV; goto err_with_revert; } If I understand the code correctly, it's assuming the selected parent will probe successfully as soon as its status=ok change is done. Which is not guaranteed for many reasons (driver not registered, async probing, stuff like fw_devlink, etc). Thanks, Saravana