From: Yicong Yang <yangyicong@huawei.com>
To: Liang Li <liliang6@email.cn>
Cc: <yangyicong@hisilicon.com>, Barry Song <21cnbao@gmail.com>,
<will@kernel.org>, <mark.rutland@arm.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <jonathan.cameron@huawei.com>,
<linuxarm@huawei.com>
Subject: Re: [PATCH] perf/smmuv3: Add platform id table for module auto loading
Date: Fri, 11 Aug 2023 18:14:33 +0800 [thread overview]
Message-ID: <f6edb51e-ae79-5eaa-f337-fb4971aec575@huawei.com> (raw)
In-Reply-To: <ZNOCgX8yniu+IuUG@localhost>
On 2023/8/9 20:11, Liang Li wrote:
> Hi Yicong,
>
> Thanks for your reply,
>
> On 2023-08-09 14:31, Yicong Yang <yangyicong@huawei.com> wrote:
>> Hi Barry, Liang,
>>
>> On 2023/8/9 13:47, Barry Song wrote:
>>> On Wed, Aug 9, 2023 at 1:01 PM Liang Li <liliang6@email.cn> wrote:
>>>>
>>>> On 2023-08-07 20:22, Yicong Yang <yangyicong@huawei.com> wrote:
>>>>> From: Yicong Yang <yangyicong@hisilicon.com>
>>>>>
>>>>> On ACPI based system the device is probed by the name directly. If the
>>>>> driver is configured as module it can only be loaded manually. Add the
>>>>> platform id table as well as the module alias then the driver will be
>>>>> loaded automatically by the udev or others once the device added.
>>>>>
>>>>
>>>> Please consider revise the long log to clearly express the purpose of the
>>>> changes in this patch:
>>>>
>>>> - What's the exact issue the patch is addressing
>>>> - Why the changes in this patch can fix the issue or make something working
>>>> - Consider impact of the changes introduced by this patch
>>>>
>>>> These info may help reviewers and maintainers .. and yourself on code merge.
>>>
>>> years ago, i found a good doc regarding this,
>>> https://wiki.archlinux.org/title/Modalias
>>>
>>> guess it is because /lib/modules/$(uname -r)/modules.alias fails to contain smmu
>>> driver without the MODULE_DEVICE_TABLE, isn't it, yicong?
>>
>> Yes I think it's the reason. I didn't find summary in kernel docs for the modalias
>> as well as the uevent mechanism. Arch wiki has a well illustration for the modalias
>> and suse[1] describes how this is used by the udev for module auto loading.
>>
>> For my case I'm using a ACPI based arm64 server and after booting the arm_smmuv3_pmu.ko
>> is not auto loaded by the udevd since we aren't providing this information. In order
>> to support this we need to provide this MODULE_DEVICE_TABLE() when the smmu pmu added
>> as a platform device, then the userspace udev can know which module to load after the
>> device is added.
>>
>
> Then what's the purpose of the added '.id_table = ...' line in the previous
> patch ?
> <We lost the patch context in this thread.>
>
> Based on above clarification, the updated DEVICE_TABLE would update modalias
> as expected, right ?
ok, it's lack of illustration in the commit. If we're going to use MODULE_DEVICE_TABLE we need
a platform id table. So I add it and I found it weired if we have a id table but not use it for
probing, so I also initialize .id_table.
I found there's also an another way to implement this by used MODULE_ALIAS(), and no need to add
an id table. Maybe this way is less controversial.
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>");
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-08-11 10:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-07 12:22 [PATCH] perf/smmuv3: Add platform id table for module auto loading Yicong Yang
2023-08-09 2:45 ` Liang Li
2023-08-09 5:47 ` Barry Song
2023-08-09 6:31 ` Yicong Yang
2023-08-09 12:11 ` Liang Li
2023-08-11 10:14 ` Yicong Yang [this message]
2023-08-12 5:24 ` Barry Song
2023-08-12 5:31 ` Barry Song
2023-08-14 8:51 ` Yicong Yang
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=f6edb51e-ae79-5eaa-f337-fb4971aec575@huawei.com \
--to=yangyicong@huawei.com \
--cc=21cnbao@gmail.com \
--cc=jonathan.cameron@huawei.com \
--cc=liliang6@email.cn \
--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 \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).