From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BAE98C61D97 for ; Wed, 22 Nov 2023 11:22:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fIBwYcfHL+oA2DURrIsbilHRXenh4KtEosErdhyJRc8=; b=b0E2ciI8MCBJot ydxKhAjfoZuqKOHsymshok6Q7nxFuEPxxNcprYI/q4oFFuPhPEKo2IVR+vnReG/VfkhdAlEafGZqD Qw/qRGcABKi1mESklvlQM/QH9sVZxPgYE35eO+Xzvd2BfLIzDDYxzE+vCE39XI9As8Euc7p9pnTbu AQCa1kGmRn4DX2JtROmr8EKRFNGzF7bR4zrUJJpRGGQdC7zFuoeSm50KESD2YRpl8LzBuQE1ubk/n QTfqpyfZ57ySQXdRPvXyqoJ+8Z4bTkryh0YlUsmj7i1HsZ+RB+TSVomQsVydEMxRYrVjHSH8CgqU2 84S0R2N5cpKwYGWxjzXw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r5lJ7-001XIR-2Z; Wed, 22 Nov 2023 11:22:13 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r5lJ4-001XGR-22 for linux-arm-kernel@lists.infradead.org; Wed, 22 Nov 2023 11:22:12 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B8CC11595; Wed, 22 Nov 2023 03:22:49 -0800 (PST) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3E01E3F7A6; Wed, 22 Nov 2023 03:22:01 -0800 (PST) Date: Wed, 22 Nov 2023 11:21:58 +0000 From: Sudeep Holla To: Anshuman Khandual Cc: James Clark , linux-arm-kernel@lists.infradead.org, Sudeep Holla , suzuki.poulose@arm.com, Lorenzo Pieralisi , Mike Leach , Maxime Coquelin , Alexandre Torgue , 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 Message-ID: References: <20231027072943.3418997-1-anshuman.khandual@arm.com> <20231027072943.3418997-5-anshuman.khandual@arm.com> <92d6a66d-3270-3378-2ab9-9214c004d5c7@arm.com> <268e1605-fe3f-4aa0-92e3-36ddfc8aacb3@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <268e1605-fe3f-4aa0-92e3-36ddfc8aacb3@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231122_032210_764053_684B22C5 X-CRM114-Status: GOOD ( 28.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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