Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1091365imm; Wed, 11 Jul 2018 17:09:27 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd7gX75b7MfrxXwvslvO9+W1YoNhFdyT44inxWDXHQYq0erhb6CcQ1P1APZfBZchxivsI9g X-Received: by 2002:a62:4a41:: with SMTP id x62-v6mr4664pfa.45.1531354167157; Wed, 11 Jul 2018 17:09:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531354167; cv=none; d=google.com; s=arc-20160816; b=hy5PCTryS7K6bZUQyd6f+NH4GMeQkaxZ9+kKOFSCHiBdVMn5ouE9C9zkI0gkVZV736 qMJSQaYFTjUIhYnhDCgabkwfzlaVbxtxilelXIld94QAPZq37aTYEx5w9vvV6o0QBpzr hoHDbA5PIwrlrzDGCNI65fGvLAJBaA/JrKjZT/BCwNIPSeaVSH862Q1ZT1If8DVZrjA2 lN9ReLe/r8wPR0qORAjkwRQOx2tFn352LLUlMMsYA0KiAO4lQ4Wd5t5ccIJfYEFZRbcm aZQzeaoKwIssrnJoHNd7sZf/3A7/LeYUmN2UwwOckpuN8eJfMUFbpZpwf29oQTKEXKHh CGjQ== 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 :arc-authentication-results; bh=IfWoeXcEHKJu3VoKbDGn13p9A8adtyNZwGGhMXQVq6c=; b=ENwwKCsFbzvyIH7HII6N783KsmwIjcE6SJ5NbNR5pL9vIdTV3E1+RDJQcX6XkfYOKd DrFxZQNfEd/1N10MV/5iRLS2yB9kK7E6C0vV7sR+v0qs3Asf0f43FnoCjvYMNGnsRgTB R7AdEL8KyIVpUFUJq9v+RCv6LzahFS7SgnBkaOQhMz2DR3awJm2AcaR46CoUU/mtt39r wDAibewLF5zqbPruTwGTniSS4E1lYdZ/63up8NK0YQP/FrjNbSKce2DdWAZO/Bts4cAe XZj8A08oOzvrPhRQd6KEVu+ChLDervga5FqhT+/vxuGyOihVNFWbI3cCvPDqGGBOmloE pK5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=F2Qivygn; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i4-v6si19643165pgl.435.2018.07.11.17.09.12; Wed, 11 Jul 2018 17:09:27 -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=@kernel.org header.s=default header.b=F2Qivygn; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733073AbeGKSTA (ORCPT + 99 others); Wed, 11 Jul 2018 14:19:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:50146 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726796AbeGKSTA (ORCPT ); Wed, 11 Jul 2018 14:19:00 -0400 Received: from mail-io0-f180.google.com (mail-io0-f180.google.com [209.85.223.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9A96620C0B for ; Wed, 11 Jul 2018 18:13:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1531332809; bh=JDToTqyJJQ6cciA0s6ONBo++EQNaafipnL5viEyeXCM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=F2QivygndEgxEj9XpMAgs++Cut0UqCoV7b0+kFCkaEFzW6lkslzE262p4UGXa1CH3 eSDNSYsrCZfC7K71HmtGBb6SvzF/al68H2IuBCL/sT3uLjuQDC01Qh9x+0vk7JkH/+ ctJoCqDITLyvDzb62hNewsQdvwL3G8YWbfQnIV1Q= Received: by mail-io0-f180.google.com with SMTP id i18-v6so9203331ioj.13 for ; Wed, 11 Jul 2018 11:13:29 -0700 (PDT) X-Gm-Message-State: AOUpUlHcQZKPW2mPvRaMGniLneCgvPQJq1O46QPXRNRCYZp6O7Trt+Yq +2BCueZIwocimxhY3bVTLSqQ6DNFb227+SWLjw== X-Received: by 2002:a6b:a10d:: with SMTP id k13-v6mr309733ioe.669.1531332809086; Wed, 11 Jul 2018 11:13:29 -0700 (PDT) MIME-Version: 1.0 References: <20180619214020.18608-1-robh@kernel.org> <20180711161443.GY16084@piout.net> In-Reply-To: <20180711161443.GY16084@piout.net> From: Rob Herring Date: Wed, 11 Jul 2018 12:13:17 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] ARM: at91: remove unnecessary of_platform_default_populate calls To: Alexandre Belloni Cc: Nicolas Ferre , "linux-kernel@vger.kernel.org" , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" 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 Wed, Jul 11, 2018 at 10:15 AM Alexandre Belloni wrote: > > Hi, > > On 09/07/2018 09:50:47-0600, Rob Herring wrote: > > On Tue, Jun 19, 2018 at 3:40 PM Rob Herring wrote: > > > > > > The DT core will call of_platform_default_populate, so it is not > > > necessary for machine specific code to call it unless there are custom > > > match entries, auxdata or parent device. Neither of those apply here, so > > > remove the call. > > > > > > Cc: Nicolas Ferre > > > Cc: Alexandre Belloni > > > Cc: linux-arm-kernel@lists.infradead.org > > > Signed-off-by: Rob Herring > > > --- > > > arch/arm/mach-at91/at91rm9200.c | 5 ----- > > > arch/arm/mach-at91/at91sam9.c | 5 ----- > > > arch/arm/mach-at91/sama5.c | 5 ----- > > > 3 files changed, 15 deletions(-) > > > > Ping? > > > > This breaks the platform in two different ways: > - PM is not working anymore because of the missing SRAM node > - the pinctrl driver fails to probe and so many drivers are > deferring the probe forever > > Relevant messages (once the earlycon crap is removed to let earlyprintk > do its job): > > at91_pm_sram_init: failed to find sram device! > AT91: PM not supported, due to no SRAM allocated So the at91_pm_sram_init function tries to get SRAM platform device, but it doesn't exist yet. Of course, that is fragile because while the device may exist, it's just luck that it's driver has probed already. Would using .init_late hook instead of .init_machine work for you? Ideally, couldn't much of this code be converted to a driver? It's a bit strange for initcall code to have a driver dependency. > > pinctrl-at91 ahb:apb:pinctrl@fc06a000: you need to specify at least one gpio-controller > pinctrl-at91: probe of ahb:apb:pinctrl@fc06a000 failed with error -22 So this one has the strange dependency that the child nodes probe before the parent node. That's backwards. Probe order is probably changing from link order (all the devices are created before drivers register) to device creation order. I think the fix is the pinctrl driver should just count the gpio child nodes rather than relying on aliases (which I'm not a fan of either). I can write a patch to do that. Rob