Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp1013237rdf; Wed, 22 Nov 2023 03:22:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IH4ouxonIq/xpHR48ljHQTw640DQndeQxBeqjFwXlGrxfr6pehyCBsWfgIqGY74xa3Mh6qj X-Received: by 2002:a17:902:c40f:b0:1cf:792d:93d3 with SMTP id k15-20020a170902c40f00b001cf792d93d3mr2147196plk.4.1700652175611; Wed, 22 Nov 2023 03:22:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700652175; cv=none; d=google.com; s=arc-20160816; b=lCJnNA5ZDwACI3R95+R15DEpK4oAIjW3zaMYNup4xqrQZrAAVa8CFKKrlUPorg1Wcd bxOpnmjXVygRbNemrGSEvrwQZ+xrXEWGp06QJCBfnc+jT73IY4xTsXwKGnbK45bEODbt xuJ0vTAOsdhzCxbJgYHwryQldvql1Zco/iBh+d5c07MTTqH5ZCRPcNuqGfeybSmWrNDY cDwUiUIGILmWUhed/TJXgpgxgZRuDmj+V36rw05twZ5Dr58SgVcN8piioQhBk1942ZvC IlmuNoBAVWhXeM8RuoQl119U2jYfU97k5R2wCqmBL2bLYJ/sTq/8EUhexAREoxzV3a0Q jtAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=MxgoZ82dZQulyTW9x+5cUibKPWckm6v2DCVfOAXEIQk=; fh=M9qXMmjW4V5+dTtAmZ8W+48oRvQno9U/fljVEY8EFrE=; b=qZrIy0B3l2JC2WOfzdIwuEG77IVzyJuzGjlGcvdsakhWLAJW5NR1hi/NyMCLhaAA3Y bm4NldUriCX7YXY7NtbUO6NkgENe7nsW8lBsmfI00CfnXt+uPgvIFhBUEz3ndWBeX9K1 ByqPzvPEv0+4OwQxPmgGRLT4RTsbWRDWManP6w8H1bjHLpBpl0QSRVw7FOfgpPgUSIVM 5HSUIXYSwpmyo0dTlralwfW19ZVKo+3plDKzQHAz2kMPpHQKI1GaqMZnWSVP1SRiAiCG 18IOmPQAfBA04Jwy7Hf3YJIgyQ2xEsYpMnAOfhZ4Cc3ntYmowBRgYeHDo/D80PprM8Ww ix/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id p17-20020a170902e75100b001ccbfb42dc2si13174361plf.480.2023.11.22.03.22.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 03:22:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 9606A81FDBB5; Wed, 22 Nov 2023 03:22:46 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343629AbjKVLWK (ORCPT + 99 others); Wed, 22 Nov 2023 06:22:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343554AbjKVLWH (ORCPT ); Wed, 22 Nov 2023 06:22:07 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9CE81B9; Wed, 22 Nov 2023 03:22:03 -0800 (PST) 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <268e1605-fe3f-4aa0-92e3-36ddfc8aacb3@arm.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 22 Nov 2023 03:22:46 -0800 (PST) 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