Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp389951ybb; Fri, 3 Apr 2020 04:49:04 -0700 (PDT) X-Google-Smtp-Source: APiQypKWsnEN36t4NswZkrpfC8sYzXVRL2NARdR7cRkxiRzKwtx/0uoi0eh1dTbT+kR8TLOnbD0W X-Received: by 2002:a4a:3854:: with SMTP id o20mr6298379oof.69.1585914544333; Fri, 03 Apr 2020 04:49:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585914544; cv=none; d=google.com; s=arc-20160816; b=AOzLWCnzLRNNKZeT9C/nJ602J/8czWlQOaNjAcklX42RSKaDmkixvrJa1Wl6kMdemI rZzUUTR/T18nAgYag7bOQe4ZSp6pEN8jnf0A8AzrHTi9OfnP3TVrBhcd5zC7wqHtWK54 qhPZbRH6ha/Gvty7n4DhvnkFrlv+Iq/y1q9ZO5WJQnEBIoTOIMDC1C/KqRa09E/Go9Cs 3yy6B3U0wMupJKTlUhoKXfJmCScf9wS1M+kNaVr3yJIIGICrUHTZXrWYyQ4VAR/oGX0C OnGPifoBwGUtRzOY6VLOXtR0T4S/Gn0fdAk6vJ7zP1wonJXipZ9KS7seM8LqerTJr5cs YMAg== 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=WLQ125LqNkhbday+yt6StLeA1O5IE8GF+ApE3jgSAcg=; b=ZgScV+MHMGn4CIxIkVpfm5djIuDAb5soaLjHLoyiftwf/9dn1B6t17QysNvrR2qcAR 9yfqcMbE4PH5XwV8J66WZx1VxGnhevL4b+fcA2N/0rM/rbGND4adqjRGeoxt+5Cd85fV boRJ2GyuyKG+5hn5rNGjkugk9hmzArLgk8Al/Jxc7h4dOuvLzYMMjyKU9UWOyeY7RKO4 nvJ/GiUJTN6DL/JT1WCUTawa1rXPtBe0gOlrk+IW77cXZ7i+bQfrm1Luh0nLU4H0rp1i kKvDBDLMb6/NuOIBABnjjTUzCvziVmH1eLz3V8KoQfNQ5Z2IVOu1fJcifFcZHMR/UJtr L0MQ== 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 x14si3490387ooq.78.2020.04.03.04.48.50; Fri, 03 Apr 2020 04:49:04 -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 S2390487AbgDCLr7 (ORCPT + 99 others); Fri, 3 Apr 2020 07:47:59 -0400 Received: from mail-ot1-f68.google.com ([209.85.210.68]:39785 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728012AbgDCLr6 (ORCPT ); Fri, 3 Apr 2020 07:47:58 -0400 Received: by mail-ot1-f68.google.com with SMTP id x11so6929514otp.6; Fri, 03 Apr 2020 04:47:58 -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=WLQ125LqNkhbday+yt6StLeA1O5IE8GF+ApE3jgSAcg=; b=rQs0NV8OTSUXb96TmIvFGL+/+NqlS/rrWZsYgECNM/41R1XtWV97jCwDR1QzOppTAz p44La1xeHWKbI02xOWOsUDQKikHzlfw6sQo7Vwl6YptAmZ/ZDtIb3falhBRRi1YDuglP ImbzgP/vryARF8i77i0sCqdS1C9SrfR9cq93iGemuTDJkE7TsVWS5mFU8UBrU6TieBVU 5dtx/N7MzDJrubCfdA9roI9EZecGiMkOhNGDnTJ+8D8Gr+8DgZvpfPWGQ8//O1xc7uUG 5NVHOXka+OAVONRRdTwzN9ZXtd3AvfLiFas1ZsMif9vnp4RjFprcsJWHmuJyvinRXEGW bBEw== X-Gm-Message-State: AGi0PubT7+YkNOobNGoBZBNf2jqf3cnCTUYi62ZygZpzcsjJHXdPCQIi 9NTg041Czyh2g9ghk+zMvdffFx8obtrpBRs2PA4= X-Received: by 2002:a4a:a442:: with SMTP id w2mr6218727ool.90.1585914478184; Fri, 03 Apr 2020 04:47:58 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Geert Uytterhoeven Date: Fri, 3 Apr 2020 13:47:46 +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 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 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. 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. 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