Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1198347ybb; Fri, 3 Apr 2020 21:19:51 -0700 (PDT) X-Google-Smtp-Source: APiQypL1YyXoJW5ZN140nnuHALdcU80YRf6G3gTR3nCByB/vIIx81NbOZoJWWp3t6Klf/49gPDNz X-Received: by 2002:a05:6808:355:: with SMTP id j21mr5760791oie.1.1585973991501; Fri, 03 Apr 2020 21:19:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585973991; cv=none; d=google.com; s=arc-20160816; b=RcgMiiRuYSVspXDMbQycHRrFP9OwfeTpkAT7LT8z5W0VTv/lQ6XT5C2EhSaVqxC1LG /c3ZcXgJypSroXKJ/GHCaCsxGXEAQCdVfgwbfCFLeMRtbldTXKdaypWBRvI24hFM6zze VMq/zvsX0UOXWeIr8wxDmHUO6Col1uzgz8k+VP6wqwIH/gT2sHnmnfJpdWxhDaehuGQV 9UtLnrCgBszivVjfYJZQelAt+ldfaihYyEDoYk2s0mmbXbpJ0eKKyHe565Lp/2shgYfo imaKknz6TYq/c9YT9eGxPKVlumn871P8Van5gYm8mYBvOPU6+WIzKHkWg7QSd1/74K2A mHSg== 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 :in-reply-to:references:mime-version:dkim-signature; bh=je7nuNsfXk26lRmkb6ciZHwSXJTBCDyjnYltMGy9GKw=; b=CdvpV80ezLCbmspK2BGcw9DABwMxzAN6jy6shWYp2KTOqu5cyMYXauRt/WgW0zAeKk n01FcLZtl0YHhXalENx1Qi7SDQCByZAEXNh/K9CS3DR2IPmg83GUY8AcHfiyRbLiKfH2 AmAtYiKnsjJJMK/Fw92nnXOPEXR6aWIVmXmPuvBW8+x0rQjADqgYpmcuiJ2YpBOp84Tm uGqpll5fi1AuWGBuSZpg328mP+Hkq8vxIzWyUOevzZY0QIuvB9zTqD87nXpPtJnEy+er tJtZxtj0nrip3Prw84yds+AuOvlvsSyqCAH9amhflYYUhthhD5oprYT2x909cmYGL090 h3iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Bk8YVcnE; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u15si4754964ooq.37.2020.04.03.21.19.33; Fri, 03 Apr 2020 21:19:51 -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=@linaro.org header.s=google header.b=Bk8YVcnE; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726246AbgDDETF (ORCPT + 99 others); Sat, 4 Apr 2020 00:19:05 -0400 Received: from mail-oi1-f193.google.com ([209.85.167.193]:35950 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725468AbgDDETF (ORCPT ); Sat, 4 Apr 2020 00:19:05 -0400 Received: by mail-oi1-f193.google.com with SMTP id k18so8162197oib.3 for ; Fri, 03 Apr 2020 21:19:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=je7nuNsfXk26lRmkb6ciZHwSXJTBCDyjnYltMGy9GKw=; b=Bk8YVcnE/cBJl2ujaD7DGjNm//e+RUaeMJE3R4oTnEdfER1QAwCHybt2WimOnaczqF 1UQOyXoQ5Ng6kLHJ49G+EIv+Hp/OFZPCGcmy+f4NwDYWKCk+BOUadj6lUbHedg82lHBR aAx/e06OeA3U0eb5Hx5UBQ1gvFdpxplndrMBMnx5B85/dam1NdoOJBBTMzFG784StGTe 5AyOdVM3AakZGc1Z0N11r2ZZwEg+1tpABlQzQ9+PZSXdXahsklsQqJZURGFY0Zy4FH3y 2IVsQg9Z9Y0CW14QOuODdQpbGCdj6CcArqPWQe1KA+rV8YGGieKYlryjTjtfk8bxgvVK kctQ== 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=je7nuNsfXk26lRmkb6ciZHwSXJTBCDyjnYltMGy9GKw=; b=cQYpciwYrfVgJA6p0j4a215uugTCZMFSq9IMLvsW4+z3p2EZ/8VjKD8AJ6U6443Pm2 jJ587gHIF1anMT28GQSlS5biMRF+8ENrN6T5wqe6C/c66BOIbd8EdTKZIX0WZ1toi0gA o0XcKL2qR/RJamqGdTb6gHcfEPCBerjw1l2mvtJExuMqugjkSWEJ/kFLeGNwZeRYsypw XJoNNEtLiyDTLpQZrAhUaCpVtFMxJnlzXQJvN7nyuyhQ4JN8VDkkVu9KKaYOCpCEtMPu O8vj7/Xy3f4gMi+hT1jy27BioYN2pblTkqyItZBVnH/oi053PfHnOP4MG9M6RHborKy4 T2AQ== X-Gm-Message-State: AGi0PuYf1IuCdTt5a0ZT3zeA6Glp7VEOsl2kPGyTAgu+xQxe3RECfjNf IYohN/bvXQB+I8shpLo8DdYQDcmfQbKj/27FghTMGg== X-Received: by 2002:a05:6808:a0a:: with SMTP id n10mr5721046oij.10.1585973942770; Fri, 03 Apr 2020 21:19:02 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: John Stultz Date: Fri, 3 Apr 2020 21:18:50 -0700 Message-ID: Subject: Re: How to fix WARN from drivers/base/dd.c in next-20200401 if CONFIG_MODULES=y? To: Geert Uytterhoeven Cc: Yoshihiro Shimoda , "gregkh@linuxfoundation.org" , "rafael@kernel.org" , "iommu@lists.linux-foundation.org" , LKML , netdev 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 Fri, Apr 3, 2020 at 4:47 AM Geert Uytterhoeven wrote: > On Thu, Apr 2, 2020 at 7:27 PM John Stultz wrote: > > On Thu, Apr 2, 2020 at 3:17 AM Yoshihiro Shimoda > > wrote: > > > > > > I found an issue after applied the following patches: > > > --- > > > 64c775f driver core: Rename deferred_probe_timeout and make it global > > > 0e9f8d0 driver core: Remove driver_deferred_probe_check_state_continue() > > > bec6c0e pinctrl: Remove use of driver_deferred_probe_check_state_continue() > > > e2cec7d driver core: Set deferred_probe_timeout to a longer default if CONFIG_MODULES is set > > Note that just setting deferred_probe_timeout = -1 like for the > CONFIG_MODULES=n case doesn't help. Yea. I can see why in that case, as we're checking !IS_ENABLED(CONFIG_MODULES) directly in driver_deferred_probe_check_state. I guess we could switch that to checking (driver_deferred_probe_timeout == -1) which would have the same logic and at least make it consistent if someone specifies -1 on the command line (since now it will effectively have it EPROBE_DEFER forever in that case). But also having a timeout=infinity could be useful if folks don't want the deferring to time out. Maybe in the !modules case setting it to =0 would be the most clear. But that's sort of a further cleanup. I'm still more worried about the NFS failure below. > > Hey, > > Terribly sorry for the trouble. So as Robin mentioned I have a patch > > to remove the WARN messages, but I'm a bit more concerned about why > > after the 30 second delay, the ethernet driver loads: > > [ 36.218666] ravb e6800000.ethernet eth0: Base address at > > 0xe6800000, 2e:09:0a:02:eb:2d, IRQ 117. > > but NFS fails. > > > > Is it just that the 30 second delay is too long and NFS gives up? > > I added some debug code to mount_nfs_root(), which shows that the first > 3 tries happen before ravb is instantiated, and the last 3 tries happen > after. So NFS root should work, if the network works. > > However, it seems the Ethernet PHY is never initialized, hence the link > never becomes ready. Dmesg before/after: > > ravb e6800000.ethernet eth0: Base address at 0xe6800000, > 2e:09:0a:02:ea:ff, IRQ 108. > > Good. > > ... > -gpio_rcar e6052000.gpio: sense irq = 11, type = 8 > > This is the GPIO the PHY IRQ is connected to. > Note that that GPIO controller has been instantiated before. > > ... > -Micrel KSZ9031 Gigabit PHY e6800000.ethernet-ffffffff:00: > attached PHY driver [Micrel KSZ9031 Gigabit PHY] > (mii_bus:phy_addr=e6800000.ethernet-ffffffff:00, irq=197) > ... > -ravb e6800000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off > > Oops. > > -Sending DHCP requests .., OK > -IP-Config: Got DHCP answer from ... > ... > +VFS: Unable to mount root fs via NFS, trying floppy. > +VFS: Cannot open root device "nfs" or unknown-block(2,0): error -6 > > > Does booting with deferred_probe_timeout=0 work? > > It does, as now everything using optional links (DMA and IOMMU) is now > instantiated on first try. Thanks so much for helping clarify this! So it's at least good to hear that booting with deferred_probe_timeout=0 is working! But I'm bummed the NFS (or as you pointed out in your later mail, ip_auto_config) falls over because the network isn't immediately there. Looking a little closer at the ip_auto_config() code, I think the issue may be that wait_for_device_probe() is effectively returning too early, since the probe_defer_timeout is still active? I need to dig a bit more on that code, on Monday, as I don't fully understand it yet. If I can't find a way to address that, I think the best course will be to set the driver_deferred_probe_timeout value to default to 0 regardless of the value of CONFIG_MODULES, so we don't cause any apparent regression from previous behavior. That will also sort out the less intuitive = -1 initialization in the non-modules case. In any case, I'll try to have a patch to send out on Monday. thanks -john