All of lore.kernel.org
 help / color / mirror / Atom feed
From: Liang Li <liliang6@email.cn>
To: Yicong Yang <yangyicong@huawei.com>
Cc: will@kernel.org, mark.rutland@arm.com, liliang6@email.cn,
	21cnbao@gmail.com, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, jonathan.cameron@huawei.com,
	linuxarm@huawei.com, yangyicong@hisilicon.com
Subject: Re: [PATCH v2] perf/smmuv3: Add MODULE_ALIAS for module auto loading
Date: Tue, 15 Aug 2023 09:48:04 +0800	[thread overview]
Message-ID: <ZNrZVD1lwGM4LC+i@localhost> (raw)
In-Reply-To: <20230814131642.65263-1-yangyicong@huawei.com>

On 2023-08-14 21:16, Yicong Yang <yangyicong@huawei.com> wrote:
> From: Yicong Yang <yangyicong@hisilicon.com>
> 
> On my ACPI based arm64 server, if the SMMUv3 PMU is configured as
> module it won't be loaded automatically after booting even if the
> device has already been scanned and added. It's because the module
> lacks a platform alias, the uevent mechanism and userspace tools
> like udevd make use of this to find the target driver module of the
> device. This patch adds the missing platform alias of the module,
> then module will be loaded automatically if device exists.
> 
> Before this patch:
> [root@localhost tmp]# modinfo arm_smmuv3_pmu | grep alias
> alias:          of:N*T*Carm,smmu-v3-pmcgC*
> alias:          of:N*T*Carm,smmu-v3-pmcg
> 
> After this patch:
> [root@localhost tmp]# modinfo arm_smmuv3_pmu | grep alias
> alias:          platform:arm-smmu-v3-pmcg
> alias:          of:N*T*Carm,smmu-v3-pmcgC*
> alias:          of:N*T*Carm,smmu-v3-pmcg
> 
> Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
> ---
> Change since v1:
> - Further illustrate the issues and how to fix this
> - Use MODULE_ALIAS instead of MODULE_DEVICE_TABLE
> Link: https://lore.kernel.org/all/20230807122233.28563-1-yangyicong@huawei.com/
> 
>  drivers/perf/arm_smmuv3_pmu.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/perf/arm_smmuv3_pmu.c b/drivers/perf/arm_smmuv3_pmu.c
> index 25a269d431e4..4c32b6dbfe76 100644
> --- a/drivers/perf/arm_smmuv3_pmu.c
> +++ b/drivers/perf/arm_smmuv3_pmu.c
> @@ -984,6 +984,7 @@ static void __exit arm_smmu_pmu_exit(void)
>  
>  module_exit(arm_smmu_pmu_exit);
>  
> +MODULE_ALIAS("platform:arm-smmu-v3-pmcg");
>  MODULE_DESCRIPTION("PMU driver for ARM SMMUv3 Performance Monitors Extension");
>  MODULE_AUTHOR("Neil Leeder <nleeder@codeaurora.org>");
>  MODULE_AUTHOR("Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>");
> -- 
> 2.24.0

Looks good to me. :) Thanks.

Regards.
Liang Li


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Liang Li <liliang6@email.cn>
To: Yicong Yang <yangyicong@huawei.com>
Cc: will@kernel.org, mark.rutland@arm.com, liliang6@email.cn,
	21cnbao@gmail.com, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, jonathan.cameron@huawei.com,
	linuxarm@huawei.com, yangyicong@hisilicon.com
Subject: Re: [PATCH v2] perf/smmuv3: Add MODULE_ALIAS for module auto loading
Date: Tue, 15 Aug 2023 09:48:04 +0800	[thread overview]
Message-ID: <ZNrZVD1lwGM4LC+i@localhost> (raw)
In-Reply-To: <20230814131642.65263-1-yangyicong@huawei.com>

On 2023-08-14 21:16, Yicong Yang <yangyicong@huawei.com> wrote:
> From: Yicong Yang <yangyicong@hisilicon.com>
> 
> On my ACPI based arm64 server, if the SMMUv3 PMU is configured as
> module it won't be loaded automatically after booting even if the
> device has already been scanned and added. It's because the module
> lacks a platform alias, the uevent mechanism and userspace tools
> like udevd make use of this to find the target driver module of the
> device. This patch adds the missing platform alias of the module,
> then module will be loaded automatically if device exists.
> 
> Before this patch:
> [root@localhost tmp]# modinfo arm_smmuv3_pmu | grep alias
> alias:          of:N*T*Carm,smmu-v3-pmcgC*
> alias:          of:N*T*Carm,smmu-v3-pmcg
> 
> After this patch:
> [root@localhost tmp]# modinfo arm_smmuv3_pmu | grep alias
> alias:          platform:arm-smmu-v3-pmcg
> alias:          of:N*T*Carm,smmu-v3-pmcgC*
> alias:          of:N*T*Carm,smmu-v3-pmcg
> 
> Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
> ---
> Change since v1:
> - Further illustrate the issues and how to fix this
> - Use MODULE_ALIAS instead of MODULE_DEVICE_TABLE
> Link: https://lore.kernel.org/all/20230807122233.28563-1-yangyicong@huawei.com/
> 
>  drivers/perf/arm_smmuv3_pmu.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/perf/arm_smmuv3_pmu.c b/drivers/perf/arm_smmuv3_pmu.c
> index 25a269d431e4..4c32b6dbfe76 100644
> --- a/drivers/perf/arm_smmuv3_pmu.c
> +++ b/drivers/perf/arm_smmuv3_pmu.c
> @@ -984,6 +984,7 @@ static void __exit arm_smmu_pmu_exit(void)
>  
>  module_exit(arm_smmu_pmu_exit);
>  
> +MODULE_ALIAS("platform:arm-smmu-v3-pmcg");
>  MODULE_DESCRIPTION("PMU driver for ARM SMMUv3 Performance Monitors Extension");
>  MODULE_AUTHOR("Neil Leeder <nleeder@codeaurora.org>");
>  MODULE_AUTHOR("Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>");
> -- 
> 2.24.0

Looks good to me. :) Thanks.

Regards.
Liang Li


  reply	other threads:[~2023-08-15  1:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-14 13:16 [PATCH v2] perf/smmuv3: Add MODULE_ALIAS for module auto loading Yicong Yang
2023-08-14 13:16 ` Yicong Yang
2023-08-15  1:48 ` Liang Li [this message]
2023-08-15  1:48   ` Liang Li
2023-08-15 14:10 ` Will Deacon
2023-08-15 14:10   ` Will Deacon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZNrZVD1lwGM4LC+i@localhost \
    --to=liliang6@email.cn \
    --cc=21cnbao@gmail.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=mark.rutland@arm.com \
    --cc=will@kernel.org \
    --cc=yangyicong@hisilicon.com \
    --cc=yangyicong@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.