Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp3341690rwo; Fri, 4 Aug 2023 03:29:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFAWDLENG1LKt6/TbDQ8V/aAvHqTAHbUbu592AfHbM6fan8ntbFspBuwTgo/W4PWz67aSBb X-Received: by 2002:a17:90a:989:b0:263:e133:b9c9 with SMTP id 9-20020a17090a098900b00263e133b9c9mr1017018pjo.34.1691144952193; Fri, 04 Aug 2023 03:29:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691144952; cv=none; d=google.com; s=arc-20160816; b=w0414S8Oeij6p7coPbV1u1L9/iMZj5fECx7zAp4wytYI1odlbmeVC69zWpVZauwNTZ yv4LbouhUGq04b59a+sK3p/Ju0WslLdhHM95Vcs9hlMQ0Pxc7DTLEKzrSE8lOofGxJNj v56XVKaprf9Q0E+5Sox0vUP/P2L5p1ICHXGagJ7lESEwsFFn8T9mQ07y5RsDEcNc1t2J 9o/vkdrMNr5WXOueddWYxN28CKZcsYzm6Br0KwevIaFzrF41pqQg4G/soH5ote4b+mYY EmQagUsWpfFxEQI5P/Sij6nchsBczfs5RaJ/2oyZHeYgNTNCGFcGsFAegCoDzTO4j2Nx Hgzg== 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:subject:user-agent:mime-version:date:message-id; bh=p9WCpz6sDkYmVsLRToh7pjSm6OIuKm91JxPqsDQ9pZc=; fh=XMDh11FGkFxPL8aai5YYSXPhUasHrfon5kK6ORJJwLI=; b=tKSNNUxQ3W96/M65TFOo0vg5xTSmR13Mx3yuTyPcyN3tbZERZTY4HspH6vDXGvPutB pZkWbdamuIFU1Rw9ZsfEA0a6AL36Yf5FKnpEXYp2nPYXV5CVAgYpucAtNJXiT3kDgbEs Dz70BQHAQMyNcSIVG65VJw9LcmpzGNJp90MeSidZ1r5KTVDkYtyaV36d0IKZhV1sc7mT EpaRa7iqfPO32luAofbig4s1T98uSYxrNInQGgo6LJkhM+iHgvZyDueK3lon+bMhkLMg 4enWBwHftLa1JdnDM29A4ci+IHKt679pIZwyZSv/ohWs6zC2OkJ4e2aUv1WKc77Oh/Vi xaLA== 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 l14-20020a17090a408e00b00262e77d645asi1203177pjg.174.2023.08.04.03.29.00; Fri, 04 Aug 2023 03:29:12 -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 S230246AbjHDKEf (ORCPT + 99 others); Fri, 4 Aug 2023 06:04:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230341AbjHDKEa (ORCPT ); Fri, 4 Aug 2023 06:04:30 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5AF2D46B5 for ; Fri, 4 Aug 2023 03:04:29 -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 C4ED81007; Fri, 4 Aug 2023 03:05:11 -0700 (PDT) Received: from [10.57.90.43] (unknown [10.57.90.43]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4ACA53F6C4; Fri, 4 Aug 2023 03:04:27 -0700 (PDT) Message-ID: Date: Fri, 4 Aug 2023 11:04:25 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; 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> <3a9b34c0-f5cc-8d55-d5b7-813e400d7715@arm.com> <3676cc3a-91f1-ec50-5d89-2a3901d0fda7@arm.com> From: Suzuki K Poulose In-Reply-To: <3676cc3a-91f1-ec50-5d89-2a3901d0fda7@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE 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 04/08/2023 10:18, Anshuman Khandual wrote: > > > On 8/3/23 19:25, Suzuki K Poulose wrote: >> 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. > > Sure, will add the following in-code documentation. > > + /* > + * TRBE coresight devices do not need regular connections > + * information, as the paths get built between all percpu > + * source and their respective percpu sink devices. Though > + * coresight_register() expect device connections via the > + * platform_data, which TRBE devices do not have. As they > + * are not real ACPI devices, coresight_get_platform_dat() minor nit: s/coresight_get_platform_dat/coresight_get_platform_data/ here and above in the description. Otherwise, looks good. Suzuki