From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gw.atmark-techno.com (gw.atmark-techno.com [13.115.124.170]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3EDD22F9A for ; Mon, 19 Apr 2021 23:43:10 +0000 (UTC) Received: from mail-oi1-f198.google.com (mail-oi1-f198.google.com [209.85.167.198]) by gw.atmark-techno.com (Postfix) with ESMTPS id 040CB804A2 for ; Tue, 20 Apr 2021 08:43:08 +0900 (JST) Received: by mail-oi1-f198.google.com with SMTP id r20-20020a0568080ab4b0290186e76a5ddaso2046951oij.21 for ; Mon, 19 Apr 2021 16:43:08 -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=qhZSmboTP15B1ZiKFwdzsJaoYtESMbdjbPlqKlocUOnaHg6fFLvzv3cAzCFYh6yoIp cNwyN2UF0MisZjOltcmR/fRmBsr0CTB/FkEy3G5tOpsAST1biYmV2NTY2xQ78bMRBX0o 4X+hmhm5sYZAGjpCVFViFmqmvqldHVi1kZmRloDiiJ2LrHpdvIx9u6AOs/9EhAUebS5t EtMXKO/PFvwpEVW34tFqWaH2u8xenKBnNb2R0gtqTRTqjeIUg3HNAjlQKoNw0hQpD4o9 VO1UvP5sHRbpGBafAoyrz7BPOyKG20uzewvLECRbqmDnl2sZtxjrKQvw6oku7QMz3ekn 8cCg== X-Gm-Message-State: AOAM530/htsBfOAbVHyo7SXaDkVG8D5CBP4YrrIgc0SSpflZzE+IQu9m 7WY2vROHXO6H0UMKZQq+ocT4B8Bw8IlbA1q4IlbHa6hpKM6fogCQfwy+y4WbBunNLUGOibrtR4W juEBttT+pQ47/Mb5aAI3feKFYEBfXmw== X-Received: by 2002:a17:90a:1c1:: with SMTP id 1mr1708167pjd.190.1618875776929; Mon, 19 Apr 2021 16:42:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRGNIqy2AO5m9iOwuC4N09BxordE8LmUXYTIIeyniOtbCQKfA0MKaQl391n1ZLV3YIJOra8w== 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> X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FDFBC433ED for ; Tue, 20 Apr 2021 00:42:17 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4CAE46135F for ; Tue, 20 Apr 2021 00:42:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4CAE46135F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=atmark-techno.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4FPPyt53FHz3027 for ; Tue, 20 Apr 2021 10:42:14 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=atmark-techno.com (client-ip=13.115.124.170; helo=gw.atmark-techno.com; envelope-from=dominique.martinet@atmark-techno.com; receiver=) Received: from gw.atmark-techno.com (gw.atmark-techno.com [13.115.124.170]) by lists.ozlabs.org (Postfix) with ESMTP id 4FPNfn5gs5z2xZt for ; Tue, 20 Apr 2021 09:43:11 +1000 (AEST) Received: from mail-oi1-f198.google.com (mail-oi1-f198.google.com [209.85.167.198]) by gw.atmark-techno.com (Postfix) with ESMTPS id BC2CB804CA for ; Tue, 20 Apr 2021 08:43:09 +0900 (JST) Received: by mail-oi1-f198.google.com with SMTP id s9-20020acadb090000b0290101bacefaa4so12259265oig.2 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=NpLdI0/B3EJg0dK0LMy5hUyT+HlDRboSqM6F0ZKUHp9sLTE6QpiqZ7toe5QKJNy+6q DwbZLB/Tk3guTkTizqN/lBpBo8pYT5u5+xxGUrkrP0LWqwMJKt6IXZp8G6yzAOl2POoh vV5HBmnNEbQ4Nm+j4Yo/y5ZI/9s6KOwxwevTmt+vH+eA9raauJDdO/9nH98U41xbvyMX R0Vy2rVSnh4RSGDbXsd/THH0yt/J7TLUxUCkSxOIURQcRmyUYiahCB6Bat3z7o7W4CuU kFZ2wlFGq35m+J/CnD38Rk2Bvg94z+gY9J+ImL6nutHH0OUwD3BUuKzRvsxho00yaTli 8mKA== X-Gm-Message-State: AOAM531gjUbc03GjGINppqo/NDUQO4lhfW2Z2Q5aIJIZAO9SreifCEKA bOxvGuWlNEhI9vvFIpRjtMZ2CI9qHT1FAP6PiKFcJEL4OQ8RRJkZY9NvxiR9WaTabLWcpeYBiH/ D2S3iG36UPWX78PW3BTr8lFsS7kzh8A== X-Received: by 2002:a17:90a:1c1:: with SMTP id 1mr1708187pjd.190.1618875776933; Mon, 19 Apr 2021 16:42:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRGNIqy2AO5m9iOwuC4N09BxordE8LmUXYTIIeyniOtbCQKfA0MKaQl391n1ZLV3YIJOra8w== 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 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: X-Mailman-Approved-At: Tue, 20 Apr 2021 10:41:52 +1000 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ulf Hansson , aymen.sghaier@nxp.com, Geert Uytterhoeven , Rafael Wysocki , David Airlie , Michael Turquette , dri-devel , Linux Kernel Mailing List , Andrzej Hajda , Networking , linux-phy@lists.infradead.org, peter.ujfalusi@gmail.com, linux-clk , Linux-Renesas , Wim Van Sebroeck , Herbert Xu , Horia =?utf-8?Q?Geant=C4=83?= , Kevin Hilman , Joerg Roedel , Neil Armstrong , linux-staging@lists.linux.dev, "open list:IOMMU DRIVERS" , Kishon , Tony Lindgren , linux-omap , Geert Uytterhoeven , Jakub Kicinski , Linus Walleij , Guenter Roeck , Linux Media Mailing List , LINUXWATCHDOG , Will Deacon , Linux PM list , linuxppc-dev , Eduardo Valentin , "open list:GPIO SUBSYSTEM" , "moderated list:ARM/Mediatek SoC..." , Santosh Shilimkar , Matthias Brugger , "open list:ARM/Amlogic Meson SoC support" , Mauro Carvalho Chehab , Linux ARM , "Alice Guo \(OSS\)" , Felipe Balbi , tomba@kernel.org, Stephen Boyd , gregkh , Alan Stern , USB list , linux-mmc , Adrian Hunter , Robert Foss , Leo Li , Tony Prisk , Vinod Koul , "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , Daniel Vetter , Keerthy , dmaengine@vger.kernel.org, Roy Pledge , jyri.sarha@iki.fi, David Miller Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF618C433B4 for ; Mon, 19 Apr 2021 23:43:17 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4A1C561279 for ; Mon, 19 Apr 2021 23:43:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4A1C561279 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=atmark-techno.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id DC7D14029E; Mon, 19 Apr 2021 23:43:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bFyeR5Q8a4Lw; Mon, 19 Apr 2021 23:43:15 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTP id 9BB57402A3; Mon, 19 Apr 2021 23:43:15 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 79DF2C000F; Mon, 19 Apr 2021 23:43:15 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists.linuxfoundation.org (Postfix) with ESMTP id E365FC000B for ; Mon, 19 Apr 2021 23:43:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id D0EEB401C4 for ; Mon, 19 Apr 2021 23:43:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pmq9bLq6_4pp for ; Mon, 19 Apr 2021 23:43:10 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from gw.atmark-techno.com (gw.atmark-techno.com [13.115.124.170]) by smtp2.osuosl.org (Postfix) with ESMTP id 4450140181 for ; Mon, 19 Apr 2021 23:43:10 +0000 (UTC) Received: from mail-ot1-f71.google.com (mail-ot1-f71.google.com [209.85.210.71]) by gw.atmark-techno.com (Postfix) with ESMTPS id 839BF8047F for ; Tue, 20 Apr 2021 08:43:08 +0900 (JST) Received: by mail-ot1-f71.google.com with SMTP id l10-20020a056830054ab0290241bf5f8c25so10704978otb.11 for ; Mon, 19 Apr 2021 16:43:08 -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=CnVzoI1AZ1LSVEH4pO0S/AT+i9/uGe5+i3jbnpegv4KRXnZljA8bSTPBbpCCOFubOD vnIcGWSqxmg8kd+D8rhlfggzv4hhKQwKEd72weeujidubNx649MyvFQxOJ1q3MrcIsdF 5oT4hJYLb/hraOXTWiSEDWm2ruJdgVrLZmLaCiAknmnfqAxzXJzZ/YnC0iJA97MIcIWu tDbyqIlq5tOwxDrF6kgQs/BxPDmI+o/xO3qYV5dIvC70g9kB9bVjQMPedaVf63Fs1jMJ btHYQeryFU+PfRAD+Vp/alRUvlHg8oIDiJNcw9HndUSDTI9QX5FXMeSf6vaTwiV05cAC qY5w== X-Gm-Message-State: AOAM531q2BbznfGQat0uRNmw5HeAcK9a2yA42lu/ECIJXbrLUgmGWUT7 RtquI+7Tj+G/3ODX9eWiV6pBY6nmhZAgu4xXZ4GIZNnB/YNnK2KizGjLhtckvtecibeTzE6wevW J3h9XcG5eYWPtGTof5TobuztM41q5LrG2Ow== X-Received: by 2002:a17:90a:1c1:: with SMTP id 1mr1708189pjd.190.1618875776933; Mon, 19 Apr 2021 16:42:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRGNIqy2AO5m9iOwuC4N09BxordE8LmUXYTIIeyniOtbCQKfA0MKaQl391n1ZLV3YIJOra8w== 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 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-Disposition: inline In-Reply-To: Cc: Ulf Hansson , aymen.sghaier@nxp.com, Geert Uytterhoeven , Rafael Wysocki , David Airlie , Michael Turquette , dri-devel , Linux Kernel Mailing List , Andrzej Hajda , Networking , linux-phy@lists.infradead.org, peter.ujfalusi@gmail.com, linux-clk , Linux-Renesas , Wim Van Sebroeck , Herbert Xu , Horia =?utf-8?Q?Geant=C4=83?= , Kevin Hilman , Neil Armstrong , linux-staging@lists.linux.dev, "open list:IOMMU DRIVERS" , Kishon , Tony Lindgren , linux-omap , Geert Uytterhoeven , Jakub Kicinski , Linus Walleij , Guenter Roeck , Linux Media Mailing List , LINUXWATCHDOG , Will Deacon , Linux PM list , linuxppc-dev , Eduardo Valentin , "open list:GPIO SUBSYSTEM" , "moderated list:ARM/Mediatek SoC..." , Santosh Shilimkar , Matthias Brugger , "open list:ARM/Amlogic Meson SoC support" , Mauro Carvalho Chehab , Linux ARM , "Alice Guo \(OSS\)" , Felipe Balbi , tomba@kernel.org, Stephen Boyd , gregkh , Alan Stern , USB list , linux-mmc , Adrian Hunter , Robert Foss , Leo Li , Tony Prisk , Vinod Koul , "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , Daniel Vetter , Keerthy , dmaengine@vger.kernel.org, Roy Pledge , jyri.sarha@iki.fi, David Miller X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" 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 _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35959C433B4 for ; Mon, 19 Apr 2021 23:43:44 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 82A9861104 for ; Mon, 19 Apr 2021 23:43:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 82A9861104 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=atmark-techno.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=7sSve2lHbkq+WtfJ+KJ1xDiwmGqw0u58REtN3yq7Z0Q=; b=QdOh9NzDjUN4qRLA15s/JvF3t okz5XE9scn5Mbi+JNWG8b0GBz8oncTudvoc/4mfP7ytBJwKUCStQSjHV9kKhG/CvMHOKdFeGfzYnl 1XUDAMXIyObzIyxrFzeZ0xf8T9K/VigYjwjVh91eS44TnEcqVKvDfIv/e4Xsfgi06p6JV2xz5NhUO 4wcnDh5IMfiDPxe9IqBqZ3oWNvKBBRn3I1ruTdrvyAgnJszV5vGTuH/QHdZZh6iATmpqTJMmkI6JK 9MCJQXbSSGtNSbDCjSHnCpAYkCBcXm3lf3kxF+qUWddKD+jgEwSqdtO2gp4PKnJ5VIowgWY2YTYCh kWVjUOX+g==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lYdY1-00AoGc-PB; Mon, 19 Apr 2021 23:43:24 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lYdXu-00AoFa-EQ for linux-mediatek@desiato.infradead.org; Mon, 19 Apr 2021 23:43:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=YfTDNxUjME1kzwn4ONpBlmaWp5uEs0PGjlewRbiJ8O0=; b=y4LaUB7MiqEHNQI5aDYyFOqHhf Q4wHh75LMvt9Ywx3Z9IXQ6kcil0vo3uk6yhP17EW2yS7GlWuxzd8ZG2nESCzOmxDJZpMF8ktHLWo5 a6zizZKSvuIyyuP0Hk3DOB25sZ4tYwjjVGtrftlDwI0ovsNE5HxQcU7oXDco3y6XUJ9DuDGvsy7Rp dmYLtuRst2CgS8CNVTeFOxgdDpFzlSzI29E0I4BYtO68iSSglWdJ+5EEAUx272fuZcm5qMsAhuI7U jm1/HcCFdm57VRr1o+/3fImAcV7wOZLTJm3xIOkfa6Bq2othVK6w7zIT/fUjbk7x3JTwqsXzGnoA9 q/xw9zaw==; Received: from gw.atmark-techno.com ([13.115.124.170]) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lYdXr-00Bj7v-17 for linux-mediatek@lists.infradead.org; Mon, 19 Apr 2021 23:43:13 +0000 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 57BF6804B5 for ; Tue, 20 Apr 2021 08:43:09 +0900 (JST) Received: by mail-oi1-f199.google.com with SMTP id a2-20020a544e020000b02901864ae76be1so2494859oiy.7 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=K8zeCMgMK2RqKuhFSd4tyjIhFuArfU0PKODGQSBuTRmQKOXOTnHuQSPORNZP+eZRBx OVXL6Lk3weITimLIyxGAOBMQY2hS8bDwdTj2ZxDWAGmbRJeATc2u5lRTWE1K07SQg02I Rl/7M2gvMFT98nKFS/KSwoN/BlCpfHnns8RKEF/Csc2rq+1tPzq3pDvCSH4+bVBHCg6D gpSatFn5agkejQSqpL+anIQHfFp2ZzhujTWLMcfPhEI0c/wYUFUAEhiVi/kkzI5C+L8d 4Foj7Lz7M4gzJAXToxN1okLkmBU6RF0iUhGU4WsENSzhc07qLLnFCSt1o1BYAemNUukZ mGgw== X-Gm-Message-State: AOAM532f13C6mek8AWSIJkHupU6bzFKqbgmUK1o+Nc1yQiYmvymD8cGO nrysEJ8oJv9JgTlprnOnCnabbFCeE7bOt/HfrNqbzJtjJqHAmIVFB/NMlE2/Zzt3F0VSmiskT0+ jW6/LDP+xFoHul5/S52DlHjl3XczCpeCLOjZA X-Received: by 2002:a17:90a:1c1:: with SMTP id 1mr1708186pjd.190.1618875776933; Mon, 19 Apr 2021 16:42:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRGNIqy2AO5m9iOwuC4N09BxordE8LmUXYTIIeyniOtbCQKfA0MKaQl391n1ZLV3YIJOra8w== 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-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210419_164311_202554_1598E4F7 X-CRM114-Status: GOOD ( 31.37 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.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 _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86809C433ED for ; Mon, 19 Apr 2021 23:43:13 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1AA5561279 for ; Mon, 19 Apr 2021 23:43:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1AA5561279 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=atmark-techno.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 10DD789BBE; Mon, 19 Apr 2021 23:43:12 +0000 (UTC) Received: from gw.atmark-techno.com (gw.atmark-techno.com [13.115.124.170]) by gabe.freedesktop.org (Postfix) with ESMTP id C395C89BBE for ; Mon, 19 Apr 2021 23:43:10 +0000 (UTC) Received: from mail-oo1-f70.google.com (mail-oo1-f70.google.com [209.85.161.70]) by gw.atmark-techno.com (Postfix) with ESMTPS id 89A22804C2 for ; Tue, 20 Apr 2021 08:43:09 +0900 (JST) Received: by mail-oo1-f70.google.com with SMTP id w13-20020a4ab6cd0000b02901eb16e42655so3407199ooo.11 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=QDA4EioV6UW8bseUaYhDSQhzuGN3bSDKmHkMMmwiGpFfwQjmpVAdCyPbDGp+l/Vsi4 fbmlU5lvr+txfw8IOKdkllJ2NJ9Xzd4M10bcuSqmg0BEBeP1FxJABn+aLdfZJ2c8AzM0 8knWevwUmK017AU3z7SrAjkccD0opZWn60726aUZgXFvsjIHftUZvKK6PHrWP7gLJuxS qrUORFqtCJRzql9g3o6kb30aC3YGrnS2I2U/tqxbNTbrRuQ79baOCKBJUUZvqyViVIcF aa/JnJCUR9tsVAnmnBezurTmNNuJjYdYr6UjIQC1PtwTzIBbrJBp/3+3gVj9jK0O0Kai OWUw== X-Gm-Message-State: AOAM533gFCtEPGtjmy1XhL4rW2wrDLhBHYdCaCuk87hADOWDzabSwkju UcVbWh3AtaDKlx95ynoS1LWALyK3dzSsxzk/irroW/18Gp7HnpJRtLTh6b8FhqGdJIEczbGnRuR 97pCj2b0089hZBGZUn6rNBCW9NuAr71pN X-Received: by 2002:a17:90a:1c1:: with SMTP id 1mr1708166pjd.190.1618875776929; Mon, 19 Apr 2021 16:42:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRGNIqy2AO5m9iOwuC4N09BxordE8LmUXYTIIeyniOtbCQKfA0MKaQl391n1ZLV3YIJOra8w== 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 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-Disposition: inline In-Reply-To: X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ulf Hansson , aymen.sghaier@nxp.com, Geert Uytterhoeven , Rafael Wysocki , David Airlie , Michael Turquette , dri-devel , Linux Kernel Mailing List , Andrzej Hajda , Networking , linux-phy@lists.infradead.org, peter.ujfalusi@gmail.com, linux-clk , Linux-Renesas , Wim Van Sebroeck , Herbert Xu , Horia =?utf-8?Q?Geant=C4=83?= , Kevin Hilman , Joerg Roedel , Neil Armstrong , linux-staging@lists.linux.dev, "open list:IOMMU DRIVERS" , Kishon , Tony Lindgren , linux-omap , Geert Uytterhoeven , Jakub Kicinski , Guenter Roeck , Linux Media Mailing List , LINUXWATCHDOG , Will Deacon , Linux PM list , linuxppc-dev , Eduardo Valentin , "open list:GPIO SUBSYSTEM" , "moderated list:ARM/Mediatek SoC..." , Santosh Shilimkar , Matthias Brugger , "open list:ARM/Amlogic Meson SoC support" , Mauro Carvalho Chehab , Linux ARM , "Alice Guo \(OSS\)" , Felipe Balbi , tomba@kernel.org, Stephen Boyd , gregkh , Alan Stern , USB list , linux-mmc , Adrian Hunter , Robert Foss , Leo Li , Tony Prisk , Vinod Koul , "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , Keerthy , dmaengine@vger.kernel.org, Roy Pledge , jyri.sarha@iki.fi, David Miller Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5AC13C433B4 for ; Mon, 19 Apr 2021 23:43:40 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 58E9061104 for ; Mon, 19 Apr 2021 23:43:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 58E9061104 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=atmark-techno.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=6W/FHfHew3zHC307tPG6KF4TYLT8yip/i8Zo10VQNPE=; b=N+kl88XKFlAwjwLRbV3v8gyEd Rj5Qm1m/jYjguoV98HipO/f0n9qJ57HGQzzdfv46zPHYuScoBaAnViuEuck+afBwMqWamwNubGWtR w7fUFCkIFmbjMSiOg71feYDUTCJVZeCeC83FJCriyRijoZSScZUsQmzUdSHn4NXgijzn6aZR0YOiY IuGQ6WAoeud3jEsPpuT5sdcyfAWSrHQ9cnri+w7vpTRp1PyxOWcpJOZmWfO/B8wFRN+MPtFii62Ok HyQWKLFlZJQkLWL719Ciwi9euw8DBYhb2KLSQ1gqza4XoWgeBHBlSmwKjb1b7e1g1B7RqTADVSkml IKSNtCn4w==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lYdY7-00AoGn-O8; Mon, 19 Apr 2021 23:43:27 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lYdXu-00AoFb-JN for linux-amlogic@desiato.infradead.org; Mon, 19 Apr 2021 23:43:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=YfTDNxUjME1kzwn4ONpBlmaWp5uEs0PGjlewRbiJ8O0=; b=y4LaUB7MiqEHNQI5aDYyFOqHhf Q4wHh75LMvt9Ywx3Z9IXQ6kcil0vo3uk6yhP17EW2yS7GlWuxzd8ZG2nESCzOmxDJZpMF8ktHLWo5 a6zizZKSvuIyyuP0Hk3DOB25sZ4tYwjjVGtrftlDwI0ovsNE5HxQcU7oXDco3y6XUJ9DuDGvsy7Rp dmYLtuRst2CgS8CNVTeFOxgdDpFzlSzI29E0I4BYtO68iSSglWdJ+5EEAUx272fuZcm5qMsAhuI7U jm1/HcCFdm57VRr1o+/3fImAcV7wOZLTJm3xIOkfa6Bq2othVK6w7zIT/fUjbk7x3JTwqsXzGnoA9 q/xw9zaw==; Received: from gw.atmark-techno.com ([13.115.124.170]) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lYdXr-00Bj7w-1A for linux-amlogic@lists.infradead.org; Mon, 19 Apr 2021 23:43:13 +0000 Received: from mail-oo1-f72.google.com (mail-oo1-f72.google.com [209.85.161.72]) by gw.atmark-techno.com (Postfix) with ESMTPS id DB7CA8049C for ; Tue, 20 Apr 2021 08:43:08 +0900 (JST) Received: by mail-oo1-f72.google.com with SMTP id p12-20020a4adc0c0000b02901d5037841b4so6568453oov.23 for ; Mon, 19 Apr 2021 16:43:08 -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=BZzC/uVMEt/pP0RyeD/JAIbnSEJ6csGpTK3HmW4fqY5/ODc+AhEernMPQDh6ZBI+Ks c8PVNLujmHhfDjNF64Yh8UBIYkBBR2GVke/cMeeNDyRwCD91tf1WiLlLR4zUo68GXUre HVGaFnYrY2e4ToyOJ9u9BOiJ8F9PbqUnWdkwbf53o46PjEVfCbAGnD3nYKMN6nS4luTi pG9xrqYqc6fn5RxuvJ+vCqWhLAzOohYn9OkHmTCfVWKPZepNTxBef4Jx48rU3E8Li+3+ ahPHqI1YEg3CUSAZLAUeezuKgYNtBHF5oATAloLba9BF9dVF4b0YyzdA73rCSwYrPsd8 Lwiw== X-Gm-Message-State: AOAM533tnnydm+MvQikv0alTQAsrWYV8Wl260R70fBOSvdU06fBxPz7I 3QZ7FIbqbLYCGLJNSGfkr6etoBKd6d0dZ+MaqXomNJwbe4e9j4d3uGQC8IfmmW/IeiS1o+ijFeK wyJFhdtvq3cSHZ+jOJmYeyqwV0eHNyjcl6Lk= X-Received: by 2002:a17:90a:1c1:: with SMTP id 1mr1708205pjd.190.1618875776936; Mon, 19 Apr 2021 16:42:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRGNIqy2AO5m9iOwuC4N09BxordE8LmUXYTIIeyniOtbCQKfA0MKaQl391n1ZLV3YIJOra8w== 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-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210419_164311_205194_0061C085 X-CRM114-Status: GOOD ( 31.17 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4C8BC433ED for ; Mon, 19 Apr 2021 23:43:32 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2657561279 for ; Mon, 19 Apr 2021 23:43:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2657561279 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=atmark-techno.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=MjLQi1b975deR9kHIhKAXsx6SqPt2h+Gw8+2f1Oqw/8=; b=I5dvVzWxtBIAdNAF4PvEDdr/I et+RgLPoQ8mg0DwZKSW3HKyhweaC/lrqI1wo4qiapF8K9DpJ5ZkfRSxbS8dTYUExi64SgcHlXGNvG 6w5iDU9C/UOest73OW2W1qVdo4kq6dZ2zeKg6X8O0o57RzjbPinDFgoDn2xv3OMqTEYa9ru6NVA56 w0JGIHCORLM0m2zYqCpWwTQ2li5av9FCoOcAxxXM7Zph544EBfFlqqs9MLmpNE/abWAlyGhn2ayMo xpITtkGN2Fwg5/wkDcoIIjK1z40KiTF++rf9kyGhRHae44mc4FtL6evPE2wR4E0OHmErPkIDzsKnC mXjp9jFtw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lYdY9-00AoH7-FX; Mon, 19 Apr 2021 23:43:29 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lYdXu-00AoFc-Ju for linux-phy@desiato.infradead.org; Mon, 19 Apr 2021 23:43:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=YfTDNxUjME1kzwn4ONpBlmaWp5uEs0PGjlewRbiJ8O0=; b=y4LaUB7MiqEHNQI5aDYyFOqHhf Q4wHh75LMvt9Ywx3Z9IXQ6kcil0vo3uk6yhP17EW2yS7GlWuxzd8ZG2nESCzOmxDJZpMF8ktHLWo5 a6zizZKSvuIyyuP0Hk3DOB25sZ4tYwjjVGtrftlDwI0ovsNE5HxQcU7oXDco3y6XUJ9DuDGvsy7Rp dmYLtuRst2CgS8CNVTeFOxgdDpFzlSzI29E0I4BYtO68iSSglWdJ+5EEAUx272fuZcm5qMsAhuI7U jm1/HcCFdm57VRr1o+/3fImAcV7wOZLTJm3xIOkfa6Bq2othVK6w7zIT/fUjbk7x3JTwqsXzGnoA9 q/xw9zaw==; Received: from gw.atmark-techno.com ([13.115.124.170]) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lYdXr-00Bj7u-1B for linux-phy@lists.infradead.org; Mon, 19 Apr 2021 23:43:13 +0000 Received: from mail-oo1-f69.google.com (mail-oo1-f69.google.com [209.85.161.69]) by gw.atmark-techno.com (Postfix) with ESMTPS id 071D0804A3 for ; Tue, 20 Apr 2021 08:43:09 +0900 (JST) Received: by mail-oo1-f69.google.com with SMTP id q26-20020a4ad55a0000b02901b6b9f33e6dso6554304oos.8 for ; Mon, 19 Apr 2021 16:43:08 -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=jRD7gC7WgJgoB8/x5yFOLq2xDcxgXqUVrfSPMrIKSAemdlw4dzTmpXXVzuKM6Cx8Gi 8+QA42MWEteXbWiImc8zRxkYa25aLkZaii7sORg/Y6yAcX1+cHZkjoe0USiLMxdIzHlc TvAd0MbCzUXFr1YusSNny0Rxe7urSuuMOMGJafXNX1gUPXXMzXT9TmGsmgTaRzcH8a76 0G4dN8mF/u9LxHQzra7KxbPXXRGI5n0Ga+qHKeqv+JjqaK4cs/ensaxvA2051Q8bG8xl WrZzObVsu1ORYu8HkQd67rk0L5NokUMor18lyuVx9rwuTHtoVlOkO6WOCsBqrtMnLe9d EoSw== X-Gm-Message-State: AOAM533cab+5ymrjiYjHDZvjWRbM1z1mA7JX6ZCaOfAswhlevrJIM8z8 pi7zF8rtKTzceHkGqBdpupW3mWZrGyL5YMl4GKwiNJSuvesMnFMq0m14NdGeGUNGxH1VXHSg/Z2 W4PBX1Vk9DMf8hvt0YFhmhpaDRxtcRA== X-Received: by 2002:a17:90a:1c1:: with SMTP id 1mr1708210pjd.190.1618875776938; Mon, 19 Apr 2021 16:42:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRGNIqy2AO5m9iOwuC4N09BxordE8LmUXYTIIeyniOtbCQKfA0MKaQl391n1ZLV3YIJOra8w== 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-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210419_164311_209492_8746A4A1 X-CRM114-Status: GOOD ( 31.17 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.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 -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy