Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp478331ybb; Fri, 3 Apr 2020 06:27:46 -0700 (PDT) X-Google-Smtp-Source: APiQypLQOdqRgNtVcX+pMysWpe8J7RMNpJHIZdSa85VfM/R+wdppv2CZ2CXaHPi9ZHy+w8qXvDjU X-Received: by 2002:aca:4082:: with SMTP id n124mr2839196oia.112.1585920466747; Fri, 03 Apr 2020 06:27:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585920466; cv=none; d=google.com; s=arc-20160816; b=Opj6QKkpgdoZ7i+mPdaDKBlf6zj1JimpA8kiwCmdonl8Pb+dC3/cEpZqp3mEL2QF2B E8FCU0gEArzuXMNr3wRaRPOAqa/vEvRMYfi2m9S8IrY5E90F/+EfTb93si65kBD+yCKM uLX32fNdwoRaZuJDPnlEjDQs9Zgni2TL9yUUrpbSLoqjkGbbmL3Q5tfNodvvErEgm28a evoB9RXwWiTNtbwJjtZoD1N/2E0qmI1UiG+LpVdgj8EVSG8eADMyqYBrgAS/VKhRYxow REx5n+Z+6fItEDm4+dcigTRZMSq7762Y8WaqC2YaOXclYHSgA1Zdv47m29gTN87ehAob 8uSA== 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; bh=OqCaoyULkRti7vSZNQ9Yg7YDSRokCroTLEsyV92N24k=; b=oDu7jzIF6u0wsqtrlts1hvYmSF59Pr0jGaMjST+i03VkfJbXWQ+i4R6kV75D0TmvZ2 5VRY4cSSG1M1JCjI3jlDQmayM2E9bBQxI5eE30y6eJ/Wdge3x6z/F4jP6COapoRbdpMm 05QjWuK4WcCOZgAHFUuccd8kVAcuYPT6Xkz0YL73C/jVwc9UZFT1nplG80JHuRANUQbY xsDNns3f0uUug45yxIafljs6nacc/2h8yJS6XlBZptVQViV15v826LelVqHoIZNeoNLn W78yOAhB0IX8q0T1S/VVNL57No1UKUH8i+QyuEatQg/jqOiaDvMlpxR4ZTt7rmCtX18z qPAA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m1si3734322oim.76.2020.04.03.06.27.34; Fri, 03 Apr 2020 06:27:46 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403781AbgDCNGH (ORCPT + 99 others); Fri, 3 Apr 2020 09:06:07 -0400 Received: from mail-oi1-f193.google.com ([209.85.167.193]:37527 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390770AbgDCNGG (ORCPT ); Fri, 3 Apr 2020 09:06:06 -0400 Received: by mail-oi1-f193.google.com with SMTP id u20so6008118oic.4; Fri, 03 Apr 2020 06:06:06 -0700 (PDT) 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=OqCaoyULkRti7vSZNQ9Yg7YDSRokCroTLEsyV92N24k=; b=OmbUxeIhGY4opoqn9d9LWfXToCy+ltbUdYO0sVVfaSeUwJIJuOzt2diGU761XLuxb0 dZGyhoU88hzLYkcFt4Eio5fbuSdcJ1Dshn5UzKojF7e9YYwxDyjl5NtWh4iNPDVE6SQA 0w8C606Joa/UTGbUm2n4PgCGn6jmfSy0IArVvx12wqjRMvfSAprtVVjTcp/Z3Bsp2NWq F7XH+VGHt92D7W28qFML7SryeNI73CdEsr4EyTEN1B+tgEgwdv3Rk5GM7ZPtrO6E98Wy 3HBUiP/05DJ5sTtdJhnGYjO+P98nOvWf7gpsWJdPKoh4qkKn7og2SMAboe2kkUqgnNna 2ocA== X-Gm-Message-State: AGi0PubVoXxlHnNkddumsv+OgfpZ+28n2QcgM84c3lMlMYkRdWJ4jc1y dIwSGZ8/Xi6donLWn8CEZ4rlBfZqmQfZwKzLURvcikYl X-Received: by 2002:aca:ad93:: with SMTP id w141mr2963325oie.54.1585919165884; Fri, 03 Apr 2020 06:06:05 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Geert Uytterhoeven Date: Fri, 3 Apr 2020 15:05:54 +0200 Message-ID: Subject: Re: How to fix WARN from drivers/base/dd.c in next-20200401 if CONFIG_MODULES=y? To: John Stultz Cc: Yoshihiro Shimoda , "gregkh@linuxfoundation.org" , "rafael@kernel.org" , "iommu@lists.linux-foundation.org" , LKML , netdev , "David S. Miller" , Alexey Kuznetsov , Hideaki YOSHIFUJI , Jakub Kicinski 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 Hi John, On Fri, Apr 3, 2020 at 1:47 PM 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. > > > > c8c43ce driver core: Fix driver_deferred_probe_check_state() logic > > > --- > > > > > > Before these patches, on my environment [1], some device drivers > > > which has iommus property output the following message when probing: > > > > > > [ 3.222205] ravb e6800000.ethernet: ignoring dependency for device, assuming no driver > > > [ 3.257174] ravb e6800000.ethernet eth0: Base address at 0xe6800000, 2e:09:0a:02:eb:2d, IRQ 117. > > > > > > So, since ravb driver is probed within 4 seconds, we can use NFS rootfs correctly. > > > > > > However, after these patches are applied, since the patches are always waiting for 30 seconds > > > for of_iommu_configure() when IOMMU hardware is disabled, drivers/base/dd.c output WARN. > > > Also, since ravb cannot be probed for 30 seconds, we cannot use NFS rootfs anymore. > > > JFYI, I copied the kernel log to the end of this email. > > > > 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. So the issue is not nfsroot in-se, but the ip-config that needs to happen before that. The call to wait_for_devices() in ip_auto_config() (which is a late_initcall()) returns -ENODEV, as the network device hasn't probed successfully yet, so ip-config is aborted. The (whitespace-damaged) patch below fixes that, but may have unintended side-effects. --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c @@ -1469,7 +1469,11 @@ static int __init ip_auto_config(void) /* Wait for devices to appear */ err = wait_for_devices(); if (err) +#ifdef IPCONFIG_DYNAMIC + goto try_try_again; +#else return err; +#endif /* Setup all network devices */ err = ic_open_devs(); Probably we want at least some CONFIG_ROOT_NFS || CONFIG_CIFS_ROOT, and ROOT_DEV == Root_NFS || ROOT_DEV == Root_CIFS checks. Thanks for your comments! Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds