Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp3174143pxb; Tue, 20 Apr 2021 02:11:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwH4xTSTB9EsaQKcOvcuhw1Nvi/oXQsA/o9k1sAGpaMHVh/+nGcY+AtiRr0Zl6YY3Hrjkwm X-Received: by 2002:a62:770e:0:b029:261:d9ed:fd6a with SMTP id s14-20020a62770e0000b0290261d9edfd6amr5934344pfc.75.1618909894508; Tue, 20 Apr 2021 02:11:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618909894; cv=none; d=google.com; s=arc-20160816; b=CMgP5+6X77RQyPZY2QdaOgm8RD1NVyHcDITijNclXLwaSLrUp7FAVJN/qeGalo7To3 SD+tnRNSIqOyRfopSZic6woSZUWSYAabkycY3nY7fpBCa392trnO3xV1mBE1JFKjr8Pp cCy/Sf3jFNZrZUmnpqLOOd1LRsqjffdCvG7NeTHlBo8hbRaF4C3/gz/7fi3ZmKOcp915 vn0hnWw7DbqQCG+X+NGHwUqR/WUC7LmgR25tIMgu//x0dkTsRQQLjq8Y7GsegXmW7hrJ 844ZGD9t5/Bi9voxTR570Pcypryh36RHd7DBSVUW7XVif4tuXM+yz3axcbRMwW250MS2 npew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=c2AVdai4BL/owZZ4etPrGHyWpLyjk0ZB86A88EL3k+c=; b=l9xjqhRnpUjuAWSlIWTwrylISIuNJJGnkkxLA7XBEq5vbFh1YLHx+UtbUYxGiHpees xCOlCxjh8NUpv8S9JfkS3fZ86fieiyQayj83nAHUSUheEsKT0rHVnvBoDSBA/dNmTV5F xmIk5pp2JGGL/E0dfUNbmIAld4lWLuaGB+ghPr5Gq/gFUKtVHuLLaoz+5eJEWHWvy2ul InT4fUYLsJtZ5Zmhq4STEwa43oD8JdRhdXYazc1J+Tg43mpOvPkDXLmhxHhf8zitOZ/g iMrx0nLk70SEJW5dbXP1M0NBBgxenjjGiByzCCQGlPXFR9W4bhZ9IYwZWCK8EPunlD2Y 4LGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EXaUejfP; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bk23si2460168pjb.59.2021.04.20.02.11.21; Tue, 20 Apr 2021 02:11:34 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EXaUejfP; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231254AbhDTJLl (ORCPT + 99 others); Tue, 20 Apr 2021 05:11:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:54352 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230168AbhDTJLk (ORCPT ); Tue, 20 Apr 2021 05:11:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C2578611F2; Tue, 20 Apr 2021 09:11:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618909868; bh=DeGQ9vUDRCVhA8t5Ph+0N53DtPOXi7alQM8lRrwQwKo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=EXaUejfPaaye7JWUCmF8GSi/RlYZhQsdmX+kLcrBeX0F1eFgr44krM1ixkRCmXqkg FBkMtZZGYAFq9xBKq5dcb2BOQt+ZCJKFph809k2UHYXQ05bfNbCW2UMcbcmTQ+BSp+ d4wYwcs4Xh3CFODUAnQ6T/3q0QUsxZsoXx5nhwd/fpBWvKp8/59bRQmO/3zgbXcwmK 5ZxGXiVuroDwkEdd0DsqBUmQGVuvW3ND1+dRkLPV1j+YSFx6n/pEQ0ehheOXLBySbA UArXFDspN2qbdaPSjruyfPlBf3HVvFuXT3t/kqjY8MxeeKRO9TZhjCji8FQIgiY4FO xIB/CJ63eyrXQ== Received: by mail-lj1-f178.google.com with SMTP id z8so42658767ljm.12; Tue, 20 Apr 2021 02:11:08 -0700 (PDT) X-Gm-Message-State: AOAM533SDLFv+8U2cQAkLeNYA2TzKm+lQzaAn+kjLb27vIbPMbniOYla gWp78iF/GVMwBz/LYp5LtDI82tXsLCuw6Bud0xA= X-Received: by 2002:a5d:6dc4:: with SMTP id d4mr20219548wrz.105.1618909856639; Tue, 20 Apr 2021 02:10:56 -0700 (PDT) MIME-Version: 1.0 References: <20210419042722.27554-1-alice.guo@oss.nxp.com> <20210419042722.27554-4-alice.guo@oss.nxp.com> In-Reply-To: From: Arnd Bergmann Date: Tue, 20 Apr 2021 11:10:40 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC v1 PATCH 3/3] driver: update all the code that use soc_device_match To: Dominique MARTINET Cc: Geert Uytterhoeven , "Alice Guo (OSS)" , gregkh , Rafael Wysocki , =?UTF-8?Q?Horia_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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Tue, Apr 20, 2021 at 1:44 AM Dominique MARTINET wrote: > Arnd Bergmann wrote on Mon, Apr 19, 2021 at 02:16:36PM +0200: > > 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). Ok, in that case you may have a chance to just adapt the initcall levels. This is somewhat fragile if someone else already relies on a particular order, but it's an easy one-line change to change a driver e.g. from module_init() or device_initcall() to arch_initcall(). > 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. Right, that would be way more fragile. I think the main problem in this case is the caam driver that really should not look into the particular SoC type or even machine compatible string. This is something we can do as a last resort for compatibility with busted devicetree files, but it appears that this driver does it as the primary method for identifying different hardware revisions. I would suggest fixing the binding so that each SoC that includes one of these devices has a soc specific compatible string associated with the device that the driver can use as the primary way of identifying the device. We probably need to keep the old logic around for old dtb files, but there can at least be a comment next to that table that discourages people from adding more entries there. Arnd