Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp2268993rwo; Thu, 3 Aug 2023 07:10:58 -0700 (PDT) X-Google-Smtp-Source: APBJJlGyr7t7HOpOmo+0UcVdaMZrW2RloNtIEnAA70El8XRZ2AfMwsBM2Xo9vVWKwcq0LK46JSD5 X-Received: by 2002:a05:6a20:d90b:b0:13d:af0e:4ee5 with SMTP id jd11-20020a056a20d90b00b0013daf0e4ee5mr13400129pzb.18.1691071858169; Thu, 03 Aug 2023 07:10:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691071858; cv=none; d=google.com; s=arc-20160816; b=ub8HbMHI97BDkH0HzCNU866OYhcoNnPCpoAA5/Wwkaih+rs8ElS31QKnWRNQo9Lt09 Hqk3PjuPZYCyZGex8/Yh7XgMxsjorzORm4vwDlQ22LhLfo3xKrFPh0Au4uPnD7X5j/Je iJeWWGIoWUbLXWiiMLjCi0znR33az7Gau02B6pwzgXvwF/EOrJDkR4uQnrG4VT6thp13 UVZsOlsQhYij7PVrPQwd1WfJurFJ8VAOyQykCyx6bbyVhwt07Al8s4M91IKP7oinRWxY uPgg6hQH/xIJnd14a00zJzAp7lpxuRizb3vcyi5Hxod52w7fGCXK7mtBqpvWsmKtY4YS nRhw== 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 :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id; bh=fbbQpd86tG8C//PwF7jS0r4neA+qkCccnykMkzfhthM=; fh=XMDh11FGkFxPL8aai5YYSXPhUasHrfon5kK6ORJJwLI=; b=WcU+jVFfUDXuLfuUHnCgJcDC+em0mqzo9ijhTlagzYxReMHgnAOoL7+OudDJ2eCFmj Auy83whYxGgQNUiWZuM/vk6wPUWJGtvDuc6j3Nmr2UhU3CGbpRUAm9HVzgljxH+7m1uc OjaRvhk4vOoDbuODxSfixM/kSJEuLcE4rQeCuLoyFoiwDGeM6XzdJHXX/esVPbKbn22U XRiidEAXK0TQry88ZT7u9ueu+5yXZwKW/HXcmsqIbFVz7dioFIzwaF4wD6vNyWqH+Dng QJ3OBJhSj8YygaUKS4XlrijH5n6ZaQ2HSvHLsM+RdyXeem30eutPEKXAKLRPoY4uzU/A vjag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w4-20020a656944000000b005536fc5187asi12512384pgq.47.2023.08.03.07.10.43; Thu, 03 Aug 2023 07:10:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233558AbjHCNzT (ORCPT + 99 others); Thu, 3 Aug 2023 09:55:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229576AbjHCNzS (ORCPT ); Thu, 3 Aug 2023 09:55:18 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0F82B196 for ; Thu, 3 Aug 2023 06:55:17 -0700 (PDT) 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 96F6D113E; Thu, 3 Aug 2023 06:55:59 -0700 (PDT) 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 030653F5A1; Thu, 3 Aug 2023 06:55:14 -0700 (PDT) Message-ID: <3a9b34c0-f5cc-8d55-d5b7-813e400d7715@arm.com> Date: Thu, 3 Aug 2023 14:55:13 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH V3 3/4] coresight: trbe: Add a representative coresight_platform_data for TRBE To: Anshuman Khandual , linux-arm-kernel@lists.infradead.org Cc: Sami Mujawar , Catalin Marinas , Will Deacon , Mark Rutland , Mike Leach , Leo Yan , Alexander Shishkin , James Clark , coresight@lists.linaro.org, linux-kernel@vger.kernel.org References: <20230803055652.1322801-1-anshuman.khandual@arm.com> <20230803055652.1322801-4-anshuman.khandual@arm.com> Content-Language: en-US From: Suzuki K Poulose In-Reply-To: <20230803055652.1322801-4-anshuman.khandual@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/08/2023 06:56, Anshuman Khandual wrote: > TRBE coresight devices do not need regular connections information, as the > paths get built between all percpu source and their respective percpu sink > devices. Please refer 'commit 2cd87a7b293d ("coresight: core: Add support > for dedicated percpu sinks")' which added support for percpu sink devices. > > coresight_register() expect device connections via the platform_data. TRBE > devices do not have any graph connections and thus is empty. With upcoming > ACPI support for TRBE, we do not get a real acpi_device and thus > coresight_get_platform_dat() will end up in failures. Hence this allocates > a zeroed coresight_platform_data structure and assigns that back into the > device. > > Cc: Suzuki K Poulose > Cc: Mike Leach > Cc: Leo Yan > Cc: Alexander Shishkin > Cc: coresight@lists.linaro.org > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Anshuman Khandual > --- > drivers/hwtracing/coresight/coresight-trbe.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/hwtracing/coresight/coresight-trbe.c b/drivers/hwtracing/coresight/coresight-trbe.c > index 7720619909d6..e1d9d06e7725 100644 > --- a/drivers/hwtracing/coresight/coresight-trbe.c > +++ b/drivers/hwtracing/coresight/coresight-trbe.c > @@ -1494,9 +1494,9 @@ static int arm_trbe_device_probe(struct platform_device *pdev) > if (!drvdata) > return -ENOMEM; > > - pdata = coresight_get_platform_data(dev); > - if (IS_ERR(pdata)) > - return PTR_ERR(pdata); > + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); > + if (!pdata) > + return -ENOMEM; Please could you add a comment in here, on why we use a dummy platform data ? It is good to have documented it in the code too. Suzuki > > dev_set_drvdata(dev, drvdata); > dev->platform_data = pdata;