Received: by 2002:a05:7412:bc1a:b0:d7:7d3a:4fe2 with SMTP id ki26csp670422rdb; Sat, 19 Aug 2023 19:44:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHe/Ua3691hqUW2tQ9wl8H+gFQ5OVxmQfLBKhBum/qXNKsn/HTnIdoMr+z4t7MZzm6Nxlfw X-Received: by 2002:a05:6a00:2d10:b0:681:9fe0:b543 with SMTP id fa16-20020a056a002d1000b006819fe0b543mr3711796pfb.2.1692499481006; Sat, 19 Aug 2023 19:44:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692499480; cv=none; d=google.com; s=arc-20160816; b=MLr7bbtnumCmJMjzcEzisXCQ72mQm0FX0r1LTCqRpHTFbdQmJv6PTdAmNaHodnLMBe oZy+fWk88pVNVM1dGKxoPCSyyCo+9yh8lgSj5HSgmF2bxFNqlILB0eYI5S2MuQ+cgX4j Mg/2eIA+itmv4jFfysx8cYzDSwFNU8mZ0R3Wz6JR1Y80fQcWK+VDFdNja6Oq4UT+fNpI 9iZ+FeuAk0SGyyp74c4JN6vOxfCkIkOoc3hFGo2otdT0tk3P39/FaW8VmFbUqguYVpM+ /Q9NSlGpGkJPivd8sD8ZHSkoXLagfI1Qmr8+r1qGXOpbIfbVrTBb1rKqJLVQrjiK1EgK UpEQ== 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=phLWBxeDn6DeMsU59lVJnRaQUhALrPkAmThRF+iQ848=; fh=dyXKfogydv8oZAGvPOTYn4Aj0AzUe7Hc2uRztMJT058=; b=o5WuxTbTLb1Adep0HuVTt90fAU+L6lQ6dM7ENTS/buyZyvYD8x6EtkcBqozpscpTca +WbmZ75RJIRfwpmZBA3BDxXkt9oGVfu+WcLgwqSF0JnC8yTAifkHA3fEC02YfNVg3qSy uM7dZp7cM33UNHkVQ4jHotK0NLyQ8JID/gknkvl0nGOlSA+6/ksnVUga6cf7ZxI0oJSJ s+qurClUIEW4Qgjlg1HutggU4JgK3X8KYRUp5UgSI7nJHw3wXdwfpYeKpX3MWRAu7Q/6 Jg2WQIc8+zdSEbXaVegL2kQ/JLSWPIZq47AKsT4Gd1xIPhKxcfQaUj1Ev3wo49YyduU1 xDRw== 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:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id dc4-20020a056a0035c400b00687071384a7si4294886pfb.152.2023.08.19.19.44.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Aug 2023 19:44:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C6D1D26909C; Sat, 19 Aug 2023 11:39:50 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348255AbjHQGhY (ORCPT + 99 others); Thu, 17 Aug 2023 02:37:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348256AbjHQGhM (ORCPT ); Thu, 17 Aug 2023 02:37:12 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 515A81B4 for ; Wed, 16 Aug 2023 23:37:09 -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 E2B98D75; Wed, 16 Aug 2023 23:37:49 -0700 (PDT) Received: from [10.163.56.113] (unknown [10.163.56.113]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B92473F762; Wed, 16 Aug 2023 23:37:04 -0700 (PDT) Message-ID: <9cd9f83c-7778-2d87-a175-a4cb7ceb8723@arm.com> Date: Thu, 17 Aug 2023 12:07:02 +0530 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 2/2] coresight: trbe: Allocate platform data per device Content-Language: en-US To: Suzuki K Poulose , hejunhao3@huawei.com Cc: coresight@lists.linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, jonathan.cameron@huawei.com, leo.yan@linaro.org, mike.leach@linaro.org, james.clark@arm.com, linuxarm@huawei.com, yangyicong@huawei.com, prime.zeng@hisilicon.com References: <20230814093813.19152-1-hejunhao3@huawei.com> <20230816141008.535450-1-suzuki.poulose@arm.com> <20230816141008.535450-2-suzuki.poulose@arm.com> From: Anshuman Khandual In-Reply-To: <20230816141008.535450-2-suzuki.poulose@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,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 Hi Suzuki, Seems like this patch is going to conflict with the below proposed change https://lore.kernel.org/all/20230817055405.249630-4-anshuman.khandual@arm.com/ Please let me know how should we resolve this conflict. On 8/16/23 19:40, Suzuki K Poulose wrote: > Coresight TRBE driver shares a single platform data (which is empty btw). > However, with the commit 4e8fe7e5c3a5 > ("coresight: Store pointers to connections rather than an array of them") > the coresight core would free up the pdata, resulting in multiple attempts > to free the same pdata for TRBE instances. Fix this by allocating a pdata per > coresight_device. > > Fixes: 3fbf7f011f24 ("coresight: sink: Add TRBE driver") The above mentioned commit i.e 4e8fe7e5c3a5 seems to be a more recent one which has triggered this problem. But would the problem be still there without that ? Else 'Fixes:' tag would need changing. > Link: https://lore.kernel.org/r/20230814093813.19152-3-hejunhao3@huawei.com > Reported-by: Junhao He > Cc: Anshuman Khandual > Signed-off-by: Suzuki K Poulose > --- > drivers/hwtracing/coresight/coresight-trbe.c | 11 ++++------- > 1 file changed, 4 insertions(+), 7 deletions(-) > > diff --git a/drivers/hwtracing/coresight/coresight-trbe.c b/drivers/hwtracing/coresight/coresight-trbe.c > index 025f70adee47..d3d34a833f01 100644 > --- a/drivers/hwtracing/coresight/coresight-trbe.c > +++ b/drivers/hwtracing/coresight/coresight-trbe.c > @@ -1255,10 +1255,13 @@ static void arm_trbe_register_coresight_cpu(struct trbe_drvdata *drvdata, int cp > if (!desc.name) > goto cpu_clear; > > + desc.pdata = coresight_get_platform_data(dev); > + if (IS_ERR(desc.pdata)) > + goto cpu_clear; > + > desc.type = CORESIGHT_DEV_TYPE_SINK; > desc.subtype.sink_subtype = CORESIGHT_DEV_SUBTYPE_SINK_PERCPU_SYSMEM; > desc.ops = &arm_trbe_cs_ops; > - desc.pdata = dev_get_platdata(dev); > desc.groups = arm_trbe_groups; > desc.dev = dev; > trbe_csdev = coresight_register(&desc); > @@ -1482,7 +1485,6 @@ static void arm_trbe_remove_irq(struct trbe_drvdata *drvdata) > > static int arm_trbe_device_probe(struct platform_device *pdev) > { > - struct coresight_platform_data *pdata; > struct trbe_drvdata *drvdata; > struct device *dev = &pdev->dev; > int ret; > @@ -1497,12 +1499,7 @@ 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); > - > dev_set_drvdata(dev, drvdata); > - dev->platform_data = pdata; > drvdata->pdev = pdev; > ret = arm_trbe_probe_irq(pdev, drvdata); > if (ret)