From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64F3EC433F5 for ; Wed, 22 Sep 2021 12:54:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 451D06126A for ; Wed, 22 Sep 2021 12:54:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236169AbhIVMzb (ORCPT ); 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