Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp902326rdf; Tue, 21 Nov 2023 23:03:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IHXvdM4ZyJESiNdtrUc8oi/Mkf7RBPQhndUd03X9IzdcQcHdABnqk3cJRAJu+ZqNssNuWNP X-Received: by 2002:a05:6a00:39a4:b0:68b:e29c:b69 with SMTP id fi36-20020a056a0039a400b0068be29c0b69mr2403159pfb.9.1700636579714; Tue, 21 Nov 2023 23:02:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700636579; cv=none; d=google.com; s=arc-20160816; b=DDQXeG55xmdsFQkGqBwlxFRjFKU9z2IahxCVgT3jQKRaspS+HriZqG6+CyceFKQPQN oiyOhfaQ06pRe1XsNTYO38ISFHOSEmNllqyTvW8rujRi29YHvlQxca9VhQJDFZ8HjtMq BfWb9Sih6BBED+c2PSFHbkecA436oduF6Rapyo6C8MPHKMDSHWrLdZR/oQOjQcyNi48C WzrOnLFohkexLny1QFC7DLR4kbS7uxHL0iHnrR+b4J8vyPArV+GIKSIiWu8kmwd1K9r1 uvy1swjwXlG+3DSbH5uGWVEw3tVmT8Wdg2C78JHvTL2s+XH37nsor/TzjHrwm5Lszx8N Ee1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=pWOJkpLuKv6P0QzrA85qEmd5dAGqA5FfGDYUAJLjYiE=; fh=bYYeCqBxkLtl1kWsk8OOCkbj3abGxVAJF1rZR07HU1c=; b=pV2lN/To7XkEFC2iFAuv9aNtHb4FQaT8FP03m7RJ1qMSOyl8i6YIG3yNxoGh4ftC3N YGsbmw1Yl5+RE1OvJMD1VWdeGcA71akWdOS3l6aCrymrXdyF4cShdtEpM8r4FDhfd1YH phWwIjRK4QkzpL+n7YtTcT02C2VhmBk2Bn2ZjBDfDQSr8xGt9ZX9VpgbVZZ9tqqyIO3Y nRDZQn43QDNcC5/l09BqzedN0zmp0qTz7wcRsjFre6uVZwpP/QM+jHpUkmHZV7KZ2RFB CXa2LC0C8Q1imoxZR+l7OZcgzfxI4l+RV31GrkRnCBt7DX/jAkh75imMopasfewSzQTA /uXw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id t17-20020a056a0021d100b006cba5c619fcsi5688023pfj.240.2023.11.21.23.02.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 23:02:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 60C36819CC0A; Tue, 21 Nov 2023 23:02:57 -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 S230137AbjKVHCp (ORCPT + 99 others); Wed, 22 Nov 2023 02:02:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229931AbjKVHCo (ORCPT ); Wed, 22 Nov 2023 02:02:44 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B2D97110; Tue, 21 Nov 2023 23:02:40 -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 34E521595; Tue, 21 Nov 2023 23:03:27 -0800 (PST) Received: from [10.162.41.8] (a077893.blr.arm.com [10.162.41.8]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E6C223F73F; Tue, 21 Nov 2023 23:02:36 -0800 (PST) Message-ID: <268e1605-fe3f-4aa0-92e3-36ddfc8aacb3@arm.com> Date: Wed, 22 Nov 2023 12:32:33 +0530 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 4/7] coresight: tpiu: Move ACPI support from AMBA driver to platform driver Content-Language: en-US To: James Clark , linux-arm-kernel@lists.infradead.org, suzuki.poulose@arm.com Cc: Lorenzo Pieralisi , Sudeep Holla , 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 References: <20231027072943.3418997-1-anshuman.khandual@arm.com> <20231027072943.3418997-5-anshuman.khandual@arm.com> <92d6a66d-3270-3378-2ab9-9214c004d5c7@arm.com> From: Anshuman Khandual In-Reply-To: <92d6a66d-3270-3378-2ab9-9214c004d5c7@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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]); Tue, 21 Nov 2023 23:02:57 -0800 (PST) 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.