Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp75618rdb; Mon, 4 Dec 2023 21:31:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IGxcgJOI7jTkN3EDD16KTcgxJqqoB3ypsYZ6CZJJZUcKMNkqP4QigJBECC5aKWvqHn+oXYR X-Received: by 2002:a17:90b:3682:b0:286:b2c1:2e85 with SMTP id mj2-20020a17090b368200b00286b2c12e85mr483268pjb.35.1701754278619; Mon, 04 Dec 2023 21:31:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701754278; cv=none; d=google.com; s=arc-20160816; b=AUstyLYgvbtLbA7yeZisScXZskFK1pMDNc152zQ9FYVSgYyDRZ/HGwBoxtoSOEdhtl tjXYhVe6l7AKbqNo4m49FZmSYep/iVkVi9n7zE4Rp7SNXoTStwaUtYRMegGmTm3XHE6S N/IxenoEhf1Jj7tDRag1mMJMVV2aG66P9MoBz2eZfSrzDWXJS7XRs0H02eVUc+sVFJGd kQcrqPev4r9fLVuCeJ07h8cWnjCKrXHPjapoWubVDzsKDbw6gVajyTptYtiNaOLQEcU4 RyoamLoc7HZYlGHH6vB+RDJJ4/io9OF04ZM9JaJebWeNYfy1c56kLG1LX80etEtdOrdm kncw== 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=xzkoixXlYzLorh9/4xTDx1jrKVqycH5IwTBiX8iiAig=; fh=rJ2AYVj0uqgkdLzrPjURwe96bkuYSm6zq/na+EuVvAg=; b=Abs0Xc4UEkNRvKuL6t5g6h8RYXyRp/X0vZ25WNsBGysyGdvC1J0nS+xX7h3pTtlRml fO9jQDCEiFMgqJZiI+4krZfRk+USHnmBh0Tg/ow2nu9a3RxnGunE6n6ZRgKuSx6mV2OU uo9NyZL8FbzkvKhQw5WcJR2q6JjlRtICt8dgu2uu7EG6/hCfcceELFKS+T2rZ/ArwJEj jpuD5OaV/B4cEzgD9jnOhBKPKnu+beIu7PM4cyvD4Vj/tOnsk4KxXeWeudnAQNLFMUdp obzPe3M/uRsm6wLKTfBtfWIIrxs5CzApLRde11Injs/ADyyGXCPqgMN4oXqTmW30vTf1 BR6Q== 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 bo13-20020a17090b090d00b00286a9514be8si3123437pjb.81.2023.12.04.21.31.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 21:31:18 -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 CDD6880937BD; Mon, 4 Dec 2023 21:31:15 -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 S230074AbjLEFUX (ORCPT + 99 others); Tue, 5 Dec 2023 00:20:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229611AbjLEFUW (ORCPT ); Tue, 5 Dec 2023 00:20:22 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DA86E101; Mon, 4 Dec 2023 21:20:27 -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 339731007; Mon, 4 Dec 2023 21:21:14 -0800 (PST) Received: from [10.163.35.139] (unknown [10.163.35.139]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4F30B3F762; Mon, 4 Dec 2023 21:20:23 -0800 (PST) Message-ID: <81cad3a6-a080-424c-ad0b-0f08c4fe51a2@arm.com> Date: Tue, 5 Dec 2023 10:50:19 +0530 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: James Clark , linux-arm-kernel@lists.infradead.org, suzuki.poulose@arm.com, 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> From: Anshuman Khandual In-Reply-To: <7825dcd4-94e1-7a5f-b388-90e748dfc47f@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 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]); Mon, 04 Dec 2023 21:31:16 -0800 (PST) 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; cs_unregister: