Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1971866pxb; Mon, 20 Sep 2021 09:15:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzG+W3p4V1lZPxkhCulU5mF5OqI50JrbsT0p1i5WcmxJdy15inmt6YsKHEdpOmNZg1hbjyF X-Received: by 2002:a5d:9693:: with SMTP id m19mr19456547ion.72.1632154538216; Mon, 20 Sep 2021 09:15:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632154538; cv=none; d=google.com; s=arc-20160816; b=J2iQnlsZgObY9ymJX+BuLFO+z1uqLuJ2aLw4nSGM3IO3mXw08l72Doy0yE0WJkVPOJ faGXH60Taz3WuqC+6PK0uxawnfDxrFKQsWcWJAWXWTz2kd0yO1x+2BwVOysjVEy54F2S Y3yzKlUdXZm5WDAbj+g9jD39DeVma6awT508cETMkn5NGDeuesiDn9cCxDyzor3CjBKA agq8ffvEu+m8kBvnhr2i+4XX0ri5QOGCyAn8UVZYtsVDy/3DkSoRgQ+sQqzgkdm731Rm IE3EnKto7vDmkJeWAnSkkOxefDz7a2PCEECCXCkdSMSmNkHNn1542CMfDtts1Bg2/i0c JHIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=8VKqwQU2AAHWC8ArqFgvE45bUcox/BQk4bXFvGbFIiE=; b=zjWzO/th6Y5t/JpiSKntVu10CROlkB/g6UjQ7fv5SbAl6FOVudOZ3HFSoRnH0mRBge r/uDLdkDcWEmUlqJmAICLGKXRwGlnnIEeMeSOszRNk8OCdOtfuxmMQ41ZmVqAjy0JodS E4wyGFcT4sLfJ/5hVodA0QL582aAWxfeaEWX3Dq1QueqLyV70HdId4bu+ej+MnE0A1zo ToSdw8Rq9QTjdMFHmkMHdglISm0Nah303g02BPFR6buR1Vz+RM8zyey71wc8D0MqjnvY 0VvnQNr4CXy4dkm6r33pIVdYOZdKZLPJmLFHgJd2nCXgFtur36Pkbjr898syoLqlHVuU 6sPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=rXC5fQih; 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 t24si11678029iog.114.2021.09.20.09.15.22; Mon, 20 Sep 2021 09:15:38 -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=@denx.de header.s=phobos-20191101 header.b=rXC5fQih; 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 S235037AbhITNpX (ORCPT + 99 others); Mon, 20 Sep 2021 09:45:23 -0400 Received: from phobos.denx.de ([85.214.62.61]:51278 "EHLO phobos.denx.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234964AbhITNpX (ORCPT ); Mon, 20 Sep 2021 09:45:23 -0400 Received: from [IPv6:::1] (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id C185080EC5; Mon, 20 Sep 2021 15:43:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1632145435; bh=8VKqwQU2AAHWC8ArqFgvE45bUcox/BQk4bXFvGbFIiE=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=rXC5fQihBkcNP+3oO+U2/3Eg7+56ChzZTsBJWJLM3IT2znpiq4Nc/TmekTJ/vMCbm SolsDYdlZvd8Udptfex8A8vywzXiYsfwu5dsEIMC3wr+OxKuzRAhLMY0rj8kjScxYR Bz3SHK245/BLrODXow1yGfP7F5G9AZogaXouZjvUGkFQPKStRXC7GC7gjN1+pHybfj 1/ACHXh3IwESj01YVE6BtnEW1pnUz+kBJ4PLdg8caQhjB0PuGhXitjIzSpVEgq81th tMiEY0y1RHjtgFGLxRgr/hQ58vnmKmDHxWorcZddC4e0m3VYZsFdunABxYzdMClzhJ JO1GtWa8+i2Fg== Subject: Re: [RFC][PATCH] crypto: caam - Add missing MODULE_ALIAS To: Krzysztof Kozlowski , =?UTF-8?Q?Horia_Geant=c4=83?= , "linux-crypto@vger.kernel.org" Cc: "ch@denx.de" , Herbert Xu , Iuliana Prodan References: <20210916134154.8764-1-marex@denx.de> <441a7e2e-7ac8-5000-72e0-3793ae7e58d5@canonical.com> <08afb147-07c7-9fbb-4a0c-8a79717b06b7@denx.de> <77467cbf-afad-d7e1-5042-569d5a276c20@canonical.com> From: Marek Vasut Message-ID: <04c9705b-9fd8-dde1-33ee-fa58aad96d4a@denx.de> Date: Mon, 20 Sep 2021 15:43:54 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 9/17/21 7:30 PM, Krzysztof Kozlowski wrote: > On 17/09/2021 18:21, Krzysztof Kozlowski wrote: >> On 17/09/2021 16:44, Horia Geantă wrote: >>> On 9/17/2021 1:33 PM, Krzysztof Kozlowski wrote: >>>> On 17/09/2021 11:51, Horia Geantă wrote: >>>>> On 9/16/2021 5:06 PM, Marek Vasut wrote: >>>>>> On 9/16/21 3:59 PM, Krzysztof Kozlowski wrote: >>>>>>> On 16/09/2021 15:41, Marek Vasut wrote: >>>>>>>> Add MODULE_ALIAS for caam and caam_jr modules, so they can be auto-loaded. >>>>>>>> >>>>>>>> Signed-off-by: Marek Vasut >>>>>>>> Cc: Herbert Xu >>>>>>>> Cc: Horia Geantă >>>>>>>> Cc: Iuliana Prodan >>>>>>>> Cc: Krzysztof Kozlowski >>>>>>>> --- >>>>>>>> drivers/crypto/caam/ctrl.c | 1 + >>>>>>>> drivers/crypto/caam/jr.c | 1 + >>>>>>>> 2 files changed, 2 insertions(+) >>>>>>>> >>>>>>> >>>>>>> Since you marked it as RFC, let me share a comment - would be nice to >>>>>>> see here explanation why do you need module alias. >>>>>>> >>>>>>> Drivers usually do not need module alias to be auto-loaded, unless the >>>>>>> subsystem/bus reports different alias than one used for binding. Since >>>>>>> the CAAM can bind only via OF, I wonder what is really missing here. Is >>>>>>> it a MFD child (it's one of cases this can happen)? >>>>>> >>>>>> I noticed the CAAM is not being auto-loaded on boot, and then I noticed >>>>>> the MODULE_ALIAS fixes cropping up in the kernel log, but I couldn't >>>>>> find a good documentation for that MODULE_ALIAS. So I was hoping to get >>>>>> a feedback on it. >>>>>> >>>>> What platform are you using? >>>>> >>>>> "make modules_install" should take care of adding the proper aliases, >>>>> relying on the MODULE_DEVICE_TABLE() macro in the caam, caam_jr drivers. >>>>> >>>>> modules.alias file should contain: >>>>> alias of:N*T*Cfsl,sec4.0C* caam >>>>> alias of:N*T*Cfsl,sec4.0 caam >>>>> alias of:N*T*Cfsl,sec-v4.0C* caam >>>>> alias of:N*T*Cfsl,sec-v4.0 caam >>>>> alias of:N*T*Cfsl,sec4.0-job-ringC* caam_jr >>>>> alias of:N*T*Cfsl,sec4.0-job-ring caam_jr >>>>> alias of:N*T*Cfsl,sec-v4.0-job-ringC* caam_jr >>>>> alias of:N*T*Cfsl,sec-v4.0-job-ring caam_jr >>>> >>>> Marek added a platform alias which is not present here on the list >>>> (because there are no platform device IDs). The proper question is who >>>> requests this device via a platform match? Who sends such event? >>>> >>> AFAICS the platform bus adds the "platform:" alias to uevent env. >>> in its .uevent callback - platform_uevent(). >>> >>> When caam (platform) device is added, the uevent is generated with this env., >>> which contains both OF-style and "platform:" modaliases. >> >> I am not saying about theoretical case, I know that platform bus will >> send platform uevent. How did this device end up in platform bus so this >> uevent is being sent? It should be instantiated from OF on for example >> amba bus or directly from OF FDT scanning. >> >> Therefore I have the same question - who requests device via a platform >> match? Is it used out-of-tree in different configuration? > > I tried to reproduce such situation in case of a board I have with me > (Exynos5422). I have a platform_driver only with of_device_id table. The > driver is built as module. In my DTS the device node is like > (exynos5.dtsi and device is modified exynos-chipid to be a module): > > soc: soc { > compatible = "simple-bus"; > #address-cells = <1>; > #size-cells = <1>; > ranges; > > chipid: chipid@10000000 { > compatible = "samsung,exynos4210-chipid"; > reg = <0x10000000 0x100>; > }; > > ... > }; > > The module was properly autoloaded (via OF aliases/events) and device > was matched. Please put this on hold for a bit, I need a colleague to check the udev event on this platform before we can move on any further.