mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Anshuman Khandual <anshuman.khandual@arm.com>
To: James Clark <james.clark@arm.com>,
	linux-arm-kernel@lists.infradead.org, suzuki.poulose@arm.com
Cc: Lorenzo Pieralisi <lpieralisi@kernel.org>,
	Sudeep Holla <sudeep.holla@arm.com>,
	Mike Leach <mike.leach@linaro.org>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	coresight@lists.linaro.org,
	linux-stm32@st-md-mailman.stormreply.com
Subject: Re: [PATCH 4/7] coresight: tpiu: Move ACPI support from AMBA driver to platform driver
Date: Wed, 22 Nov 2023 12:32:33 +0530	[thread overview]
Message-ID: <268e1605-fe3f-4aa0-92e3-36ddfc8aacb3@arm.com> (raw)
In-Reply-To: <92d6a66d-3270-3378-2ab9-9214c004d5c7@arm.com>



On 11/15/23 19:23, James Clark wrote:
> 
> 
> On 27/10/2023 08:29, Anshuman Khandual wrote:
>> Add support for the tpiu device in the platform driver, which can then be
>> used on ACPI based platforms. This change would now allow runtime power
>> management for ACPI based systems. The driver would try to enable the APB
>> clock if available.
>>
> [...]
>> +#ifdef CONFIG_ACPI
>> +static const struct acpi_device_id tpiu_acpi_ids[] = {
>> +	{"ARMHC979", 0}, /* ARM CoreSight TPIU */
>> +	{}
>> +};
>> +MODULE_DEVICE_TABLE(acpi, tpiu_acpi_ids);
>> +#endif
>> +
>> +static struct platform_driver tpiu_platform_driver = {
>> +	.probe	= tpiu_platform_probe,
>> +	.remove	= tpiu_platform_remove,
>> +	.driver = {
>> +		.name			= "coresight-tpiu-platform",
>> +		.acpi_match_table	= ACPI_PTR(tpiu_acpi_ids),
>> +		.suppress_bind_attrs	= true,
>> +		.pm			= &tpiu_dev_pm_ops,
>> +	},
>> +};
>> +module_platform_driver(tpiu_platform_driver);
>> +
> 
> Is there a special build config where this works? I get an error here

I have been testing this with a config known to work on RB5 board.

> because module_platform_driver() redefines things that are in
> module_amba_driver() which is defined above:
> 
>   module_amba_driver(tpiu_driver);
> 
> This isn't a W=1 build or anything, just a normal one. And it applies to
> most of the patches in this set.

You are right, I am able to recreate this problem with defconfig on
6.7-rc2 as well. The problem here seems to be caused by having both
module_amba_driver() and module_platform_driver() in the same file.

#define module_amba_driver(__amba_drv) \
        module_driver(__amba_drv, amba_driver_register, amba_driver_unregister)

#define module_platform_driver(__platform_driver) \
        module_driver(__platform_driver, platform_driver_register, \
                        platform_driver_unregister)

Although, AFAICT, have not seen these before - even on the defconfig.
Just to work around this problem, there can be a common module_init()
/module_exit() to register/unregister both AMBA and platform drivers,
similar to etm4x_init()/etm4x_exit() setup in coresight-etm4x-core.c.

  reply	other threads:[~2023-11-22  7:02 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-27  7:29 [PATCH 0/7] Subject: coresight: Move remaining AMBA ACPI devices into " Anshuman Khandual
2023-10-27  7:29 ` [PATCH 1/7] coresight: replicator: Move ACPI support from AMBA driver to " Anshuman Khandual
2023-10-28 14:03   ` kernel test robot
2023-10-27  7:29 ` [PATCH 2/7] coresight: funnel: " Anshuman Khandual
2023-10-27  7:29 ` [PATCH 3/7] coresight: catu: " Anshuman Khandual
2023-10-27  7:29 ` [PATCH 4/7] coresight: tpiu: " Anshuman Khandual
2023-11-15 13:53   ` James Clark
2023-11-22  7:02     ` Anshuman Khandual [this message]
2023-11-22 11:21       ` Sudeep Holla
2023-11-22 12:10         ` Sudeep Holla
2023-10-27  7:29 ` [PATCH 5/7] coresight: tmc: " Anshuman Khandual
2023-11-22 17:04   ` Sudeep Holla
2023-11-22 17:15     ` Suzuki K Poulose
2023-11-28  7:09     ` Anshuman Khandual
2023-10-27  7:29 ` [PATCH 6/7] coresight: stm: " Anshuman Khandual
2023-10-28 13:22   ` kernel test robot
2023-10-27  7:29 ` [PATCH 7/7] coresight: debug: " Anshuman Khandual
2023-10-28 13:42   ` kernel test robot

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=268e1605-fe3f-4aa0-92e3-36ddfc8aacb3@arm.com \
    --to=anshuman.khandual@arm.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=coresight@lists.linaro.org \
    --cc=james.clark@arm.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=lpieralisi@kernel.org \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=mike.leach@linaro.org \
    --cc=sudeep.holla@arm.com \
    --cc=suzuki.poulose@arm.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

all inboxes | Powered by JetHome®