Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2874271pxb; Mon, 19 Apr 2021 16:43:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRxePgz+5jI5eg1FVJ4QmSTELPYZRekitK+8ctfyrJUP1LTAurbUWXJ6KaKfC/r+g1yOcl X-Received: by 2002:a17:90a:3b4c:: with SMTP id t12mr1825741pjf.142.1618875824302; Mon, 19 Apr 2021 16:43:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618875824; cv=none; d=google.com; s=arc-20160816; b=d+Yct8w9lVkKdCwfuny0jPoFcS5klkxCJZmogFzc+VRLBMFm4WIrynvc57jUOYK/PS zKy0BzRS0Vld+iHTETZp/uHuXPAYUdHz46hq4MkhkZdwbJ0LWLnyFc1w2o/u2kYhtSu3 hU5EcDbW98oKlsM0cNPTyTI2441oYZy4hEU5orP4pz/WElCej3ZesC15Xe/d9IdaBR1j D+ASZKx4hnGVeN0zR01LmL7CzhBLs+sPEamzSUEGZ4hwKB3U74xcYtnqBl6O26oxfmap 6KUrEKlnbjZqu7u6caC21r2EYZJS6Li6z7b6C0jJgWrE0kfcj5p32J6XG7QxEZ0uQNmz dFlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=YfTDNxUjME1kzwn4ONpBlmaWp5uEs0PGjlewRbiJ8O0=; b=mzsNNxae8iR1p+zyjfeuZKjeo2mGxR9iOZH2U3fgHyVULtfrKGC/oXUz6gZiYiuNTB tmUK64iWJuKNt1IA5c5lZQ1KcDFFc2b1azkfcl65r5zHICavUsKW7Yomrm7Yj35pFVBw 5+ELeCc8IY0W4ddfcPtwp/okPpzPKLEuwAnt7SP9WXaBQCpGmhD+hkKW+L/dWPdJ+UG3 2lUULNE6M+FLvPwUzAlQPCakXyQWmel2mcffKybocnNy/XGZMcL5zDJA7LQwAkQnVZT6 SG/fN9djZOXwmgS+GxPAvpuf7kT4njiRYvnqPM9/WZsLWWJgEmofg6QpD2kqyPjLuSz2 ZwFw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v4si1102050pjk.140.2021.04.19.16.43.31; Mon, 19 Apr 2021 16:43:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232484AbhDSXnv (ORCPT + 99 others); Mon, 19 Apr 2021 19:43:51 -0400 Received: from gw.atmark-techno.com ([13.115.124.170]:42730 "EHLO gw.atmark-techno.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232561AbhDSXnp (ORCPT ); Mon, 19 Apr 2021 19:43:45 -0400 Received: from mail-oi1-f199.google.com (mail-oi1-f199.google.com [209.85.167.199]) by gw.atmark-techno.com (Postfix) with ESMTPS id 1A8AF804A5 for ; Tue, 20 Apr 2021 08:43:09 +0900 (JST) Received: by mail-oi1-f199.google.com with SMTP id w4-20020a0568081404b0290102a1fd05b2so12257311oiv.6 for ; Mon, 19 Apr 2021 16:43:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=YfTDNxUjME1kzwn4ONpBlmaWp5uEs0PGjlewRbiJ8O0=; b=c5aIE7mJIGs/PjQwXaYrpGMgLXkHoVnWmYJWIzESwYxw5FO95jboFdx9WFn97CsZzn 6m+BkTKZJK5ze7VcnWmjCCyEJnOmujT6dfkRrXS9Z2PCwNFsrwG7gz/a5BGjk7SDsemD dyCMNwFl8VTy9ajwKkOFyq6MuSotKAhJhcZuD0Vj+u7j2zbaoQPOmVgEFwp8AjtTaRhM Gut9+tSVMwVFXJPIuZTMGSA6mc72m/le4rVFLexv/kT6HjAmkvCSmj3+nDOA7zZog+bp bk8IWSovTB75W8fGhk5wNMz+uVgd5XRKuuUj1dK2yq7S24Rh9Tk61dI5Kg44/aNNnOu8 XTgw== X-Gm-Message-State: AOAM531AbXTyIVaaHZZAKKn9Nb7kt7LHclKOt/DsSO0leTA/+6L4/U4G TnTf3VnVy553jc2zCLiOg8JE7t+J8Sbpe2LP2u4GQNSyS3syAS/8JLx/Rg4E7yajIeD0Tb8S3nO 7+4pj4fbcHrtLB0pnhOrlE+GKRTI6 X-Received: by 2002:a17:90a:1c1:: with SMTP id 1mr1708195pjd.190.1618875776934; Mon, 19 Apr 2021 16:42:56 -0700 (PDT) X-Received: by 2002:a17:90a:1c1:: with SMTP id 1mr1708139pjd.190.1618875776711; Mon, 19 Apr 2021 16:42:56 -0700 (PDT) Received: from pc-0115 (76.125.194.35.bc.googleusercontent.com. [35.194.125.76]) by smtp.gmail.com with ESMTPSA id r3sm8384971pgn.82.2021.04.19.16.42.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Apr 2021 16:42:55 -0700 (PDT) Received: from martinet by pc-0115 with local (Exim 4.94) (envelope-from ) id 1lYdXa-002mPj-58; Tue, 20 Apr 2021 08:42:54 +0900 Date: Tue, 20 Apr 2021 08:42:44 +0900 From: Dominique MARTINET To: Arnd Bergmann Cc: Geert Uytterhoeven , "Alice Guo (OSS)" , gregkh , Rafael Wysocki , Horia =?utf-8?Q?Geant=C4=83?= , aymen.sghaier@nxp.com, Herbert Xu , David Miller , Tony Lindgren , Geert Uytterhoeven , Michael Turquette , Stephen Boyd , Vinod Koul , peter.ujfalusi@gmail.com, Andrzej Hajda , Neil Armstrong , Robert Foss , David Airlie , Daniel Vetter , Kevin Hilman , tomba@kernel.org, jyri.sarha@iki.fi, Joerg Roedel , Will Deacon , Mauro Carvalho Chehab , Ulf Hansson , Adrian Hunter , Kishon , Jakub Kicinski , Linus Walleij , Roy Pledge , Leo Li , Santosh Shilimkar , Matthias Brugger , Eduardo Valentin , Keerthy , Felipe Balbi , Tony Prisk , Alan Stern , Wim Van Sebroeck , Guenter Roeck , Linux Kernel Mailing List , "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , linux-omap , Linux-Renesas , linux-clk , dmaengine@vger.kernel.org, dri-devel , "open list:ARM/Amlogic Meson SoC support" , Linux ARM , "open list:IOMMU DRIVERS" , Linux Media Mailing List , linux-mmc , Networking , linux-phy@lists.infradead.org, "open list:GPIO SUBSYSTEM" , linuxppc-dev , linux-staging@lists.linux.dev, "moderated list:ARM/Mediatek SoC..." , Linux PM list , USB list , LINUXWATCHDOG Subject: Re: [RFC v1 PATCH 3/3] driver: update all the code that use soc_device_match Message-ID: References: <20210419042722.27554-1-alice.guo@oss.nxp.com> <20210419042722.27554-4-alice.guo@oss.nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Arnd Bergmann wrote on Mon, Apr 19, 2021 at 02:16:36PM +0200: > In some cases, you can use the device_link infrastructure to deal > with dependencies between devices. Not sure if this would help > in your case, but have a look at device_link_add() etc in drivers/base/core.c I'll need to actually try to convince myself but if creating the link forces driver registration then it should be workable. > > In this particular case the problem is that since 7d981405d0fd ("soc: > > imx8m: change to use platform driver") the soc probe tries to use the > > nvmem driver for ocotp fuses for imx8m devices, which isn't ready yet. > > So soc loading gets pushed back to the end of the list because it gets > > defered and other drivers relying on soc_device_match get confused > > because they wrongly think a device doesn't match a quirk when it > > actually does. > > > > If there is a way to ensure the nvmem driver gets loaded before the soc, > > that would also solve the problem nicely, and avoid the need to mess > > with all the ~50 drivers which use it. > > > > Is there a way to control in what order drivers get loaded? Something in > > the dtb perhaps? > > For built-in drivers, load order depends on the initcall level and > link order (how things are lined listed in the Makefile hierarchy). > > For loadable modules, this is up to user space in the end. > > Which of the drivers in this scenario are loadable modules? All the drivers involved in my case are built-in (nvmem, soc and final soc_device_match consumer e.g. caam_jr that crashes the kernel if soc is not identified properly). I frankly don't like the idea of moving nvmem/ above soc/ in drivers/Makefile as a "solution" to this (especially as there is one that seems to care about what soc they run on...), so I'll have a look at links first, hopefully that will work out. Thanks, -- Dominique