Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp447865pxb; Wed, 22 Sep 2021 05:54:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCxb31q3lLmQbOMIbY2PFic06Jqxlm2HfxpS3ZsXcmGv1UVYg0ZNJm8d1QKfa9G+pAVSac X-Received: by 2002:a02:270c:: with SMTP id g12mr4594399jaa.75.1632315294356; Wed, 22 Sep 2021 05:54:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632315294; cv=none; d=google.com; s=arc-20160816; b=T8rN7/Xob7Z1/JryDVYzpPcKYfwQNaeq/xRsTIu7Ph7/MjEHFRJXusOGuVx65liM6R CeemI/YLkjQnaupE9XMmcl7ouKUKRk5/nAEVu9LbQL7h4ajzN+oCaTkfZLfqEmR7WAv2 JUkLeS/Dyju/7e8lKdcteZr8dr5/NHq/y80PC8wwDN3OCHe0T71hUi8Jbi2ng0BHz+7F vVKQQQ810+72va1EeHLmMFWmvObbFFBB4w0BeF92vpeKfa/839FoHL0s0KVFlj1J6meO BuvZ9+8AVvCH3yDvYgxpMimv9HApSqd0eMlcYeS49pQPrx7Cd5uWYltTdJtHzMS4yHUH fY1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=PNbZ4dl07ZgOl9+Nhcn7JCBbBIQYMVDbQqXZe9vJ328=; b=uqYuRzMpRn8ehK/WwZoR8OmepXe5cR+ikD+ivK3TxgIQB4TKtxMghNa9nsw5Xsoh3M YLBrjRH2PmX1VQbHnP5sxzdQGT7QtJBWsVXRjfP0BZQnPy5AVcf4prSRQCMyvEl6oP1j 8hP010hM0MUluYaP8sALgaSloSXgC9o1O4bGd7oKcttUHxNDJZyqm/jBLyOSh8RrZNOz KhxA1CjgZ5XyfvJNxEv9fO+o2naQKt78aeGJA/+8XqnQFw82NQtxKHTc+6WCyqaOFvQ3 EP+PUYkwAqwxZRf73v8xppndtyZCkLOEPhIR2q/BglM3h7lkWSPtK72vNjQrumqf2dHY empQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v2si2450816iot.49.2021.09.22.05.54.42; Wed, 22 Sep 2021 05:54:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236035AbhIVMzb (ORCPT + 99 others); Wed, 22 Sep 2021 08:55:31 -0400 Received: from foss.arm.com ([217.140.110.172]:48624 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236045AbhIVMz3 (ORCPT ); Wed, 22 Sep 2021 08:55:29 -0400 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 7138F11B3; Wed, 22 Sep 2021 05:53:59 -0700 (PDT) Received: from [10.57.50.100] (unknown [10.57.50.100]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6FA1C3F40C; Wed, 22 Sep 2021 05:53:58 -0700 (PDT) Subject: Re: [PATCH] coresight: Don't immediately close events that are run on invalid CPU/sink combos To: Suzuki K Poulose , mathieu.poirier@linaro.org, coresight@lists.linaro.org Cc: Mike Leach , Leo Yan , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20210921130231.386095-1-james.clark@arm.com> From: James Clark Message-ID: <859c5009-a050-2832-7e1b-e88c5d2acd12@arm.com> Date: Wed, 22 Sep 2021 13:53:42 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22/09/2021 10:24, Suzuki K Poulose wrote: > On 21/09/2021 14:02, James Clark wrote: [...] >> -    event->hw.state = 0; >> - >>       /* Finally enable the tracer */ >>       if (source_ops(csdev)->enable(csdev, event, CS_MODE_PERF)) >>           goto fail_disable_path; >>   +out: >> +    /* Tell the perf core the event is alive */ >> +    event->hw.state = 0; >>       /* Save the event_data for this ETM */ >>       ctxt->event_data = event_data; >> -out: >>       return; > > Hi James, > > I think this problematic. The "out" label is reached from the "failed" > path. So, we would reset the STOPPED state. I think we should simply > return when we reach the "fail" label. > > Please could you resend this patch with the changes. > > Kind regards > Suzuki > Oops yes I missed that, I've resubmitted. It probably would have just about worked because from my testing it seems like the event isn't re-enabled if perf_aux_output_end() is called from start regardless of the STOPPED/RUNNING state. Thanks James