Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp180709rdb; Tue, 5 Dec 2023 02:18:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IGNO6sRvtowXQAL8+TXq5QuP/HHhuxKTG8wz3RX7KqaLD9Hu/8sKLkxT03Zuznv9UFMqSM5 X-Received: by 2002:a17:902:7043:b0:1d0:6ffd:9e35 with SMTP id h3-20020a170902704300b001d06ffd9e35mr5612974plt.135.1701771522276; Tue, 05 Dec 2023 02:18:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701771522; cv=none; d=google.com; s=arc-20160816; b=W1aDwgkcpdewDx7hSwgNi6uDtvdRPpPLNXRjvS3bSekeO3fynk/KLxE0/6kK+dgRNq Rt1DdNbiEeNNdewERzAL10GjbDjuKt32f4qUk3bRb+HGjPR5vg8DPDb9SzAWt3j6qy/X iKupe4PWwa3rgufZKYtuoH4u8lVMdmiwChFq2rD1H+5j4OQzQKU+z6jLZAo9XcRq/xZW YodVNMaDwq0Th+Cvp6k+NFY/2no66b6b7w2Pg+z14kv/SGWA6m+JIl49Skbh1b44raOO JFVffqdlKsvLWmoS0Nq3zZ+1PauzoxvWVJcSruOVIMQvQ033pKNTeNlg/k/u/10lvCML Ikog== 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=Y/2slqzKHv6i6n2MoZtF5XGp3HQDCmsFnruhgQbT2Zs=; fh=r8rDUh1C8RQOR8Nm6f67w6NAFWGW06lFhZTP6iLThw0=; b=FKY6KjjrncUojco/2WX0yRhEbKNnby+vrzuTPReOrHF0Ce3gmTu67in9VSoPFx40sd aX1IyUkcjJKz44YhTTJFaRXBeytfKuG1xz7U+XMJK3ZHqZJ+Tpk6i5wQHthUk4zWRQm4 51ubMKa6vFAKIQI2TtF9sRYlflciOuLZpgQyqRB6NU5xqqPwpsgZN1j44rEy1ZiSnMqV +GmOD84IGUA/GkvHDCL4Eh+5IcF30H0dq4BSmB2fBFg9AmjqeKKFrqUijrVqdRDNYCFa 2pIZC9MqcAMWCSHa6Ez6bN7XKdv99NBFQqJZRTmJmz1KsSbmDEOQXrOZeh3snDmlpqJT k8lA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id j7-20020a170903024700b001cc0e37524bsi9623648plh.212.2023.12.05.02.18.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 02:18:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id 5D70280A2393; Tue, 5 Dec 2023 02:18:39 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235070AbjLEKSW (ORCPT + 99 others); Tue, 5 Dec 2023 05:18:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235028AbjLEKSW (ORCPT ); Tue, 5 Dec 2023 05:18:22 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1011490; Tue, 5 Dec 2023 02:18:28 -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 105DE1007; Tue, 5 Dec 2023 02:19:14 -0800 (PST) Received: from [10.1.197.1] (ewhatever.cambridge.arm.com [10.1.197.1]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A0A893F5A1; Tue, 5 Dec 2023 02:18:25 -0800 (PST) Message-ID: <5cbe90e1-e140-455a-8cc7-c5ebece64170@arm.com> Date: Tue, 5 Dec 2023 10:18:24 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V2 6/7] coresight: stm: Move ACPI support from AMBA driver to platform driver Content-Language: en-US To: Anshuman Khandual , James Clark , linux-arm-kernel@lists.infradead.org, Sudeep Holla Cc: 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 References: <20231201062053.1268492-1-anshuman.khandual@arm.com> <20231201062053.1268492-7-anshuman.khandual@arm.com> <0adc3a16-0fc4-2a25-cd48-4667881b9490@arm.com> <7825dcd4-94e1-7a5f-b388-90e748dfc47f@arm.com> <81cad3a6-a080-424c-ad0b-0f08c4fe51a2@arm.com> From: Suzuki K Poulose In-Reply-To: <81cad3a6-a080-424c-ad0b-0f08c4fe51a2@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed 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 fry.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 (fry.vger.email [0.0.0.0]); Tue, 05 Dec 2023 02:18:39 -0800 (PST) On 05/12/2023 05:20, Anshuman Khandual wrote: > > > On 12/4/23 18:47, James Clark wrote: >> >> >> On 04/12/2023 11:50, Anshuman Khandual wrote: >>> >>> >>> On 12/4/23 15:53, James Clark wrote: >>>> >>>> >>>> On 01/12/2023 06:20, Anshuman Khandual wrote: >>>>> Add support for the stm devices 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. >>>>> >>>>> Cc: Lorenzo Pieralisi >>>>> Cc: Sudeep Holla >>>>> Cc: Suzuki K Poulose >>>>> Cc: Mike Leach >>>>> Cc: James Clark >>>>> Cc: Maxime Coquelin >>>>> Cc: Alexandre Torgue >>>>> Cc: linux-acpi@vger.kernel.org >>>>> Cc: linux-arm-kernel@lists.infradead.org >>>>> Cc: linux-kernel@vger.kernel.org >>>>> Cc: coresight@lists.linaro.org >>>>> Cc: linux-stm32@st-md-mailman.stormreply.com >>>>> Signed-off-by: Anshuman Khandual >>>>> --- >>>> [...] >>>>> >>>>> -module_amba_driver(stm_driver); >>>>> +static int stm_platform_probe(struct platform_device *pdev) >>>>> +{ >>>>> + struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); >>>>> + int ret = 0; >>>>> + >>>>> + pm_runtime_get_noresume(&pdev->dev); >>>>> + pm_runtime_set_active(&pdev->dev); >>>>> + pm_runtime_enable(&pdev->dev); >>>>> + >>>>> + ret = __stm_probe(&pdev->dev, res, NULL); >>>> >>>> Very minor nit, but this used to print this: >>>> >>>> coresight stm0: STM500 initialized >>>> >>>> And now it prints this: >>>> >>>> coresight stm0: (null) initialized >>>> >>>> (null) kind of makes it look a little bit like something has gone wrong. >>>> Maybe we could just put "initialised" if you don't have a string from ACPI? >>> >>> __stm_probe() gets called from both AMBA and platform driver paths. Even though >>> a NULL check inside dev_info(..."%s initialized\n",...) could be added, but how >>> to differentiate it from a scenario when coresight_get_uci_data() returns NULL ? >> >> Sudeep's suggestion seems ok, just add a hard coded string instead of >> the NULL. And keep the coresight_get_uci_data() the same. > > Something like this works ? > > diff --git a/drivers/hwtracing/coresight/coresight-stm.c b/drivers/hwtracing/coresight/coresight-stm.c > index 3387ebc9d8ab..2b6834c4cac6 100644 > --- a/drivers/hwtracing/coresight/coresight-stm.c > +++ b/drivers/hwtracing/coresight/coresight-stm.c > @@ -906,7 +906,7 @@ static int __stm_probe(struct device *dev, struct resource *res, void *dev_caps) > pm_runtime_put(dev); > > dev_info(&drvdata->csdev->dev, "%s initialized\n", > - (char *)dev_caps); > + dev_caps ? (char *)dev_caps: "STM"); > return 0; > Please could stop abusing the private data for storing the name ? Instead, we could read the PID of the device and use a table to map it to the name and use that instead ? Suzuki > cs_unregister: >