From: Sudeep Holla <sudeep.holla@arm.com>
To: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: James Clark <james.clark@arm.com>,
linux-arm-kernel@lists.infradead.org,
Sudeep Holla <sudeep.holla@arm.com>,
suzuki.poulose@arm.com, Lorenzo Pieralisi <lpieralisi@kernel.org>,
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 11:21:58 +0000 [thread overview]
Message-ID: <ZV3kVhZYBHwSaPr9@bogus> (raw)
In-Reply-To: <268e1605-fe3f-4aa0-92e3-36ddfc8aacb3@arm.com>
On Wed, Nov 22, 2023 at 12:32:33PM +0530, Anshuman Khandual wrote:
> 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.
Could this be the reason why I am seeing the below error why booting with
ACPI ? I wanted to check the tables before I comment but this discussion
made me think it could be the reason, hence posting this before I got time
to analyse it.
| coresight-tmc-platform ARMHC97C:00: can't request region for resource [mem 0x20010000-0x20010fff]
| coresight-tmc-platform: probe of ARMHC97C:00 failed with error -16
| coresight-tmc-platform ARMHC501:00: can't request region for resource [mem 0x20070000-0x20070fff]
| coresight-tmc-platform: probe of ARMHC501:00 failed with error -16
--
Regards,
Sudeep
_______________________________________________
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-11-22 11:22 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 platform driver 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
2023-11-22 11:21 ` Sudeep Holla [this message]
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=ZV3kVhZYBHwSaPr9@bogus \
--to=sudeep.holla@arm.com \
--cc=alexandre.torgue@foss.st.com \
--cc=anshuman.khandual@arm.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=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;
as well as URLs for NNTP newsgroup(s).