Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6059449rwl; Tue, 4 Apr 2023 07:20:22 -0700 (PDT) X-Google-Smtp-Source: AKy350YEA+QnxSe+AGNkNctF3Pu90clV6Jj+zkSvVAuWldj0MK66qYVQlk6UDcdWpxFSxZRn1O3T X-Received: by 2002:a17:903:42cb:b0:1a0:4913:61f3 with SMTP id jy11-20020a17090342cb00b001a0491361f3mr2990997plb.37.1680618022693; Tue, 04 Apr 2023 07:20:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680618022; cv=none; d=google.com; s=arc-20160816; b=GoKfFhfj07SJhWnuFVjp55e3LXY4E35uVUxE6uV0/ZLQXmNQTUFUz6Alugqj2DYBxO fFohJYLcAuaXGFi+vdJzjg3niHauF51ub8xL1G5j3EtFErTKoserqbaqGEc+Ot5a5PgF 1nnYhQlKy/tov9Y+h1Z9hKoRXImaqwZrY2vO228MLfnvna7Vwdpidgf0iz3i5+f1uWNg cKWQPjedcbdwv5L5Z5WDx+4EV67bS64dHktMuyK446qJrNLZp3zpkx/JEXbeqfUQt76P GryKXSp3iJU7hI4gtfKt0j6ITVJcnR0g1QyW2EkSTULlFP41m0xCi5mZjuvr67f9+b+q jzTQ== 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=arptX9PSKdjS8CejGr8ehDFTACiY0/PS0Kp38+hG73Q=; b=qXvTsXIPlG9qmeDl9pjpirZFiX+dtnsMN3CzfK1Vy4AnkNSzKv7HT17USlsld+9OBj RiIy+7yxcR+OZfcTRjvfDdZvhmqX01/1BfPQo3ArRRui7D6IeVKTanO0hP3VVe64K9qR ZKyZuEaN5NTpn/k3bn8bU6qjwFZySabZV5uT+lBFo3zKCQdDve/szMWlKVHQNz8lpY+L fJhFhCTbGnYi5fJuwJmsk425iBKKtVXNiOKPQtnZsVzF8Vez8P8dQ8eBuYucy/MCpl3p r6MSLiqQUjiayP1tyu/iaqDLqR08Z2C317N3q8Gp0T2jMaMk6WXhg8uireZMznRMBFYh D9Ng== 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 c20-20020a6566d4000000b0050bdc305c3bsi10310671pgw.312.2023.04.04.07.20.09; Tue, 04 Apr 2023 07:20:22 -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 S235165AbjDDOLt (ORCPT + 99 others); Tue, 4 Apr 2023 10:11:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234223AbjDDOLs (ORCPT ); Tue, 4 Apr 2023 10:11:48 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1E400AF for ; Tue, 4 Apr 2023 07:11:47 -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 D5220D75; Tue, 4 Apr 2023 07:03:06 -0700 (PDT) Received: from [10.57.53.173] (unknown [10.57.53.173]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BFC413F762; Tue, 4 Apr 2023 07:02:20 -0700 (PDT) Message-ID: <8cb0be8c-8ff2-d643-2dba-135974c8bc3b@arm.com> Date: Tue, 4 Apr 2023 15:02:19 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH v4 01/13] coresight: Fix loss of connection info when a module is unloaded To: James Clark , coresight@lists.linaro.org, quic_jinlmao@quicinc.com, mike.leach@linaro.org Cc: Mathieu Poirier , Leo Yan , Alexander Shishkin , Greg Kroah-Hartman , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20230404135401.1728919-1-james.clark@arm.com> <20230404135401.1728919-2-james.clark@arm.com> From: Suzuki K Poulose In-Reply-To: <20230404135401.1728919-2-james.clark@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.2 required=5.0 tests=NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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/04/2023 14:53, James Clark wrote: > child_fwnode should be a read only property based on the DT. If it's minor nit: Not restricted to DT. This also covers the ACPI. > cleared on the parent device when a child is unloaded, then when the > child is loaded again the connection won't be remade. > > child_dev should be cleared instead which signifies that the connection > should be remade when the child_fwnode registers a new coresight_device. > > Similarly the reference count shouldn't be decremented as long as the > parent device exists. The correct place to drop the reference is in > coresight_release_platform_data() which is already done. > > Reproducible on Juno with the following steps: > > # load all coresight modules. > $ cd /sys/bus/coresight/devices/ > $ echo 1 > tmc_etr0/enable_sink > $ echo 1 > etm0/enable_source > # Works fine ^ > > $ echo 0 > etm0/enable_source > $ rmmod coresight-funnel > $ modprobe coresight-funnel > $ echo 1 > etm0/enable_source > -bash: echo: write error: Invalid argument > > Fixes: 37ea1ffddffa ("coresight: Use fwnode handle instead of device names") > Fixes: 2af89ebacf29 ("coresight: Clear the connection field properly") > Signed-off-by: James Clark Looks good to me. Tested-by: Suzuki K Poulose