Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5141211pxb; Mon, 15 Feb 2021 10:32:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJydYHL/hKl/IsuXBK4H3xsLupGA71xVGt0nHxIEB6LbKqILzGE0/xDeBxHsYXteAm4dKM66 X-Received: by 2002:a17:907:7784:: with SMTP id ky4mr16621998ejc.89.1613413920774; Mon, 15 Feb 2021 10:32:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613413920; cv=none; d=google.com; s=arc-20160816; b=MYI1Fp/+WZ3/f/d1ynqmAs1ZDSQ8ObgkPyyLh06o2D5JtYon4+yTVxr8EztRSqGIBU SqsYvZvOqdHBKLcVaMQZf6XFJroEjyUsFUlzCBPnqMPHZ7mIsfqDPQDmbdkIanIX+3f6 ysD35Z6ZzwOHcStNU0u/Vm4FqsPnU98MHZ677kAamfYheICIQtKUOE+IAiXJmXJggvO+ cAMHwawkJRDNcG4HknnTAvq22qucgeuMCOjXkexbynkRvSykZCScj82eSIojw87FVXrQ zNU5hPb+GY1X1DkhirEmQQs/wofeMV9kin5cQAB14EmlGXAiy09FELTsL9J3o0+E5CdE OIyw== 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=uZdfuvZKh6ztrTveUXeyEDkpyKAhS13j3dKVJUZWOmo=; b=KFah1wO7T2zjQoJLN1PQOqCMhnOrmYB5Gc3OyM1koOdZ/WFqJpYl7ukcTJDEGGzD2E P68Bn1Toa9lsJze97Lj1gb+0Wk50eXKQCyCq9t7fcEXHZys42WR2yCUcmF8kjF3yDXhI JlmyCDKJ4vPxC+0dfHCzK6qqmQg9iJPdVGxQK9RDvvwGqHq0YsEdSqrasjmuWd2MkJfI gnEBSS2QSjsL+TEPY8jcY0WGht6Es3qRM9/vMlwqloI97IKUI8QL1keDg9e8rK+7TT9g +j7Q2861Q/d3PNVAVD0/EoPZsW8htGj5/mOEAmDK+p++BDZ/oe2+iYOi1rgz8XXFFqBw /22A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=D1wwNuFr; 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 hr24si11369693ejc.620.2021.02.15.10.31.36; Mon, 15 Feb 2021 10:32:00 -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=D1wwNuFr; 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 S229802AbhBOS14 (ORCPT + 99 others); Mon, 15 Feb 2021 13:27:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229908AbhBOS1v (ORCPT ); Mon, 15 Feb 2021 13:27:51 -0500 Received: from mail-yb1-xb34.google.com (mail-yb1-xb34.google.com [IPv6:2607:f8b0:4864:20::b34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66F54C0613D6 for ; Mon, 15 Feb 2021 10:27:11 -0800 (PST) Received: by mail-yb1-xb34.google.com with SMTP id 133so8058131ybd.5 for ; Mon, 15 Feb 2021 10:27:11 -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=uZdfuvZKh6ztrTveUXeyEDkpyKAhS13j3dKVJUZWOmo=; b=D1wwNuFr+0FpZniHfm2h3fZDPqNd00MWNhfBi5k8SLFxmWR02gpFyGqaWAJxK5wHLq yC8+r0/Qj4PjOFCfBZPju5KVwPQFPWWM6tedamfW57Ie0kgx3DvCJ2ZDneu35lApe9I0 K8AhKRE0wq2U8HvWoP3fkP546PxdcEVs2X5cyKn7EXPnA0r0SzrUDKvR4D9KMYXhdsnv bX+MfG+ZgUZ5007JZfbD+nfigpk4AUXEVqgm94bg4nks/kdRuHTWs5epatRHNR4guHcp jflSa6JwEvOCochYqol7ikXPawB4hU32wkf12MRnQ0/lhBlq2xNiPfLoTtI3RA8ROU3g jIcA== 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=uZdfuvZKh6ztrTveUXeyEDkpyKAhS13j3dKVJUZWOmo=; b=VVzLDVrYsKsSEthEq13PbeJsYyy/oh3kjFYOHTysEuJpSXBSudBsZgbVuIuH60L5kg N+c/QtllB0Bu1AgDSi5rl/icizUH5v3tV2ftS6J3v7O0KP3KQ4edPnTFBhL6996k1KMc 7YhSsfRiA6qtMeGsRNozr+ziCHQ50iOnOWudO8fk/ocXSVBwL4ebRf74+9noEklvUpSX k23tH/c+7L0qpSgO0z6GCz5Ssm56qv2vgjB21Nz1MYCySnKuISrkDzvrnmmx5dNnIQmb J8QIirXMq3dnGy7HQioN7FyFuVG/L2xvxa860tXoYmI2oqAaHICXUDrHwIkyvdtfdx65 fCJg== X-Gm-Message-State: AOAM533DiP+X2VRV9q6rR18TJJy19gq2pKGlkgP7h5VMxp1F3dmqhCz+ J05tn4fMZI0sfcFuk0kvQy/Qy7JvBJ3I7aBMsAMGdg== X-Received: by 2002:a05:6902:1025:: with SMTP id x5mr24333565ybt.96.1613413630483; Mon, 15 Feb 2021 10:27:10 -0800 (PST) MIME-Version: 1.0 References: <20210215111619.2385030-1-geert+renesas@glider.be> In-Reply-To: From: Saravana Kannan Date: Mon, 15 Feb 2021 10:26:34 -0800 Message-ID: Subject: Re: [PATCH] driver core: Fix double failed probing with fw_devlink=on To: "Rafael J. Wysocki" Cc: Geert Uytterhoeven , Greg Kroah-Hartman , Linux-Renesas , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 15, 2021 at 6:59 AM Rafael J. Wysocki wrote: > > On Mon, Feb 15, 2021 at 12:16 PM Geert Uytterhoeven > wrote: > > > > With fw_devlink=permissive, devices are added to the deferred probe > > pending list if their driver's .probe() method returns -EPROBE_DEFER. > > > > With fw_devlink=on, devices are added to the deferred probe pending list > > if they are determined to be a consumer, If they are determined to be a consumer or if they are determined to have a supplier that hasn't probed yet? > > which happens before their > > driver's .probe() method is called. If the actual probe fails later > > (real failure, not -EPROBE_DEFER), the device will still be on the > > deferred probe pending list, and it will be probed again when deferred > > probing kicks in, which is futile. > > > > Fix this by explicitly removing the device from the deferred probe > > pending list in case of probe failures. > > > > Fixes: e590474768f1cc04 ("driver core: Set fw_devlink=on by default") > > Signed-off-by: Geert Uytterhoeven > > Good catch: > > Reviewed-by: Rafael J. Wysocki Geert, The issue is real and needs to be fixed. But I'm confused how this can happen. We won't even enter really_probe() if the driver isn't ready. We also won't get to run the driver's .probe() if the suppliers aren't ready. So how does the device get added to the deferred probe list before the driver is ready? Is this due to device_links_driver_bound() on the supplier? Can you give a more detailed step by step on the case you are hitting? Greg/Rafael, Let's hold off picking this patch till I get to take a closer look (within a day or two) please. -Saravana > > > --- > > Seen on various Renesas R-Car platforms, cfr. > > https://lore.kernel.org/linux-acpi/CAMuHMdVL-1RKJ5u-HDVA4F4w_+8yGvQQuJQBcZMsdV4yXzzfcw@mail.gmail.com > > --- > > drivers/base/dd.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/drivers/base/dd.c b/drivers/base/dd.c > > index 9179825ff646f4e3..91c4181093c43709 100644 > > --- a/drivers/base/dd.c > > +++ b/drivers/base/dd.c > > @@ -639,11 +639,13 @@ static int really_probe(struct device *dev, struct device_driver *drv) > > case -ENXIO: > > pr_debug("%s: probe of %s rejects match %d\n", > > drv->name, dev_name(dev), ret); > > + driver_deferred_probe_del(dev); > > break; > > default: > > /* driver matched but the probe failed */ > > pr_warn("%s: probe of %s failed with error %d\n", > > drv->name, dev_name(dev), ret); > > + driver_deferred_probe_del(dev); > > } > > /* > > * Ignore errors returned by ->probe so that the next driver can try > > -- > > 2.25.1 > >