Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2354975pxb; Thu, 11 Feb 2021 10:12:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJx2ZEUq3axg/5GWxC0qR6g47VgrRrS9bO7KjvFmuqrpKK8ITtilNPMexHdZasdRF9ECH6CC X-Received: by 2002:a50:aade:: with SMTP id r30mr9315279edc.15.1613067168364; Thu, 11 Feb 2021 10:12:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613067168; cv=none; d=google.com; s=arc-20160816; b=b7kNhxl3CtDsb1RlnYNi+8DFaQYmeBnUQBcfQqMEbqvfWVA4CTvd0R9PP/QlpwtOT7 YJe6veJiPHvgL9hw5IUqh9CZfRION6SdWwJ257Yqf3scK1Qldu1T63twzF1iIVC+S1ol nBY4d/y3vrmfWhypqKdnpUpO+TbBg6CkQUr3d659cGpeEHu9c7XdKSShTq6v/7ksVSXU vU47Zi4O+Se3tmHDp5bkaXM2HWa9w07Y2/ZFbqwF5yEtMieUcDsjlXvC9YMCNBqeWJgJ s153gy9cAeZzAsMApWyVcWnQGz97IYw1GF0rrCapmu/7D7TtLMk2VJh8+LFbgeOTKbO2 UQgg== 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; bh=fCJHjf1MjgpxPkhng9R5nM8PO3m4mG6rPr4oi+gwZSk=; b=zCULrDKYIFpCVqELDdGjHIY8a+P8v+QYJaRnL+FLLbDAPrpmW/oXZnxQWLmeIUbpCl QHtdkheAi7fCHEEY4QAC30BB2G0VeuOq3A09D2mVtG45BWXV3WDqbX8sYrmfv0By1JdI 9uQtG9qFieXBV7AQ4cnPH0VQN7R6Ex1m/j31ydKA/XvqxMoY5hadFOORC9Ia6prsjxJk kwE4CHMfgOAsmBqlELlB/Pyo5YzFJgjmoAkFMr7WEvhJfuo8SK4Q38iS8Ht4PSQR9cH7 CeoN9b8ZjrGGbDLGnzcSIE2aDSvWhWZZTyH5EorIjEwLehMGMig74iO7ukn01BH8GB/5 khdg== ARC-Authentication-Results: i=1; mx.google.com; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w7si4410731edd.560.2021.02.11.10.12.23; Thu, 11 Feb 2021 10:12:48 -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; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232046AbhBKSLu (ORCPT + 99 others); Thu, 11 Feb 2021 13:11:50 -0500 Received: from mail-wm1-f43.google.com ([209.85.128.43]:35901 "EHLO mail-wm1-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229955AbhBKRtd (ORCPT ); Thu, 11 Feb 2021 12:49:33 -0500 Received: by mail-wm1-f43.google.com with SMTP id i9so6595403wmq.1; Thu, 11 Feb 2021 09:49:15 -0800 (PST) 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=fCJHjf1MjgpxPkhng9R5nM8PO3m4mG6rPr4oi+gwZSk=; b=LzmQ/pz8erjaQ0/Z07kqfkWyC8IhJZA9Z3lQeyH6bGwQEUI6MV3nC7p6yxj0/Z7H9T d8ydRecpPFNi2P8l7VIaBUga8EDCgYgNy3oH/2UA4/1uJO3/6TzOxzan7qk2D9rCar40 AYkpWTyQBgLFR6fk9WhY4SkM0IJa/CRf2BHR+PH+GFENdu6YiseKOG6SufE1J/dz8TTN iAGqGzZcD+tQR6mEEKNcrhy/S2x9R8A7nlOI8uXPMr3chPCetyxrR6uOyEIo/bgUYKqc FsGg+vy1b/k0oLfgGGRRaSKZifUYDspoged5Mtco0b404HBv0WHUw2iAtBv20xFBChv1 EZhw== X-Gm-Message-State: AOAM532CtM2sNrqK99hpWnEccfZEshli8ncP31RIufyNBD9rryvnXYDd kjfO5oJ7fJD2oZ/YMLcsm2yuVkxW9YSassY3p+Q= X-Received: by 2002:a1c:bc89:: with SMTP id m131mr6197346wmf.32.1613065730253; Thu, 11 Feb 2021 09:48:50 -0800 (PST) MIME-Version: 1.0 References: <20201218031703.3053753-1-saravanak@google.com> <56f7d032-ba5a-a8c7-23de-2969d98c527e@nvidia.com> <17939709-f6f4-fa9c-836f-9779081c4087@nvidia.com> <6a43e209-1d2d-b10a-4564-0289d54135d3@nvidia.com> In-Reply-To: From: "Rafael J. Wysocki" Date: Thu, 11 Feb 2021 18:48:38 +0100 Message-ID: Subject: Re: [PATCH v1 0/5] Enable fw_devlink=on by default To: Saravana Kannan Cc: "Rafael J. Wysocki" , Jon Hunter , Greg Kroah-Hartman , Android Kernel Team , LKML , Jisheng Zhang , Kevin Hilman , John Stultz , Nicolas Saenz Julienne , Marc Zyngier , linux-tegra Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 11, 2021 at 6:15 PM Saravana Kannan wrote: > > On Thu, Feb 11, 2021 at 7:03 AM Rafael J. Wysocki wrote: > > > > On Thu, Feb 11, 2021 at 1:02 AM Saravana Kannan wrote: > > > > > > On Thu, Jan 28, 2021 at 7:03 AM Jon Hunter wrote: > > > > > > > > > > > > On 14/01/2021 16:56, Jon Hunter wrote: > > > > > > > > > > On 14/01/2021 16:47, Saravana Kannan wrote: > > > > > > > > > > ... > > > > > > > > > >>> Yes this is the warning shown here [0] and this is coming from > > > > >>> the 'Generic PHY stmmac-0:00' device. > > > > >> > > > > >> Can you print the supplier and consumer device when this warning is > > > > >> happening and let me know? That'd help too. I'm guessing the phy is > > > > >> the consumer. > > > > > > > > > > > > > > > Sorry I should have included that. I added a print to dump this on > > > > > another build but failed to include here. > > > > > > > > > > WARNING KERN Generic PHY stmmac-0:00: supplier 2200000.gpio (status 1) > > > > > > > > > > The status is the link->status and looks like the supplier is the > > > > > gpio controller. I have verified that the gpio controller is probed > > > > > before this successfully. > > > > > > > > > >> So the warning itself isn't a problem -- it's not breaking anything or > > > > >> leaking memory or anything like that. But the device link is jumping > > > > >> states in an incorrect manner. With enough context of this code (why > > > > >> the device_bind_driver() is being called directly instead of going > > > > >> through the normal probe path), it should be easy to fix (I'll just > > > > >> need to fix up the device link state). > > > > > > > > > > Correct, the board seems to boot fine, we just get this warning. > > > > > > > > > > > > Have you had chance to look at this further? > > > > > > Hi Jon, > > > > > > I finally got around to looking into this. Here's the email[1] that > > > describes why it's done this way. > > > > > > [1] - https://lore.kernel.org/lkml/YCRjmpKjK0pxKTCP@lunn.ch/ > > > > > > > > > > > The following does appear to avoid the warning, but I am not sure if > > > > this is the correct thing to do ... > > > > > > > > index 9179825ff646..095aba84f7c2 100644 > > > > --- a/drivers/base/dd.c > > > > +++ b/drivers/base/dd.c > > > > @@ -456,6 +456,10 @@ int device_bind_driver(struct device *dev) > > > > { > > > > int ret; > > > > > > > > + ret = device_links_check_suppliers(dev); > > > > + if (ret) > > > > + return ret; > > > > + > > > > ret = driver_sysfs_add(dev); > > > > if (!ret) > > > > driver_bound(dev); > > > > > > So digging deeper into the usage of device_bind_driver and looking at > > > [1], it doesn't look like returning an error here is a good option. > > > When device_bind_driver() is called, the driver's probe function isn't > > > even called. So, there's no way for the driver to even defer probing > > > based on any of the suppliers. So, we have a couple of options: > > > > > > 1. Delete all the links to suppliers that haven't bound. > > > > Or maybe convert them to stateless links? Would that be doable at all? > > Yeah, I think it should be doable. > > > > > > We'll still leave the links to active suppliers alone in case it helps with > > > suspend/resume correctness. > > > 2. Fix the warning to not warn on suppliers that haven't probed if the > > > device's driver has no probe function. But this will also need fixing > > > up the cleanup part when device_release_driver() is called. Also, I'm > > > not sure if device_bind_driver() is ever called when the driver > > > actually has a probe() function. > > > > > > Rafael, > > > > > > Option 1 above is pretty straightforward. > > > > I would prefer this -> > > Ok > > > > > > Option 2 would look something like what's at the end of this email + > > > caveat about whether the probe check is sufficient. > > > > -> because "fix the warning" really means that we haven't got the > > device link state machine right and getting it right may imply a major > > redesign. > > > > Overall, I'd prefer to take a step back and allow things to stabilize > > for a while to let people catch up with this. > > Are you referring to if/when we implement Option 2? Or do you want to > step back for a while even before implementing Option 1? I would do option 1 and if then see what happens and maybe go back from there if need be until getting a reasonably stable situation (that is all of the systems that used to work before still work at least).