Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp52263pxb; Fri, 17 Sep 2021 18:31:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwM4sBiPEvH595+BZ901apeRWuR3NSnxbm9sZoU4ZgkMTbZM/8Lb4MwWYAe2WsWUZxfD5S/ X-Received: by 2002:a92:c147:: with SMTP id b7mr9842060ilh.277.1631928700329; Fri, 17 Sep 2021 18:31:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631928700; cv=none; d=google.com; s=arc-20160816; b=Y5KuIUb8Yjjzmzl25ZxKjvnFgJZYaIuj7589+e43UUsVvpduOFVR1yPhCDjJ6kZasU Qux9baaYZPVpCLv3+22S046l/oIhid3OyqgKWbzd5XnFkqpQp1HH6QCJFVhZU4xBt3bO unhRotYESQPHW6hurNAKJmmGLx/BA3djL0olokmiAp/LIyCF/ZAITVY2kEojebgoUG0M vg3LNvELyb+zwbvQn/pMSyqkzmxEi42V3EHvtBJEuPdjfyJds0i7y68bwFXyKVvYrJFm aaJSpgjv7znqfD0XD1VzmggE4pwFcYq/+nEdlXr1/IJv65iMUI6g3gsnDJeUbzjk/G1F /DwQ== 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:references:cc :to:from:subject:dkim-signature; bh=3S5XrNnYw9mQJ4cjT/e6jDqp9tZbCCKdg1eBLA71yrk=; b=CFHvUjlIcHY7hhTR8M0jnMMzxeIc2G6PekKLE/yJboKX2lbU+cKer3MadXLoakuwA5 xSj1z7288PckMTDzTh9a1KKhm0bqcGy7Y5lOw1oZ2QJ/xpmmydKWsfV5dylgPq6MeAaE xtHpS6Az8CB4E9oGt7WBHVKoHeIvSsoWUsVLSXk89jTsk4I2tGJAjWwImtJPQTNTMy0/ WpNPKubvhVhKNF1Y7YsBhJbVXmIKU1hcIkYGAibE1p3GH9BdJeOi/1vthdDP84z51zkk jhTbZ27JzMEWgyVmrbsm3uUHXHOuNaWytAdLxjKPstIvq6327dobi6rogVvsJx5s32tE WYrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=UVqnVfww; 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=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g5si8774636jaj.5.2021.09.17.18.31.16; Fri, 17 Sep 2021 18:31:40 -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=@canonical.com header.s=20210705 header.b=UVqnVfww; 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=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232954AbhIQRbl (ORCPT + 99 others); Fri, 17 Sep 2021 13:31:41 -0400 Received: from smtp-relay-internal-0.canonical.com ([185.125.188.122]:43668 "EHLO smtp-relay-internal-0.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231855AbhIQRbl (ORCPT ); Fri, 17 Sep 2021 13:31:41 -0400 Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 5FCF740267 for ; Fri, 17 Sep 2021 17:30:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1631899816; bh=3S5XrNnYw9mQJ4cjT/e6jDqp9tZbCCKdg1eBLA71yrk=; h=Subject:From:To:Cc:References:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=UVqnVfwwvYwT/zJLKaa+0p2a6PeBRTM39+n+05gVWgCbY6mDdt0oLzN2C1nQ9Oto0 HiUlJuUwp9XxwpzHZLrjB4SLnYgAaKsKM+w249drt/Gou3i6rGFzpOm3UkN+RnMixG Zq9KHOAfT/7QjGyEkchayA+UIm5UZJkRI9+cgKWJSm4fErKX6OGv9nNPmN0RzO54XZ O/Vz4C/TugdtFBMWzBPsEQ2ouLDtmfpUgf3tkV6kZa38PQ0dpOEqhAktC1HHy+uFyV TulIteDXOps4962wTqoX1SXaijXwY9TRT5BGfcce2aovc3y2ZVC69t2fvCKAy/V0m6 KyzKj2gsM6PdA== Received: by mail-ed1-f69.google.com with SMTP id j6-20020aa7de86000000b003d4ddaf2bf9so9730496edv.7 for ; Fri, 17 Sep 2021 10:30:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=3S5XrNnYw9mQJ4cjT/e6jDqp9tZbCCKdg1eBLA71yrk=; b=iE7E+ACB2D73LEbLa0W/ablyJl8AxjNir8te+AL/TdRg1eSLjjgHwvZ/almCk0TlgD HQO7cp/eIyXNKxKUgxjLUz2odVq/nUaSematVpNmTkBUKKWq+rfpJ1hUq8XxMWYzp42V p9fbsr30snaBuCmahiJfwKZAMiJ8DSBHGICAnuM0d1DW4WIQrsGKoiSIXetT8VYT5fzP xwEedSSvKrX4qpl+u8bAi87h2XUMhnpA0Lin8ct775E3BrsZeob/l3xKu/UtDqcracrr N9JEFq9dPUC0gcC4FD/J7cNx5S6w4paO8l/RJCFXD5hK7DVF6Wi1J6w6DY1KFD+DJak6 AZ0w== X-Gm-Message-State: AOAM5328LyUcfHAr48VROS/B43Ad4qT5t9IcpDd1yx+D4Q/9/TmUf9PU CrrYcR5cfggY/Do+g6W2JwVTR0uiw6YDSvek8p/vRL26nF+3Ahm0xNHcMgLcJFGEJpafFvW0Jz3 78RY4+vg92K055L1kBBzXY8k4WpHQe9NIK9h+BxZLyw== X-Received: by 2002:a17:906:1901:: with SMTP id a1mr13618794eje.129.1631899812917; Fri, 17 Sep 2021 10:30:12 -0700 (PDT) X-Received: by 2002:a17:906:1901:: with SMTP id a1mr13618782eje.129.1631899812761; Fri, 17 Sep 2021 10:30:12 -0700 (PDT) Received: from [192.168.2.211] (lk.84.20.244.219.dc.cable.static.lj-kabel.net. [84.20.244.219]) by smtp.gmail.com with ESMTPSA id n15sm2926625edw.70.2021.09.17.10.30.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 17 Sep 2021 10:30:12 -0700 (PDT) Subject: Re: [RFC][PATCH] crypto: caam - Add missing MODULE_ALIAS From: Krzysztof Kozlowski To: =?UTF-8?Q?Horia_Geant=c4=83?= , Marek Vasut , "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> Message-ID: Date: Fri, 17 Sep 2021 19:30:11 +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: <77467cbf-afad-d7e1-5042-569d5a276c20@canonical.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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. Best regards, Krzysztof